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

Retrieving per-language settings with the extensions API #20190

Closed
stkb opened this issue Feb 8, 2017 · 3 comments
Closed

Retrieving per-language settings with the extensions API #20190

stkb opened this issue Feb 8, 2017 · 3 comments
Assignees
Labels
api config VS Code configuration, set up issues feature-request Request for new features or functionality
Milestone

Comments

@stkb
Copy link
Contributor

stkb commented Feb 8, 2017

VSCode version 1.9

Is there an official way to do this yet? For example given this settings.json and I want the editor.rulers setting for javascript:

{
  "editor.rulers": [80],
  "[javascript]": {
    "editor.rulers": [100]
  }
}

Using workspace.getConfiguration('[javascript]') ... doesn't seem to work.

I've found that workspace.getConfiguration().get('[javascript]') will give me an object for the whole section, which I can work with, but I don't know if there's a better way.

@Tyriar Tyriar added api config VS Code configuration, set up issues labels Feb 10, 2017
@sandy081
Copy link
Member

@stkb There is no api exposed to read configuration given a language because only core editor configurations are supported and I did not see the requirement for exposing it. But would definitely think if there is an appropriate one. But as you said you can work on complete configuration object which has access to the information you need. Under the hood we also do the same. If there are more users doing the same in extensions we can move it as an API.

@sandy081 sandy081 reopened this Feb 10, 2017
@sandy081 sandy081 added this to the Backlog milestone Feb 10, 2017
@stkb
Copy link
Contributor Author

stkb commented Feb 10, 2017

@sandy081 Thanks. My use case was stkb/Rewrap#25 where the extension uses the rulers setting.
As long as a there's a method to retrieve the settings that works that's fine, and nicely this method works for the extension's own settings too. (I understand that's not really supported yet and am following #19642)

@sandy081
Copy link
Member

As mentioned in my previous comment, all settings data is available through the API. Extension authors can always compute the required settings from it.

This feature request will not be considered in the next 6-12 months roadmap and as such will be closed to keep the number of issues we have to maintain actionable. Thanks for understanding and happy coding!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api config VS Code configuration, set up issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants