Skip to content

Add lsp stub services - #125

Merged
ssmifi merged 7 commits into
mainfrom
ssm/lsp-stub-services
Sep 10, 2026
Merged

ssmifi merged 7 commits into
mainfrom
ssm/lsp-stub-services

Conversation

@ssmifi

@ssmifi ssmifi commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Closes #28

Mostly ports from langium with go-idiomatic mechanisms for customization.

I refactored the original proposal. With the exceptions of Declaration, Implementation and Type Defintion, which provide meaningful defaults, all lsp stubs only provide the plain interface.
Semantic tokens is another exception, which I kept for comparison, but I guess it will be overwritten by the more sophisticated version in #136.

Added examples for Call Hierarchy, Code lens, Semantic tokens (which will be replaced), and Inlay Hints to the statemachine example to show adopters a working example.

# Feature Pattern Notes
1 Declaration Interface-only Default removed - duplicated Definition without adding value
2 Implementation Interface-only Default + ImplementationFilter removed - the "type implements" heuristic requires language-specific type-system knowledge no generic filter can provide
3 Type Definition Interface-only Default removed - its cross-reference heuristic never actually filtered by field
4 Semantic Tokens Removed from this PR entirely; deferred to #136
5 Inlay Hint Interface-only Unchanged. Open question: should it get ResolvingInlayHintProvider too?
6 Signature Help Interface-only, + separate trigger service Split into SignatureHelpProvider and SignatureHelpTriggers
7 Call Hierarchy Interface-only Fixed NodeAtCursor - now uses NameFinder. Fixed in both the godoc example and the statemachine example
8 Type Hierarchy Interface-only Same NodeAtCursor
9 Code Actions Interface-only, + optional resolve extension Added ResolvingCodeActionProvider for codeAction/resolve support
10 Code Lens Interface-only, + optional resolve extension Added ResolvingCodeLensProvider for codeLens/resolve support.
11 Document Links Interface-only Unchanged. Open question: should it get ResolvingDocumentLinkProvider too?
12 Commands Interface-only Unchanged

@ssmifi
ssmifi force-pushed the ssm/lsp-stub-services branch 2 times, most recently from 1b9c746 to 154c364 Compare July 24, 2026 09:34

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: 68da275 Previous: d803417 Ratio
BenchmarkWorkspaceCycle (typefox.dev/fastbelt/examples/statemachine) - MB/s 12.98 MB/s 5.21 MB/s 2.49

This comment was automatically generated by workflow using github-action-benchmark.

@ssmifi
ssmifi force-pushed the ssm/lsp-stub-services branch 2 times, most recently from a9cbd1c to 8be8f2b Compare July 24, 2026 10:25
@ssmifi
ssmifi force-pushed the ssm/lsp-stub-services branch from a747f34 to 68da275 Compare August 7, 2026 13:31
@ssmifi
ssmifi marked this pull request as ready for review August 7, 2026 13:32
@ssmifi
ssmifi requested a review from msujew August 7, 2026 13:32

@msujew msujew left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's very useful!

Comment thread server/declaration_provider.go Outdated
Comment thread server/implementation_provider.go Outdated
Comment thread server/inlay_hint_provider_test.go Outdated
Comment thread server/signature_help_provider.go
Comment thread server/signature_help_provider_test.go Outdated
Comment thread server/type_definition_provider.go Outdated
Comment thread server/type_hierarchy_provider.go Outdated
Comment thread server/code_lens_provider.go
Comment thread server/code_action_provider.go
Comment thread server/semantic_tokens_contributor.go Outdated
@ssmifi

ssmifi commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the review @msujew. Included all suggestions.
Still under consideration:

  • Should we also add the resolve support pattern to the InlayHintProvider and DocumentLinkProvider?
  • Whether to keep the real-but-test-only fixture providers (grammarInlayHintProvider, grammarCodeLensProvider, grammarSignatureHelpProvider, grammarTypeDefinitionProvider) as documentation, or trim them?

@ssmifi
ssmifi requested a review from msujew August 27, 2026 21:23
@msujew

msujew commented Aug 31, 2026

Copy link
Copy Markdown
Member

Should we also add the resolve support pattern to the InlayHintProvider and DocumentLinkProvider?

Good idea 👍

Whether to keep the real-but-test-only fixture providers (grammarInlayHintProvider, grammarCodeLensProvider, grammarSignatureHelpProvider, grammarTypeDefinitionProvider) as documentation, or trim them?

I think we can remove them. It doesn't feel like they actually do anything beyond asserting that the interface works as intended - which isn't doing a lot to be honest.

@ssmifi
ssmifi force-pushed the ssm/lsp-stub-services branch from 579a82f to 8d83666 Compare September 3, 2026 17:18
@ssmifi

ssmifi commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

Ok, implemented. Please have another look.

@msujew

msujew commented Sep 9, 2026

Copy link
Copy Markdown
Member

FYI this needs a rebase due to LSP 3.18 update conflicts. I'll have another look once this is done.

@ssmifi
ssmifi force-pushed the ssm/lsp-stub-services branch from 8d83666 to 45758d0 Compare September 10, 2026 11:39

@msujew msujew left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks quite nice. Just a few remarks, see below.

Comment thread server/command_provider.go
Comment thread server/server.go
Comment thread server/signature_help_triggers.go Outdated
Comment thread server/server.go Outdated

@msujew msujew left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think this is good now.

@ssmifi
ssmifi merged commit d6cf3b0 into main Sep 10, 2026
5 checks passed
@ssmifi
ssmifi deleted the ssm/lsp-stub-services branch September 10, 2026 14:09
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.

Stub services for various LSP features

2 participants