feat(lsp): add context-aware completion ranking and document highlights
Adds context-aware completion ranking and document highlights for Tcl. Adds completion_context to distinguish variables and commands. Wires per-file completion snapshots and ranking into the flow. Adds document_highlight provider support and tests for highlights. - Context-aware ranking of completion items using per-file snapshots - Document highlight provider wired into initialization and tests - Tests for completion context, ranking, and document highlights
This commit is contained in:
@@ -170,6 +170,15 @@ class TclLanguageServer(LanguageServer):
|
||||
self._workspace_completion_cache = (self._index_generation, items)
|
||||
return items
|
||||
|
||||
def completion_items_by_file_snapshot(
|
||||
self,
|
||||
) -> dict[str, tuple[lsp.CompletionItem, ...]]:
|
||||
"""Return completion items grouped by source file for request ranking."""
|
||||
with self._index_lock:
|
||||
return {
|
||||
path: tuple(items) for path, items in self.poco_completion.items()
|
||||
}
|
||||
|
||||
def custom_function_names_snapshot(self) -> frozenset[str]:
|
||||
"""Return custom completion labels for semantic highlighting."""
|
||||
with self._index_lock:
|
||||
|
||||
Reference in New Issue
Block a user