-
Notifications
You must be signed in to change notification settings - Fork 32
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
Tentative implementation of initializationOptions
at RLS startup.
#183
Tentative implementation of initializationOptions
at RLS startup.
#183
Conversation
Added signed-off-by and Contributor lines MVP for initializationOptions Added rlsConfiguration basic Signed-off-by: Nicola Orru <[email protected]>
@mickaelistria I'd be happy to have My suggestion is to go with .conf/.json first because of Gson being already integrated, and then apply another patch to implement other formats (.toml will definitely help for multiple IDE users). |
Thanks @norru , that looks good! I suggest we wait for RLS to be ready for testing this before we merge. It would also be great if we could have Corrosion providing a best default |
Hi @mickaelistria - Having good defaults would be great, not being able to change them not so much. If we could to stick to the RLS "defaults are best" we wouldn't have the problem in first place because RLS would provide those out of the box. Even if they did, I am pretty sure that their "best defaults" wouldn't always match my "best defaults". Said that, if you have an idea of the "best defaults", we could build-in a "default fallback" as a jar resource which would kick off when the external file is not found (or even a small hardcoded Hashmap). Also +1 for waiting until RLS ships with this feature so we can tweak. Not sure how to implement the "Edit" function - is it just "open the file in the editor" (Can you do that from the Preferences dialog?) or you're thinking about a custom view (similar to the "Environment variables" one)? However, if there is "a way" to edit the configuration, that'll be good enough a baseline for what I am concerned. |
Yes, we should do something like that. Please add your "best defaults" in a form or another (JSON file as a Java resource in the plugin, or a HashMap, whatever), you'll be our reference here at the moment.
Let's not both about the edit at the moment. We can have a look at it later when we have more concrete use-case showing how it's necessary. |
Latest RLS (2018-12-01) breaks LSP4E:
|
Thanks @mickaelistria for fixing the bug above - I have now latest RLS running against this patch and it does appear that it's parsing the custom configuration correctly |
Signed-off-by: Nicola Orru <[email protected]>
I have added a simple default initialization option which allows clippy and Racer navigation. Defaults are loaded if the custom file doesn't exist or is malformed. |
@mickaelistria Once you get this I suggest you bump the version number up to 0.4.0 (interface change) |
0.3.0 was not released yet (it's a snapshot) and Corrosion doesn't publish any of its code as API, so we can stick to 0.3.0. |
This patch looks perfect to me, thanks a lot @norru for this great first code contribution! |
Tentative implementation of
initializationOptions
at RLS startup.(squash + signoff of #182)
initialize
RLS method as the payload of theinitializationOptions
field:Here how the above looks in the LSP4E log:
Caveats
initializationOptions.settings
in RLS doesn't appear to be documented @nrc @mickaelistria however the example above should be valid syntax (according to @alexheretic).Signed-off-by: Nicola Orru [email protected]