lsp(feat): signature help #1797
Open
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.
Overview
This pull request introduces two enhancements to the Civet LSP: a fully-featured Signature Help Provider and a foundation for managing developer-facing debug logs in one place
High-Level Summary
textDocument/signatureHelpLSP request, providing users with real-time parameter information for function calls, method calls, constructors, and generic type parameters.Detailed Changes
1. Signature Help Provider (
lsp(feat): Signature Help Provider)handleSignatureHelpfunction: A new handler inlsp/source/features/signatureHelp.mtsprocesses signature help requests with sourcemap awareness(,,, and<as trigger characters, enabling signature help for:myFunc(|)myFunc(arg1, |)genericFunc<|>()lsp/test/tsFeatures/signature-help.civetto validate functionality across various scenarios.2. Centralized Debug Settings (
lsp(debug): Centralize debug settings)This is a key architectural improvement that sets a standard for all future development.
lsp/source/lib/debug.mts.debugSettingsobject where all feature-specific flags can be toggled in one place.signatureHelp), a developer simply edits the boolean value inlsp/source/lib/debug.mts:3. Type Safety and Code Hygiene (
lsp(chore): Improve type definitions)FeatureDeps: The type definitions inlsp/types/types.d.tshave been improved:vscode-languageservertypes have been added, removing reliance on global resolution and making the types more robust.debugSettingsobject is now part of theFeatureDepstype, ensuring all feature handlers receive it in a structured and type-safe way.server.mtsfile now imports the centralizeddebugSettingsand cleanly passes it down to feature handlers, acting as the central integration point.Known Limitations
Generic Type Parameter Signature Help
Current Behavior: Signature help for incomplete generic type parameters (e.g.,
mapValue<) is not available. Potentially because of the Civet parser limitations, but I'm not skilled enough to dive inTechnical Details:
mapValue<, the Civet parser fails to produce a valid transpiled bufferlsp/test/tsFeatures/signature-help.civetincludes a test case that verifies this behaviorWorkaround: Users can complete the generic syntax (e.g.,
mapValue<>()) to receive signature help for the function parameters. But its not really nice DXFuture Consideration: This limitation may be addressed in future Civet parser improvements that provide better error recovery for incomplete generic syntax.
Happy to hear any thoughts, thanks