-
Notifications
You must be signed in to change notification settings - Fork 42
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
[Enhancement] Add Option to Override Indentation #48
base: master
Are you sure you want to change the base?
[Enhancement] Add Option to Override Indentation #48
Conversation
Hey @kevinmatthe, thanks for the PR. Some thoughts -- while #29 added mode-specific configuration for indentation, it remained unused. Rather than having a global option as you add in this PR, should we not rely on the mode-specific configuration? I created a PR #49 and tried to add you as a reviewer (but couldn't?), I resolved to mentioning you. Let me know what you think |
I agree with you that applying the settings from the configured is a sane design decision for having some initial configurations. This Pull Request was intended to provide an override functionality therefore since in some projects, people indent with tabs instead of spaces in all languages they use. It is easier to just edit one setting instead of twenty-five, for instance, to meet the indentation convention. To provide a minimal-invasive session override therefore, I suggested an according option in #41 which performed this action without editing the configuration file at all. The downside was that it worked only in one direction in order to prevent a precedence between the override settings in case multiple ones should be passed. |
One possible solution might be to invert the meaning of the suggested override option to For maximum language sensitivity, this option should be disabled / without any effect, however, for certain languages, such as Haskell whose compiler GHC refuses the compilation when reading tab characters in a source file. |
I would like to suggest to wait for #49 being merged before continuing working on this feature. |
Continuing the discussion on indentation unit overrides from #49, I would like to add that the possibility to detect the currently used indentation unit would resolve the necessity of those overriding mechanisms. VS Code-like IDEs have exactly this detection. You can set up your preferred indentation unit in the settings, also per language, but if the editor finds a file which is indented with the opposite indentation unit, for instance, tabs instead of spaces, it will continue to use the found indentation unit in order to do not violate against the obvious coding conventions of this source file. When working in teams, this is quite useful in order to prevent non-uniformly indented source files. This is why I tried to add such a feature, as well. I thought it would be easier to begin with a configuration variable and some additional command line options, if required. What do you think, would this functionality add a useful feature to |
I created a discussion thread therefore: #54. |
These changes allow defining a global override of the indentation setup as required when required. If these settings are not needed, just set the configuration variable |
Again, as originally suggested in #41, here is the implementation make the tab versus spaces setting an option for the configuration file.