Skip to content

Add LSP integration tests #65

@geoffjay

Description

@geoffjay

Summary

Add integration tests for the nemo-lsp server: verify completions for component names, attribute names, and enum values; hover documentation; diagnostics for invalid configs; and go-to-definition for templates and data sources.

Context

The LSP operates over JSON-RPC via stdin/stdout. Integration tests should:

  • Start the LSP binary as a child process
  • Send initialize, textDocument/didOpen, and other LSP messages
  • Verify the JSON-RPC responses contain expected completion items, diagnostics, hover content, etc.
  • Use sample Nemo XML files that exercise all completion and diagnostic scenarios

Acceptance Criteria

  • Test harness starts nemo-lsp binary and communicates over stdin/stdout JSON-RPC
  • Test: textDocument/completion returns component element names when inside <layout>
  • Test: textDocument/completion returns attribute names for a known component (button, label)
  • Test: textDocument/completion returns enum values for constrained string attributes (variant, size)
  • Test: textDocument/hover returns property documentation with type and default
  • Test: textDocument/diagnostic reports missing required attributes
  • Test: textDocument/diagnostic reports unknown component types
  • Test: textDocument/definition navigates to template definitions
  • Test: textDocument/definition navigates to data source definitions
  • Test: completion for template="..." returns template names from current file
  • Test: completion for source="..." in <binding> returns data source names
  • Sample XML files in crates/nemo-lsp/tests/fixtures/ covering edge cases
  • Tests runnable via cargo test -p nemo-lsp

Relevant Files

  • crates/nemo-lsp/ — the LSP server
  • crates/nemo-config/src/xml_parser.rs — XML parsing used by LSP
  • crates/nemo-config/src/validator.rs — validation used by diagnostics

Stack Base

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions