Skip to content
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

Expand variables on initializationOptions #709

Closed
wants to merge 4 commits into from
Closed

Expand variables on initializationOptions #709

wants to merge 4 commits into from

Conversation

jfcherng
Copy link
Contributor

@jfcherng jfcherng commented Sep 1, 2019

This PR adds the ability to use some variables in initializationOptions.

This PR comes from the following use case. In the settings of intelephense server, there are some path-related settings in the initializationOptions. The licenceKey can be a path of a file containing a license key. I would like to keep it cross-platform and portable so I want it to be in ST's directory (or at least, in user's home directory ~).

"intelephense": {
    // ...
    "initializationOptions": {
        "clearCache": false,
        "storagePath": "${temp_dir}/intelephense",
        "globalStoragePath": "${temp_dir}/intelephense",
        "licenceKey": "${packages}/User/intelephense-license.txt",
    },
},

Related/similar to #1042

rwols
rwols previously approved these changes Sep 2, 2019
Copy link
Member

@rwols rwols left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I welcome this change and I'm looking forward to doing this in more places, especially the "command" key. I hope you can find the time to address my nitpicks.

plugin/core/clients.py Outdated Show resolved Hide resolved
plugin/core/clients.py Outdated Show resolved Hide resolved
rwols
rwols previously approved these changes Sep 2, 2019
@jfcherng
Copy link
Contributor Author

jfcherng commented Sep 2, 2019

I welcome this change and I'm looking forward to doing this in more places, especially the "command" key.

@rwols Done via 184b58f. It seems that "command" (config.binary_args) is already expanded though.

@tomv564
Copy link
Contributor

tomv564 commented Sep 2, 2019

If we do this, someone will suggest we infinitely recurse though the settings member as well?

Looking at the reason for the request, it looks like the specific language server is the major need, combined with your additional desire to have your config portable.

Appreciate offering to do the work yourself, but I want to discuss the value of this complexity to end users vs. maintenance burden.
Implementing it in a LanguageHandler might be a better outcome for all of us?

@predragnikolic
Copy link
Member

hello @jfcherng, if you don't mind I added your code to LSP-intelephese :)

sublimelsp/LSP-intelephense@2f8d525

@jfcherng
Copy link
Contributor Author

@predragnikolic sure. feel free to use it.

@tomv564 tomv564 closed this Oct 6, 2019
@jfcherng jfcherng mentioned this pull request Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants