I have made a custom language extension and I would like to enable the "Go To Symbol" feature. I have tried to follow the guidelines here, but I'm still kind of lost.
I think all I need to do is implement a DocumentSymbolProvider
, but I'm not really sure how to go about it.
UPDATE
The example language server docs point to a repo that is deprecated. It is replaced with this one, which is much more complex. I think the simplest example I can find there is the lsp-sample, but it doesn't use a DocumentSymbolProvider
.
I've found other repos that do use symbol providers, but they are a bit overwhelming. I can't figure out what needs to go where (for example, do I need both a client and a server? Some packages only seem to use an extension.ts
without both client and server folders).
All I really want to do in my language is detect lines that start with @
and show them in the Go to Symbol pane. I'd love to see a simple tutorial of this.