Closed karnpapon closed 2 months ago
sorry for a large chunk of code, but mainly a large chunk was grabbed from official SC class with some modifications (notated by prefix/suffix eg. ForLSP
or lsp
eg prLinkTargetForInternalLinkForLSP
, lspBaseDir
so it can be clearly seen).
This is a great addition, thanks for working on this. I see some things I would like to adjust to get this merged, but overall I think the approach is good and it's a fantastic feature. There are also other places in the language server where we have the opportunity to return documentation strings but we are not currently capable of doing do, due to limitations of the built-in renderer - I think overriding / modifying the renderer to support what we need here would help us in other places as well.
I'll try to give this a more thorough review in the next week or two - please forgive any delays, it might take a bit of time!
I believe I already have code to also resolve class method syntax like Class.method
elsewhere - connecting this would allow us to render docs for UGen methods as well, which would be huge. Maybe as a follow up PR?
Happy to help! 🎉 been dreaming 'bout SuperCollider's LSP for a long time.
I believe I already have code to also resolve class method syntax like
Class.method
elsewhere - connecting this would allow us to render docs for UGen methods as well, which would be huge. Maybe as a follow up PR?
aha, I saw it!, a LSPDatabase.methodsForClass
, right? that'd be nice to render a doc for method as well!
anyway, while this is prolly working just fine. For a long-term, maybe we need to find a way to generate AST
so we can properly show the docs, I guess. AFAIK, there's a few existing projects like sparkler or tree-sitter-supercollider which already implemented. what do you think?
AFAIK, there's a few existing projects like sparkler or tree-sitter-supercollider which already implemented. what do you think?
This is definitely the next major step - there are actually some frustrating bugs in the current LSP / VSCode plugin that can probably ONLY be fixed with proper access to the AST. I've made a little progress at serializing the SuperCollider AST from Sparkler - and then yes, this is definitely the next step.
closing as the development is planned to move to separated quark SCDocMarkdownRenderer
hi,
I add
HoverProvider
module, with basic functionality. currently support only (documented)Class
(retrieved bySCDoc.documents
) where the document msg comes from list belowSystem Documents (
SCDoc.helpSourceDir
)Classes/*.schelp
Guides/*.schelp
Overviews/*.schelp
Reference/*.schelp
User Extension Documents (
SCDoc.prRescanHelpSourceDirs
)LanguageConfig.includeDefaultPaths
Platform.userExtensionDir
Platform.systemExtensionDir
the hover msg consists of parsed
SCDocNode
screenshot
https://github.com/scztt/LanguageServer.quark/assets/22865807/810b2eeb-1d4a-4f49-8fa7-fee2dfddf4ed
related issue