-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse std lib instead of using manual definition files #73
Comments
Do you mean parsing on server startup instead of having the definitions already incorporated? |
Something like that yes. Not sure what capabilities an LSP can have, but you could potentially even cache these in some way. I think Rust Analyser might just do it on startup, so that's probably not too bad of a solution. |
It could be done yes. It will not re-parse them, but it will give you "Go To" capabilities. |
Ah, I thought I seen a stdlib path somewhere but wasn't sure. Could this |
the stdlib path value could be specified by the extension yes. There is no change required in the LSP for that, if the extension implements it you could use it today. The idea of the c3lps.json is so you can use different configurations for different projects. |
Using the extension doesn't seem to give me goto def for std, with the path specified in there instead. I will change the description of the issue, since part of this already exists, it's just the parsing. |
Is your feature request related to a problem? Please describe.
From a browse of the source, it would seem that std lib code is done using some definition files which works to get the signature, but this makes maintenance very hard in the long run.
Describe the solution you'd like
Parse std lib so it can collect the required information. This should also make it a little easier to manage, as it doesn't require some manual intervention of creating these files. These def files sound liked they will also be painful to manage as the library grows and changes over time.
If you have the stdlib path (and it is valid), you can then recursively parse these files to collect all the info you need to get features to work.
If the project has specified that it does not use the stdlib, then it can skip parsing.
It should probably error if no lib is found at the path or is empty, but expects a stdlib to be used in the project.
Describe alternatives you've considered
As a workaround, you would need to have the stdlib open in another editor to see the source or create a
c3lsp.json
with the stdlib path for goto.Edit: Changed description based on information provided about LSP config
The text was updated successfully, but these errors were encountered: