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

Some editor settings are not being respected by language #19511

Closed
sandy081 opened this issue Jan 27, 2017 · 12 comments

Comments

Projects
None yet
7 participants
@sandy081
Copy link
Member

commented Jan 27, 2017

Following settings are not getting update by language

editor.tabSize
editor.insertSpaces
editor.detectIndentation
editor.trimAutoWhitespace
@sandy081

This comment has been minimized.

Copy link
Member Author

commented Jan 27, 2017

Above settings comes from the Model and are created/updated by the modelService. Fixing this need adoption in modelService to language based changes to configurations.

@sandy081 sandy081 added the candidate label Jan 27, 2017

sandy081 added a commit that referenced this issue Jan 29, 2017

sandy081 added a commit that referenced this issue Jan 30, 2017

sandy081 added a commit that referenced this issue Jan 30, 2017

sandy081 added a commit that referenced this issue Jan 30, 2017

#19511 Model Builder returns RawTextProvider instead of RawText
 - model creation options can now be specified at a later stage

sandy081 added a commit that referenced this issue Jan 30, 2017

sandy081 added a commit that referenced this issue Jan 30, 2017

#19511 Model Builder returns RawTextProvider instead of RawText
 - model creation options can now be specified at a later stage

sandy081 added a commit that referenced this issue Jan 30, 2017

sandy081 added a commit that referenced this issue Jan 30, 2017

#19511 Model Builder returns RawTextProvider instead of RawText
 - model creation options can now be specified at a later stage

sandy081 added a commit that referenced this issue Jan 30, 2017

@sandy081 sandy081 closed this Jan 30, 2017

@bpasero bpasero added the verified label Jan 31, 2017

@sandy081 sandy081 modified the milestones: February 2017, January 2017 Jan 31, 2017

@sandy081

This comment has been minimized.

Copy link
Member Author

commented Jan 31, 2017

We decided to revert this fix from 1.9 release because, Current code is not ready to provide a simple fix for this. This needs quiet amount of refactoring

  • Model service has to be adopted to language based settings
  • Model builder and its callers has to be refactored and adopted to language based settings. Core of the problem is that Model builder consumes config options to create IRawText which is an input for creating a Model. Since, config options are independent of language there were no issues. But from now, they are dependent on language. To get language we either need file URI and file first line. First line is not available until Model Builder builds IRawText. So it is a chicken-egg problem which needs proper split of IRawText to IConfigurationUnawareRawText. And, Model builder spits this new IConfigurationUnawareRawText and the Model Service can create the model from this IConfigurationUnawareRawText and the language.

This from an implementation perspective a feature by itself and is risky to implement this at the very end of 1.9. Hence we decided to revert this fix and make this available in February release.

So long story short, in 1.9 release, users cannot configure above described settings by language. This will be available in latest insiders and from next stable release.

@sandy081 sandy081 reopened this Jan 31, 2017

@sandy081 sandy081 removed the verified label Jan 31, 2017

sandy081 added a commit that referenced this issue Jan 31, 2017

sandy081 added a commit that referenced this issue Jan 31, 2017

#19511 Define and use ITextSource2
- Wraps processed information from file
- Helper methods in TextModel to create RawText

@sandy081 sandy081 removed the candidate label Jan 31, 2017

@sandy081 sandy081 closed this Jan 31, 2017

@mdalpi

This comment has been minimized.

Copy link

commented Feb 6, 2017

Maybe files.exclude should be added to the list, I'm getting "Unknown identifier. Use language identifiers" trying to set under Python settings.

@sandy081

This comment has been minimized.

Copy link
Member Author

commented Feb 6, 2017

@mdalpi Please let me know the use case behind supporting files.exclude in the list? Also please create a separate issue for that. Thanks.

@mdalpi

This comment has been minimized.

Copy link

commented Feb 6, 2017

@sandy081 I'll use just to ignore cache files (*.pyc files and __pycache__ folder specifically). Of course I can do with the global setting just fine, I just thought that this would be possible. We should wait for others to create an issue about this (maybe I'm the only trying this particular case). Thanks.

@kristianmandrup

This comment has been minimized.

Copy link

commented Mar 7, 2017

I'm currently unable to avoid auto-save indentation of 4 spaces for my .js files.
I tried everything. Disabled all linter extensions. Configuring .vscode/settings.json

{
    "vsicons.presets.angular": false,
    "editor.tabSize": 2,
    "editor.detectIndentation": false,
    "editor.formatOnSave": false
}

Added the same for my preferences/user settings file:

// Place your settings in this file to overwrite the default settings
{
    "editor.tabSize": 2,
    "editor.detectIndentation": false,
    "editor.formatOnSave": false,
    "typescript.check.tscVersion": false,
    "window.zoomLevel": 0,
    "files.trimTrailingWhitespace": true,
    "npm.validate.enable": false,
    "editor.minimap.enabled": true,
    "workbench.iconTheme": "vscode-icons",
    "[javascript]": {
        "editor.tabSize": 2
    }
}

Still it auto-indents on every save to 4 spaces! Is there any way to get around this on the current release? Or is it some extension playing tricks on me?

@sandy081

This comment has been minimized.

Copy link
Member Author

commented Mar 7, 2017

@kristianmandrup You can try disabling all extensions, with vanilla VS Code, do following

  • Have empty .vscode/settings.json
  • In user settings have following
"editor.detecetIndentation": false,
"editor.tabSize": 2

Above user settings will have tab size to 2 for all files. To do just for javascript files have following in user settings

"[javascript]": {
"editor.detecetIndentation": false,
"editor.tabSize": 2
}

Let me know if above works for you?

@kristianmandrup

This comment has been minimized.

Copy link

commented Mar 7, 2017

This is exactly what I tried (see above), except disabling all my extensions. Thanks anyways.

@sandy081

This comment has been minimized.

Copy link
Member Author

commented Mar 7, 2017

can you try disabling extensions and see if it works?

@kristianmandrup

This comment has been minimized.

Copy link

commented Mar 7, 2017

Turned out the vscode-JS-CSS-HTML-formatter extension was to blame. Solved now! Thanks

@ryenus

This comment has been minimized.

Copy link
Contributor

commented Aug 20, 2017

I just encountered the same trap, and @kristianmandrup is right.
For those installed JS-CSS-HTML Formatter extension, please check Formatter Config (via Command Palette), especially, the following (default) settings:

"javascript": {
  "indent_size": 4,
  "end_with_newline": true
  // ...
}
@Earl-Brown

This comment has been minimized.

Copy link

commented Oct 12, 2017

@sandy081 - the editor.detectIndentation trick worked for me. Thanks!

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.