sindresorhus / editorconfig-sublime

Sublime Text plugin for EditorConfig - Helps developers maintain consistent coding styles between different editors
MIT License
1.77k stars 108 forks source link

Syntax #72

Closed ghost closed 6 years ago

ghost commented 6 years ago

I am currently in the process creating a PR to add a syntax property as per https://github.com/editorconfig/editorconfig/issues/190

The idea is that a comma delimited string can be set to allow for the different language identifiers in different editors.

syntax = cpp14,cpp

The reasons for using a comma separated list are firstly, so there is a fallback if a syntax type cannot be found, and secondly for when syntax identifiers are different in different editors.

A good use case for this is C/C++ header files. When using .h for both, editors will decide the syntax based on the order of loaded plugins. If I have a plugin that associated .h files with C++14, then any C header file will have the wrong syntax set. I accept that I could use .hpp for C++ headers but not everyone is doing this, so the problem still exists. I can also set file associations in the editor settings, but this is tedious to change when switching projects.

One issue I have encountered, is that when you specify a language for [*], this will also change the .editorconfig syntax. Should I explicitly stop .editorconfig syntax from being modified or just accept that this would be expected behaviour based on the globbing pattern?

sindresorhus commented 6 years ago

It will need to be an official EditorConfig property before adding it here.

ghost commented 6 years ago

Ok, thanks for letting me know. Do you think that this will be likely to happen? And if so, would it take a long time? Is there a way of kicking the process off, or is it an internal thing?