-
Notifications
You must be signed in to change notification settings - Fork 1
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
Server and Clients configuration #237
Comments
After this comment I admit this is actually way trickier that I thought, lots of edge cases. ralph.json file
I re-started my thinking base on this and thought that maybe we should just not write I went back to the protocol and saw that there are an initializationOptions field in the initialize request and also a DidChangeConfiguration Notification. We can see that editors are supporting those: The next question is: Do servers actually use that for configuration? I went through some common languages and they all seem to use it, so either with the initializationOptions or the didChangeConfiguration That could be a good match for Other configs, like This would remove the use of a Root dirNow the other point is how to find the root dir.... This is actually interesting and I realize I was very biased In nvim-lsp client, every project I checked they provide a default list of file in order to find the root_dir on which to start the lsp server. This is quite natural for me as an nvim user, I can easily go on sub directories in a project to open just the file I know, but I still want my lsp server to work at project level. But then I couldn't find anythink like that in vscode. After a while I found this documentation of the go lsp server
So this is actually a different approach. Maybe vscode could start lsp-server with different settings whether there the ConclusionLot's of edge cases, due to different editors, different users. those are just my thoughts, let's open a discussion on all this. |
There are few little thing we could do in our plugins to improve UX, the main thing is how to find the root dir to start the server.
Currently nvim is trying to find one of:
'build.ralph', 'contracts', 'artifacts'
vscode is starting the server from the directory we launched the editor.
There's an issue with that: If you launch vscode from
contracts
folder, it will create there a.ralph-lsp/ralph.json
and that later will compains thatcontracts
andartifacts
don't exist.For vscode we need the same approach as nvim, to look in current and parent folders where is the "real" root dir.
The heuristic we could take in every plugin is to search in that order:
'alephium.config.ts', 'contracts', '.ralph-lsp'
If none of them is found, we use the current dir as root dir.
I also had a discussion with SDK team that
artifacts
is something that should be used only by the sdk, so we could remove it from ourralph.json
, if we need to create some artifacts later for ralph-lsp, we could store them in.ralph-lsp
I already tested something in the improve-plugin-start branch, I hope to open a PR soon
The text was updated successfully, but these errors were encountered: