Skip to content

feat: MDA Language Server with diagnostics and VS Code extension (Phase 1) - #43

Open
damianh wants to merge 1 commit into
mainfrom
ide-integration
Open

feat: MDA Language Server with diagnostics and VS Code extension (Phase 1)#43
damianh wants to merge 1 commit into
mainfrom
ide-integration

Conversation

@damianh

@damianh damianh commented Apr 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add Atoll.Lsp — an LSP server for .mda files using OmniSharp.Extensions.LanguageServer v0.19.9, providing real-time diagnostics (YAML syntax errors, unknown components, missing required frontmatter fields), document parsing, and project context discovery via assembly scanning
  • Add Atoll.Lsp.Vscode — a VS Code extension with TextMate grammar for .mda syntax highlighting and a language client that launches the LSP server via stdio
  • Add Atoll.Lsp.Tests — 36 xUnit v3 tests covering LineMap, MdaDocumentParser, and all three diagnostic rules

What's included

src/Atoll.Lsp/ — LSP Server

  • Parsing: MdaDocumentParser extracts frontmatter, directive usages (:::name{}), tag usages (<PascalCase>), and headings using Atoll's FrontmatterParser + regex
  • Analysis: Three diagnostic rules — YamlSyntaxErrorRule, UnknownComponentRule, MissingRequiredFrontmatterRule
  • Context: ProjectContextProvider loads the user's compiled assembly to discover registered components and collection schemas
  • Handlers: TextDocumentSyncHandler for document lifecycle (open/change/close/save) with debounced re-analysis
  • Program.cs: Server entry point with stdio transport

src/Atoll.Lsp.Vscode/ — VS Code Extension

  • TextMate grammar for frontmatter, directives, tags, and Markdown
  • Language client configuration with server binary discovery
  • Language configuration for brackets, comments, auto-closing pairs

tests/Atoll.Lsp.Tests/ — Tests

  • LineMapTests — offset to position mapping
  • MdaDocumentParserTests — frontmatter, directives, tags, headings, code block skipping
  • UnknownComponentRuleTests, YamlSyntaxErrorRuleTests, MissingRequiredFrontmatterRuleTests — positive and negative cases

Infrastructure

  • Atoll.slnx — both new projects added
  • Directory.Packages.propsOmniSharp.Extensions.LanguageServer v0.19.9 added

Verification

  • dotnet build Atoll.slnx — 0 warnings, 0 errors
  • dotnet test --project tests/Atoll.Lsp.Tests/ — 36/36 pass
  • VS Code extension TypeScript compiles cleanly

…(Phase 1)

Add Atoll.Lsp LSP server providing real-time diagnostics for .mda files:
- YAML syntax error detection in frontmatter
- Unknown component validation (directive and tag syntax)
- Missing required frontmatter field reporting
- Document parsing with frontmatter, directive, tag, and heading extraction
- Project context provider for assembly-based component/schema discovery
- TextDocumentSync handler for open/change/close/save lifecycle

Add Atoll.Lsp.Vscode extension:
- TextMate grammar for .mda syntax highlighting
- Language client launching LSP server via stdio
- Language configuration for brackets, comments, auto-closing

Add Atoll.Lsp.Tests with 36 tests covering:
- LineMap offset/position mapping
- MdaDocumentParser frontmatter, directive, tag, heading extraction
- All three diagnostic rules (positive and negative cases)

Wire both projects into Atoll.slnx and add OmniSharp.Extensions.LanguageServer v0.19.9 to Directory.Packages.props.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant