You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I considered whether a generic exported Call(...) API would be better, but I think dedicated request helpers are a smaller and safer public API surface:
they match the existing client style
they avoid exposing lower-level transport details
they make common LSP operations easy to use downstream
Compatibility
This would be a purely additive change:
no breaking API changes
no behavior changes for existing callers
only new helper methods + capability advertisement
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I’d like to propose a small LSP client API addition in
powernap/pkg/lsp.Motivation
powernapalready exposes a few high-level LSP request helpers such as:RequestHoverFindReferencesRequestCompletionBut it does not currently expose helpers for:
textDocument/definitiontextDocument/implementationThis makes downstream clients fall back to either:
powernap, orIn practice,
definitionandimplementationare high-value semantic navigation primitives, especially for coding-agent / editor-like use cases.Current state
From what I can see, most of the protocol groundwork already exists:
MethodTextDocumentDefinitionis already definedDefinitionParamsImplementationParamsOr_Result_textDocument_definitionOr_Result_textDocument_implementationdefinitionimplementationcapability types also exist in the generated protocol packageSo the missing piece seems to be mainly the exported request helpers in the high-level LSP client.
Proposed API
Add two methods to
pkg/lsp.Client:These would mirror the existing style of
RequestHover, and keep the full protocol result shape instead of forcing a lossy normalization inpowernap.Capability update
I’d also propose advertising implementation client capability during initialize, similar to definition:
Why this shape
I considered whether a generic exported
Call(...)API would be better, but I think dedicated request helpers are a smaller and safer public API surface:Compatibility
This would be a purely additive change:
Beta Was this translation helpful? Give feedback.
All reactions