feat(lsp): implement self-hosted LSP module (Phase 5)#132
Merged
Conversation
Implements Phase 5 of the self-hosting roadmap: LSP server in Gradient. **New File: compiler/lsp.gr** Core Types: - LspServer: LSP server instance with document store - TextDocumentItem, VersionedTextDocumentIdentifier: document management - LspPosition, LspRange: positions and ranges in documents - LspDiagnostic: diagnostic messages with severity - Hover: hover information content - CompletionItem, CompletionItemKind: completion support - ServerCapabilities, ServerInfo: server metadata - InitializeParams, InitializeResult: initialization protocol - DocumentSymbol, LspSymbolKind: document symbols Enums: - LspDiagnosticSeverity: Error/Warning/Info/Hint - CompletionItemKind: Text/Method/Function/Constructor/etc. - LspSymbolKind: renamed to avoid conflict with query.gr's SymbolKind Core Functions: - new_lsp_server: create LSP server instance - initialize: LSP initialization handshake - did_open/did_change/did_close/did_save: document lifecycle - hover: hover information at position - completion: completion items at position - document_symbol: extract document symbols - goto_definition: go-to-definition navigation - run_diagnostics: compile and collect diagnostics - new_document_store, store_document, get_document: document management - word_at_position: extract identifier at position - get_builtin_functions, get_keywords: built-in knowledge - is_builtin, is_keyword: identifier classification **Self-Hosting Tests (All 12 Passing):** - all_modules_plus_lsp_concatenated_parses_and_typechecks_clean ✅ - lsp_gr_concatenated_exposes_expected_symbols ✅ Part of #116 (Self-Hosting Epic) Closes #124 (Phase 5: LSP)
graydeon
added a commit
that referenced
this pull request
Apr 11, 2026
Implements Phase 5 of the self-hosting roadmap: LSP server in Gradient. **New File: compiler/lsp.gr** Core Types: - LspServer: LSP server instance with document store - TextDocumentItem, VersionedTextDocumentIdentifier: document management - LspPosition, LspRange: positions and ranges in documents - LspDiagnostic: diagnostic messages with severity - Hover: hover information content - CompletionItem, CompletionItemKind: completion support - ServerCapabilities, ServerInfo: server metadata - InitializeParams, InitializeResult: initialization protocol - DocumentSymbol, LspSymbolKind: document symbols Enums: - LspDiagnosticSeverity: Error/Warning/Info/Hint - CompletionItemKind: Text/Method/Function/Constructor/etc. - LspSymbolKind: renamed to avoid conflict with query.gr's SymbolKind Core Functions: - new_lsp_server: create LSP server instance - initialize: LSP initialization handshake - did_open/did_change/did_close/did_save: document lifecycle - hover: hover information at position - completion: completion items at position - document_symbol: extract document symbols - goto_definition: go-to-definition navigation - run_diagnostics: compile and collect diagnostics - new_document_store, store_document, get_document: document management - word_at_position: extract identifier at position - get_builtin_functions, get_keywords: built-in knowledge - is_builtin, is_keyword: identifier classification **Self-Hosting Tests (All 12 Passing):** - all_modules_plus_lsp_concatenated_parses_and_typechecks_clean ✅ - lsp_gr_concatenated_exposes_expected_symbols ✅ Part of #116 (Self-Hosting Epic) Closes #124 (Phase 5: LSP)
graydeon
added a commit
that referenced
this pull request
Apr 11, 2026
Implements Phase 5 of the self-hosting roadmap: LSP server in Gradient. **New File: compiler/lsp.gr** Core Types: - LspServer: LSP server instance with document store - TextDocumentItem, VersionedTextDocumentIdentifier: document management - LspPosition, LspRange: positions and ranges in documents - LspDiagnostic: diagnostic messages with severity - Hover: hover information content - CompletionItem, CompletionItemKind: completion support - ServerCapabilities, ServerInfo: server metadata - InitializeParams, InitializeResult: initialization protocol - DocumentSymbol, LspSymbolKind: document symbols Enums: - LspDiagnosticSeverity: Error/Warning/Info/Hint - CompletionItemKind: Text/Method/Function/Constructor/etc. - LspSymbolKind: renamed to avoid conflict with query.gr's SymbolKind Core Functions: - new_lsp_server: create LSP server instance - initialize: LSP initialization handshake - did_open/did_change/did_close/did_save: document lifecycle - hover: hover information at position - completion: completion items at position - document_symbol: extract document symbols - goto_definition: go-to-definition navigation - run_diagnostics: compile and collect diagnostics - new_document_store, store_document, get_document: document management - word_at_position: extract identifier at position - get_builtin_functions, get_keywords: built-in knowledge - is_builtin, is_keyword: identifier classification **Self-Hosting Tests (All 12 Passing):** - all_modules_plus_lsp_concatenated_parses_and_typechecks_clean ✅ - lsp_gr_concatenated_exposes_expected_symbols ✅ Part of #116 (Self-Hosting Epic) Closes #124 (Phase 5: LSP)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Phase 5 of the self-hosting roadmap: LSP server in Gradient.
New File: compiler/lsp.gr
Core Types
Enums
Core Functions
Naming Changes
Self-Hosting Tests (All 12 Passing)
Related Issues