CSS files don't auto indent when 'language-source' package is disabled
opened this issue · comments
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
When Atom's core language-source
package is disabled, auto indent in .css
files no longer works.
Steps to Reproduce
- (Optional) Reset to factory defaults to start with a clean slate.
- (Optional) Start Atom in safe mode for an even cleaner slate.
- Create a new file and save it as
test.css
. - Type
.test {
in your CSS file, then press Enter on your keyboard. - Notice that the new line starts indented (thanks to the enabled-by-default
Auto indent
setting in the corelanguage-css
package). - Go to Edit > Preferences, then click Packages on the left.
- Search for
source
to locate the corelanguage-source
package. Disable it. - Go back to your CSS file (no need to restart Atom) and on a new line, repeat step 4.
Expected behavior:
The new line will start indented, as per step 5.
Actual behavior:
The new line is not indented.
Reproduces how often:
100%
Versions
Atom : 1.38.2
Electron: 2.0.18
Chrome : 61.0.3163.100
Node : 8.9.3
apm 2.1.7
npm 6.2.0
node 8.9.3 x64
atom 1.38.2
python 2.7.15+
git 2.17.1
OS: Linux Mint 19.1 Cinnamon
This is clearly a bug, but I'm not sure in what way it's a bug... Either:
- The
language-source
package is not required and should be able to be disabled without affecting other packages, or - The
language-source
package is required for other packages to work properly and should either not be disable-able, or should display a warning when disabling advising of potential issues.
language-source is the fallback for all languages, and provides some basic auto-indent rules.
Looks like language-css doesn't provide its own, so the rules in language-source get used instead.
The easy way to fix this would just be to add specialized auto-indent rules to language-css, or even as a temporary workaround copy over the ones from language-source.
OK, that makes sense. In that case, I'd suggest (in addition to your suggestions) that a warning gets added to language-source
so people disabling it will know other languages might not work properly.