-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Allow to configure settings per file type #11879
Comments
This is a similar issue to #2765 where the response was for the Go extension to explicitly set the indent settings. I have to do the same for Dart but I think it's a bit naff and would be a good feature for Code to support natively. |
Well, there's two problems with that. First, I raised that request with the Go extension author. @lukehoban , (see here), and he indicated that he didn't think it was possible — or advisable — for an extension to override core customization settings in this way. So if the vscode maintainers think that's the right answer, it would be nice if they could connect with him and make sure he knows that and knows how. More importantly, that might be a reasonable answer for Go where the language dictates the indentation style, but it's less desirable for other, more flexible languages. Suppose that I want to have my Python sources with four-space indent but by YAML sources with two-space indent. Does the author of every language extension need to provide ways to override the core settings for their language? Wouldn't it make more sense to centralize that — especially since the core already has a way to do language-specific things (e.g. snippets)? |
Like I said, I completely agree. I think both users and extension authors should be able to set it (the current mechanism is absolutely a hack)! |
This is also essential when trying to edit |
Another concrete example: I like the |
I am using Extension: https://github.com/editorconfig/editorconfig-vscode |
I'm also running into this editing Javascript (2-space tabs), HTML (4-space tabs), and README.md (word-wrap on)… Sadly, editorconfig doesn't support wrapping yet, although it looks like it does most of the other stuff I want. |
It also could be helpful with disabling IntelliSense for the plain text files, like Or disable similar matches to the selection for the same files. |
It would be very useful to set vertical rulers like this only when working with
...as this indicates row lenghts according to PEP8 which is a popular guideline among pythonistas. |
And another example: disable quickSuggestions for specific file types. |
I am using https://github.com/tzvetkoff/sublime_stupid_indent in sublime, which can force html,js ,css, scss , json in size 2, others in 4 by config, maybe vscode can take a similar way like that. PS: though it can't not recognise current file is plain javascript or es6(babel), I hope vscode can do this too. |
I find vscode have a similar extention: |
Will be implemented by #1587. |
Currently, the configuration switches that control indentation (editor.tabSize, editor.insertSpaces) can be configured globally or per-workspace. But it's not unusual to work on different types of files within the same workspace that need different indentation styles. For example, Go source files always use tabSize=8, insertSpaces=false (it's a language standard), but the same workspaces very often contain other types of files (e.g. Markdown, HTML, JavaScript, etc.) where those are not the desired settings. It is irritating to have to set the indentation style manually whenever creating a new file. Instead, the indentation settings should be language-specific, rather like snippets.
The text was updated successfully, but these errors were encountered: