file-icons / atom

Atom file-specific icons for improved visual grepping.
MIT License
1.31k stars 251 forks source link

JS icon becomes JSX upon opening the file, even for files that do not contain JSX markup #710

Closed sompylasar closed 6 years ago

sompylasar commented 6 years ago

I'm using language-babel to transpile JavaScript, and I understand that Babel technically supports JSX in every file, but I expect only files that actually have JSX syntax to be shown as JSX, and preferably before actually opening the file.

I also anticipate it'd be hard to implement given how file icons are currently assigned based on filename and scope which for Babel is source.js.jsx.

js-jsx (the files in the GIF all contain JSX markup, but this happens for all the JS files similarly)


atom --version

Atom    : 1.24.0
Electron: 1.6.16
Chrome  : 56.0.2924.87
Node    : 7.4.0
apm --version

apm  1.18.12
npm  3.10.10
node 6.9.5 x64
atom 1.24.0
python 2.7.10
git 2.9.3
apm ls ``` apm ls Built-in Atom Packages (92) ├── atom-dark-syntax@0.29.0 ├── atom-dark-ui@0.53.1 ├── atom-light-syntax@0.29.0 ├── atom-light-ui@0.46.1 ├── base16-tomorrow-dark-theme@1.5.0 ├── base16-tomorrow-light-theme@1.5.0 ├── one-dark-ui@1.10.9 ├── one-light-ui@1.10.9 ├── one-dark-syntax@1.8.1 ├── one-light-syntax@1.8.1 ├── solarized-dark-syntax@1.1.3 ├── solarized-light-syntax@1.1.3 ├── about@1.7.8 ├── archive-view@0.64.1 ├── autocomplete-atom-api@0.10.6 ├── autocomplete-css@0.17.5 ├── autocomplete-html@0.8.4 ├── autocomplete-plus@2.40.0 ├── autocomplete-snippets@1.11.2 (disabled) ├── autoflow@0.29.0 ├── autosave@0.24.6 ├── background-tips@0.27.1 ├── bookmarks@0.45.0 ├── bracket-matcher@0.88.1 ├── command-palette@0.43.3 ├── dalek@0.2.1 ├── deprecation-cop@0.56.9 (disabled) ├── dev-live-reload@0.48.1 ├── encoding-selector@0.23.7 ├── exception-reporting@0.42.0 ├── find-and-replace@0.215.0 ├── fuzzy-finder@1.7.3 ├── github@0.8.3 ├── git-diff@1.3.6 ├── go-to-line@0.32.1 ├── grammar-selector@0.49.8 ├── image-view@0.62.4 ├── incompatible-packages@0.27.3 ├── keybinding-resolver@0.38.1 ├── line-ending-selector@0.7.4 ├── link@0.31.4 ├── markdown-preview@0.159.20 ├── metrics@1.2.6 ├── notifications@0.70.2 ├── open-on-github@1.3.1 ├── package-generator@1.3.0 ├── settings-view@0.253.1-0 ├── snippets@1.1.9 ├── spell-check@0.72.5 ├── status-bar@1.8.15 ├── styleguide@0.49.9 ├── symbols-view@0.118.1 ├── tabs@0.109.1 ├── timecop@0.36.2 ├── tree-view@0.221.3 ├── update-package-dependencies@0.13.0 ├── welcome@0.36.6 ├── whitespace@0.37.5 ├── wrap-guide@0.40.3 ├── language-c@0.58.1 ├── language-clojure@0.22.5 ├── language-coffee-script@0.49.3 ├── language-csharp@0.14.3 ├── language-css@0.42.8 ├── language-gfm@0.90.3 ├── language-git@0.19.1 ├── language-go@0.44.4 ├── language-html@0.48.5 ├── language-hyperlink@0.16.3 ├── language-java@0.27.6 ├── language-javascript@0.127.7 ├── language-json@0.19.1 ├── language-less@0.34.1 ├── language-make@0.22.3 ├── language-mustache@0.14.4 ├── language-objective-c@0.15.1 ├── language-perl@0.38.1 ├── language-php@0.43.0 ├── language-property-list@0.9.1 ├── language-python@0.45.6 ├── language-ruby@0.71.4 ├── language-ruby-on-rails@0.25.3 ├── language-sass@0.61.3 ├── language-shellscript@0.25.4 ├── language-source@0.9.0 ├── language-sql@0.25.9 ├── language-text@0.7.3 ├── language-todo@0.29.3 ├── language-toml@0.18.1 ├── language-typescript@0.2.3 ├── language-xml@0.35.2 └── language-yaml@0.31.1 Community Packages (76) /Users/ivanbabak/.atom/packages ├── advanced-open-file@0.16.7 ├── atom-clang@1.0.14 (disabled) ├── atom-cursor-indent@0.3.0 ├── atom-ide-ui@0.8.1 ├── atom-typescript@12.1.2 ├── autocomplete-flow@1.6.0 (disabled) ├── busy-signal@1.4.3 ├── copy-filename@1.1.0 ├── custom-title@1.0.1 ├── docblockr@0.13.6 ├── file-icons@2.1.16 ├── flow-ide@1.10.0 (disabled) ├── git-time-machine@1.5.9 ├── grammar-token-limit@0.1.1 ├── highlight-selected@0.13.1 ├── hyperclick@0.1.5 ├── ide-csharp@0.6.2 (disabled) ├── ide-typescript@0.7.3 (disabled) ├── intentions@1.1.5 ├── ionide-fake@1.2.2 (disabled) ├── ionide-fsharp@1.9.3 (disabled) ├── ionide-fsi@2.1.3 (disabled) ├── ionide-installer@1.4.0 (disabled) ├── ionide-paket@2.2.6 (disabled) ├── ionide-webview@1.0.3 (disabled) ├── js-hyperclick@1.13.0 ├── language-babel@2.84.0 ├── language-cpp14@0.6.2 ├── language-cshtml@0.3.0 ├── language-fsharp@0.8.4 ├── language-glsl@2.0.4 (disabled) ├── language-nginx@0.8.0 ├── language-pgsql@0.2.3 ├── language-svg@0.9.2 ├── language-todo-extra-words@0.2.0 ├── language-typescript-grammars-only@1.6.0 (disabled) ├── lcov-info@0.12.0 (disabled) ├── linter@2.2.0 ├── linter-coffeelint@1.3.1 ├── linter-eslint@8.4.1 ├── linter-flow@5.6.1 (disabled) ├── linter-jsonlint@1.3.0 ├── linter-sass-lint@1.8.3 ├── linter-tslint@1.9.0 ├── linter-ui-default@1.6.10 ├── minimap@4.29.7 ├── minimap-codeglance@0.4.7 (disabled) ├── minimap-cursorline@0.2.0 (disabled) ├── minimap-find-and-replace@4.5.2 ├── minimap-git-diff@4.3.1 ├── minimap-highlight-selected@4.6.1 ├── minimap-linter@2.1.3 ├── multi-cursor-plus@1.2.0 ├── multirow-tabs@0.3.3 ├── omnisharp-atom@0.31.2 (disabled) ├── open-in-browser@0.5.2 ├── open-terminal-here@2.3.1 ├── package-cop@0.2.10 ├── path-copy@0.14.0 ├── path-hyperclick@0.3.0 (disabled) ├── pigments@0.40.2 ├── pinned-tabs@2.0.5 ├── platformio-ide-terminal@2.8.0 (disabled) ├── prettier-atom@0.51.0 ├── pretty-json@1.6.4 ├── print-code@0.7.1 ├── revert-buffer@0.6.0 ├── sort-lines@0.18.0 ├── split-diff@1.5.2 ├── svg-preview@0.12.1 (disabled) ├── svgo@3.0.0 ├── sync-settings@0.8.3 ├── tab-control@0.6.10 ├── teletype@0.8.0 (disabled) ├── todo-show@2.1.0 └── vertical-tabs@1.0.7 (disabled) ```
Alhadis commented 6 years ago

See https://github.com/file-icons/atom/issues/704#issuecomment-365807854. TL;DR: It was caused by a regression in Atom v1.24.0's code, which was fixed upstream after I reported it. The regression will vanish once the next patch release of Atom is out.

In the meantime, you can simply disable the grammar-strategy (uncheck the "Change on grammar override" option in the file-icons package settings).

I'm starting to think I should disable the strategy automatically for all v1.24.0 users (and for this version only). You're the fifth person to report this in a matter of days, and I can't imagine how many more users are currently confused as hell over this.

sompylasar commented 6 years ago

@Alhadis Thanks, I should've searched in closed issues, too.