KronicDeth / intellij-elixir

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
Other
1.83k stars 153 forks source link

Syntax highlighting plugin colors are overridden #1939

Open hassan opened 3 years ago

hassan commented 3 years ago

Describe the bug On a newly installed IntelliJ IDEA 2021.1.1 Community Edition. I've installed 3 plugins: Erlang SDK, Elixir SDK, and the Nord UI plugin. When I open an Elixir file it briefly displays using the Nord UI and then immediately switches to what I assume is the default highlight colors.

To Reproduce Steps to reproduce the behavior:

  1. Install IntelliJ IDEA 2021.1.1 Community Edition
  2. Install Erlang and Elixir SDKs using the plugin manager
  3. Install Nord UI plugin using the plugin manager as instructed at the above URL
  4. Open an Elixir file e.g. foo.ex

Expected behavior I expect to see the file contents rendered using the Nord UI color scheme.

Screenshots

Screen Shot 2021-05-02 at 11 41 10 AM

Desktop:

Erlang:

Elixir:

Plugin:

abdul-hamid-achik commented 3 years ago

same here

KronicDeth commented 3 years ago

Most of the "syntax highlighting" in the plugin is actually at the Annotation level because Elixir with all its macros doesn't have different TOKENs for variables vs calls, etc. If Nord UI is only messing with the Syntax Highlighting at the token level.

Me fixing a color scheme plugin to be compatible on top of the plugin isn't going to be a priority for me unless I personally start using it. You might get it fixed faster if you ask the Nord UI people to make it work with my plugin from the other direction. I don't know what the plug in is actually doing.

A lot of the themes just don't work with this plugin because the themes only define colors for Java token names which other languages aren't allowed to use anymore and haven't been for a few years now.

hassan commented 3 years ago

Sorry for the tardy response. I'm a little puzzled at the classification because the issue is not that the Nord theme doesn't work. It's visibly working as intended but for just an instant and then another theme replaces it. That doesn't seem to me like a Nord-fixable problem.

digitalninjae commented 1 year ago

This is a bit of an old issue, but I am having a similar issue with a different theme - and have also tried the default dark theme, the New Dark theme, and the Darcula theme - all with the same results. However, in the Color Scheme settings preview, it displays as expected/desired. The main bit that's annoying me is that predefined items (defmodule, defimpl, def) have the normal text color. (I've attached a screen shot showing the difference.)

Which (dark) themes should work for Elixir? I don't mind changing to a working theme. Thanks.

image

phyllisstein commented 1 year ago

I've been able to reproduce the issue, too, in several color schemes. Here's Monokai Pro, GitHub Dark, and Dracula Pro:

CleanShot 2023-02-24 at 05 09 42@2x CleanShot 2023-02-24 at 05 11 11@2x CleanShot 2023-02-24 at 05 14 21@2x

It looks like the overridden colors are the same in all three themes---and in other folks' comments.

phyllisstein commented 1 year ago

After taking a closer look, I think I understand what @KronicDeth means.

Most of the "syntax highlighting" in the plugin is actually at the Annotation level because Elixir with all its macros doesn't have different TOKENs for variables vs calls, etc. If Nord UI is only messing with the Syntax Highlighting at the token level.

A lot of the themes just don't work with this plugin because the themes only define colors for Java token names which other languages aren't allowed to use anymore and haven't been for a few years now.

The Elixir plugin parses a token/annotation called Alias. It's not assigned a specific style in Nord UI (or Monokai Pro, or GitHub Dark...). IDEA's perplexing behavior when it encounters a syntax element that is not styled by the active theme is to fall back on the built-in themes. That #E6DA00 yellow appears in all of our screenshots because it's pulled from "Dark":

CleanShot 2023-02-24 at 15 44 41@2x CleanShot 2023-02-24 at 15 56 20@2x

I assumed the Elixir plugin was the only thing all of our examples had in common, forgetting that we're using the same editor, too.

This is all just echoing @KronicDeth, including the recommendation that we either bother the theme maintainers or set a style from the theme's palette by hand. The quickest solution I found was to jump through odd-looking highlighting and check Inherit values from, which will pull in the style from a less granular ancestor of Elixir-specific language features.

CleanShot 2023-02-24 at 16 01 45