Skip to content
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

Random editor scheme highlight breakage #120

Closed
arcticicestudio opened this issue Feb 12, 2020 · 8 comments · Fixed by #121
Closed

Random editor scheme highlight breakage #120

arcticicestudio opened this issue Feb 12, 2020 · 8 comments · Fixed by #121

Comments

@arcticicestudio
Copy link
Contributor

arcticicestudio commented Feb 12, 2020

This is a meta-issue to collect and aggregate all information regarding the problems related to “randomly breaking syntax highlighting“. There is an continuously increasing amount of issues related this bug were the root cause is still a mystery.

Related to #69, #70, #77, #78, #108, #109, #115, #117, #119

The following timeline shows the problem based on reported issues in this repository.

2019-07-31 — First breakages of Go & JavaScript syntax since IDE versions 2019.2.x

The first cases are documented in #69 & #77 where the syntax highlighting of some Go & JavaScript elements were wrong after updating to IntelliJ version 2019.2.0, the update that introduced support for 20+ languages out-of-the-box by integrating TextMate schemes.

It resulted in a change for some Go & JavaScript editor color scheme keys that previously inherited the best matching global keys, but used the attributes defined by the parent theme Darcula after the update instead. Therefore Nord's highlighting for Go & JavaScript broke and required to explicitly define the values for the some attributes (merged in #70 & #78) in order to achieve the same highlight like in previous versions:

A comparison of the changes between Nord plugin version 0.6.0 and 0.7.0 shows that there were absolutely no changes to the editor color scheme related to the highlighting of Go & JavaScript code. To this time the guess was that the root cause was the integration of TextMate themes and the “fixes“ have been released in version 0.8.0.

2019-12-02 — Second breakage of Go syntax since IDE versions 2019.3.x

The second case is documented in #108 where the syntax highlighting of some Go elements were wrong again after updating to IntelliJ version 2019.3.0. A comparison of the changes between Nord plugin version 0.8.0 and the time the issue was created (2019-12-02)comp-time-v0.8.0-2019-12-02 shows again that there were no changes to the editor color scheme related to the highlighting of Go code.

An interesting observation was that the wrong highlighting could be fixed by disabling and enabling the Nord plugin again without restarting the IDE (deny/postpone to later when the question dialog shows up).

Again, the “fixes“ were then released in a the new plugin version 0.9.0.

2020-01-28 — Another breakage of JavaScript & TypeScript syntax in IDE versions 2019.3.x

On 2020-01-28 a new issue has been created that describes the breakage of the syntax highlighting for JavaScript as well as TypeScript (which inherits values from the JavaScript editor scheme keys) in #115. This is really strange since the affected elements were fixed in #78 to mitigate the first breakage!
To fix the problem again, the color definitions were then defined explicitly in #116 instead of relying on the non-working inheritance of other theme keys.

The comparison of the changes between Nord plugin version 0.9.0 and the time the issue was created (2020-01-28) again showing that there were no changes to the highlighting of JavaScript or TypeScript syntax elements in the editor color scheme.

It was also possible again to temporarily work around the problem by re-enabling or even re-installing the plugin. This definitely shows that the root cause must be somewhere in the way the IDE loads themes and how editor color scheme keys are inherited from other keys.

Again, the “fixes“ were then released in a the new plugin version version 0.10.0 on 2020-02-11.

2020-02-11 — Now PHP and general markup languages are also broken…

The latest case occurred only several hours after Nord plugin version 0.10.0 was deployed and made public through the JetBrains Plugin Marketplace. This time the highlighting of strings and comments in PHP, Markdown font styles (bold & italic) as well as other elements of markup languages are broken.

Again, a comparison of the changes between Nord plugin version 0.9.0 and 0.10.0 shows that there no changes to the highlighting for editor color scheme keys for PHP, Markdown or any markup languages or “Language Default“ styles.

During the testing of Nord plugin version 0.10.0, that was released to fix the problems of the broken JavaScript & TypeScript highlighting, there were no problems regarding markup styles and all elements were working fine in Markdown files. Right after deploying the plugin to the JetBrains Plugin Marketplace, the highlighting suddenly broke “out of nowhere“ after updating the plugin for my IntelliJ.

Conclusion

These random breakages “drive me nuts“ and it's frustrating as a theme author to no being able to track down the root cause. Since the problem occurs randomly, but can also be temporarily mitigated through one or more plugin re-activation or re-installations, the problem origin must be a bug in the IDE itself.

Next Steps

  1. Implement workaround for other possible breakages — To prevent more styles from breaking, I'll replace all editor color scheme keys that inherit values from other keys with the explicit style definitions instead. This causes the code of the editor scheme to increase drastically due to duplicate and repeated styles, but it currently the only way to work around this non-working style inheritance in the IDE theme API.
  2. Submit a bug report to the JetBrains IntelliJ bug tracker — In order to get rid of this annoying bug, I'll submit a detailed bug report to the JetBrains bug tracker for the IntelliJ IDE including the details of this issue.

Feedback Always Welcome!

If you're also affected by this problem, I'll really appreciate every feedback so this can be used to find the root cause and fix this bug permanently 🚀

@Tom1206
Copy link

Tom1206 commented Feb 13, 2020

I have also encountered a few scheme bugs since the 0.10 update.
The first one is with all colors (hex, name, variables, ...) on CSS (and SCSS, ...) files. They have a brownish color, as shown in the screenshot :

Annotation 2020-02-13 094441

I can't fix it with the color scheme settings unfortunately (nor with any restart, or reinstall of the plugin) :

Annotation 2020-02-13 094522

I reinstalled 0.9 to try, and the problem doesn't exist there...
I fear that the "unused" attribute parent_scheme wasn't so unused after all, because there is a few other things broken (I will report). It seemed to fix fine a few badly inherited colors, but introduced random brownish elements here and there.

@Tom1206
Copy link

Tom1206 commented Feb 13, 2020

The active tab is now the wrong color, somehow...

image

Easily fixed in the settings :

image

image

image

@Tom1206
Copy link

Tom1206 commented Feb 13, 2020

The Diff & Merge folded code is the wrong color on 0.10:

image

Easily fixed by adding a color to the background:

image

@yuru7
Copy link

yuru7 commented Feb 13, 2020

I have the same appearance.

The following capture is "pom.xml" of Maven.
Some are normal, some are broken (brown text color).

After reinstalling Nord v0.9, the problem was fixed.

image

@Tom1206
Copy link

Tom1206 commented Feb 13, 2020

There is a problem with function parameters when there is a suggestion in Typescript.

Edit : It seems to append only on Webstorm on my Mac, not on Windows.

Screenshot 2020-02-13 at 22 43 21

Screenshot 2020-02-13 at 22 35 56

svengreb pushed a commit that referenced this issue Feb 14, 2020
This commit implements a change for the meta-issue GH-120 that collects
and aggregates all information regarding the problems related to
"randomly breaking syntax highlighting".
There is an continuously increasing amount of issues related this bug
were the root cause is still a mystery.

The following timeline shows the problem based on reported issues in
this repository.

>>> 2019-07-31 - First breakages of Go & JavaScript syntax since IDE
                 versions 2019.2.x

The first cases are documented in GH-69 & GH-77 where the syntax
highlighting of some Go & JavaScript elements were wrong after updating
to IntelliJ version 2019.2.0, the update that introduced support for 20+
languages [1] out-of-the-box by integrating TextMate [2] schemes.

It resulted in a change for some Go & JavaScript editor color scheme
keys that previously inherited the best matching global keys, but used
the attributes defined by the parent theme "Darcula" after the update
instead. Therefore Nord's highlighting for Go & JavaScript broke and
required to explicitly define the values for the some attributes
(merged in GH-70 & GH-78) in order to achieve the same highlight like in
previous versions:

A comparison of the changes between Nord plugin version 0.6.0 and 0.7.0
[3] shows that there were absolutely no changes to the editor color
scheme related to the highlighting of Go & JavaScript code.
To this time the guess was that the root cause was the integration of
"TextMate" themes and the "fixes" have been released in version 0.8.0
[4].

>>> 2019-12-02 - Second breakage of Go syntax since IDE versions
                 2019.3.x

The second case is documented in GH-108 where the syntax highlighting of
some Go elements were wrong again after updating to IntelliJ version
2019.3.0. A comparison of the changes between Nord plugin version 0.8.0
and the time the issue was created (2019-12-02) [5] shows again that
there were no changes to the editor color scheme related to the
highlighting of Go code.

An interesting observation was that the wrong highlighting could be
fixed by disabling and enabling the Nord plugin again without restarting
the IDE (deny/postpone to later when the question dialog shows up).

Again, the "fixes" were then released in a the new plugin version
version 0.9.0 [6].

>>> 2020-01-28 - Another breakage of JavaScript & TypeScript syntax in
                 IDE versions 2019.3.x

On 2020-01-28 a new issue has been created that describes the breakage
of the syntax highlighting for JavaScript as well as TypeScript (which
inherits values from the JavaScript editor scheme keys) in GH-115.
This is really strange since the affected elements were fixed in GH-78
[7] to mitigate the first breakage!
To fix the problem again, the color definitions were then defined
explicitly in GH-116 [8] instead of relying on the non-working
inheritance of other theme keys.

The comparison of the changes between Nord plugin version 0.9.0 and the
time the issue was created (2020-01-28) [9] again showing that there
were no changes to the highlighting of JavaScript or TypeScript syntax
elements in the editor color scheme.

It was also possible again to temporarily work around the problem by
re-enabling or even re-installing the plugin. This definitely shows that
the root cause must be somewhere in the way the IDE loads themes and how
editor color scheme keys are inherited from other keys.

Again, the "fixes" were then released in a the new plugin
version 0.10.0 [10] on 2020-02-11.

>>> 2020-02-11 - Now PHP and general "markup" languages are also
                 broken...

The latest case occurred only several hours after [Nord plugin version
0.10.0 [10] was deployed and made public through the "JetBrains Plugin
Marketplace". This time the highlighting of strings and comments in PHP,
Markdown font styles (bold & italic) as well as other elements of
"markup" languages are broken.

Again, a comparison of the changes between Nord plugin version 0.9.0 and
0.10.0 [11] shows that there no changes to the highlighting for editor
color scheme keys for PHP, Markdown or any "markup" languages or
"Language Default" styles.

During the testing of Nord plugin version 0.10.0, that was released to
fix the problems of the broken JavaScript & TypeScript highlighting,
there were no problems regarding "markup" styles and all elements were
working fine in Markdown files.
Right after deploying the plugin to the "JetBrains Plugin Marketplace",
the highlighting suddenly broke "out of nowhere" after updating the
plugin for my IntelliJ.

>> Conclusion

These random breakages "drive me nuts" and it's frustrating as a theme
author to no being able to track down the root cause. Since the problem
occurs randomly, but can also be temporarily mitigated through one or
more plugin re-activation or re-installations, the problem origin must
be a bug in the IDE itself.

>> Mitigation Steps

This commit implements a workaround to prevent more styles from
breaking. It replaces all editor color scheme keys that inherit values
from other keys with the explicit style definitions instead.
This causes the code of the editor scheme to increase drastically due to
duplicate and repeated styles, but it currently the only way to work
around this non-working style inheritance in the IDE theme API.

[1]: https://www.jetbrains.com/idea/whatsnew/#v2019-2-editor
[2]: https://macromates.com
[3]: https://github.com/arcticicestudio/nord-jetbrains/compare/master@%7B2019-05-23%7D...master@%7B2019-07-16%7D
[4]: https://github.com/arcticicestudio/nord-jetbrains/releases/tag/v0.8.0
[5]: https://github.com/arcticicestudio/nord-jetbrains/compare/v0.8.0...develop@%7B2019-12-02%7D
[6]: https://github.com/arcticicestudio/nord-jetbrains/releases/tag/v0.9.0
[7]: https://github.com/arcticicestudio/nord-jetbrains/pull/78/files#diff-1146aace8d65c51b72c60139418ad4d0R1016-R1018
[8]: https://github.com/arcticicestudio/nord-jetbrains/pull/116/files#diff-1146aace8d65c51b72c60139418ad4d0R1118-R1133
[9]: https://github.com/arcticicestudio/nord-jetbrains/compare/v0.9.0...develop@%7B2020-01-28%7D
[10]: https://github.com/arcticicestudio/nord-jetbrains/releases/tag/v0.10.0
[11]: v0.9.0...v0.10.0

Related to GH-69, GH-70, GH-77, GH-78, GH-108, GH-109, GH-115, GH-117,
           GH-119
GH-120
@arcticicestudio
Copy link
Contributor Author

arcticicestudio commented Feb 14, 2020

Thanks @Tom1206 and @yuru7 for your feedback 💪

As a first mitigation step towards the "random" color breakage, I've implemented and submitted the change to replace all inherited colors with their explicit definitions in #121. The only small quirk of the change is the increased amount of definitions, but I've checked other builtin and community themes and most of them don't make use of inherited colors (no baseAttributes set). A advantage of this change is that there's now "less magic": Instead of relying on the default color inheritance, every theme key for a syntax is now within the color scheme file making it way easier to find and modify them.

There's also another factor that might be reason for the wrong colors both of you found: The latest IDE versions 2019.3.3 have been released at the same day like the Nord plugin version 0.10.0 🙃
I've quickly checked the changes and it looks like they've also introduced some changes to editor color schemes as well as new keys that affect the UI, e.g. there are new TAB_* editor scheme keys which might explain the behavior @Tom1206 found.

Next steps: fix the problems both of you found and going through the color scheme keys again to add support for new or changed keys. I'll try to forge a new plugin version 0.11.0 over the weekend.

arcticicestudio added a commit that referenced this issue Feb 15, 2020
This commit implements a change for the meta-issue GH-120 that collects
and aggregates all information regarding the problems related to
"randomly breaking syntax highlighting".
There is an continuously increasing amount of issues related this bug
were the root cause is still a mystery.

The following timeline shows the problem based on reported issues in
this repository.

>>> 2019-07-31 - First breakages of Go & JavaScript syntax since IDE
                 versions 2019.2.x

The first cases are documented in GH-69 & GH-77 where the syntax
highlighting of some Go & JavaScript elements were wrong after updating
to IntelliJ version 2019.2.0, the update that introduced support for 20+
languages [1] out-of-the-box by integrating TextMate [2] schemes.

It resulted in a change for some Go & JavaScript editor color scheme
keys that previously inherited the best matching global keys, but used
the attributes defined by the parent theme "Darcula" after the update
instead. Therefore Nord's highlighting for Go & JavaScript broke and
required to explicitly define the values for the some attributes
(merged in GH-70 & GH-78) in order to achieve the same highlight like in
previous versions:

A comparison of the changes between Nord plugin version 0.6.0 and 0.7.0
[3] shows that there were absolutely no changes to the editor color
scheme related to the highlighting of Go & JavaScript code.
To this time the guess was that the root cause was the integration of
"TextMate" themes and the "fixes" have been released in version 0.8.0
[4].

>>> 2019-12-02 - Second breakage of Go syntax since IDE versions
                 2019.3.x

The second case is documented in GH-108 where the syntax highlighting of
some Go elements were wrong again after updating to IntelliJ version
2019.3.0. A comparison of the changes between Nord plugin version 0.8.0
and the time the issue was created (2019-12-02) [5] shows again that
there were no changes to the editor color scheme related to the
highlighting of Go code.

An interesting observation was that the wrong highlighting could be
fixed by disabling and enabling the Nord plugin again without restarting
the IDE (deny/postpone to later when the question dialog shows up).

Again, the "fixes" were then released in a the new plugin version
version 0.9.0 [6].

>>> 2020-01-28 - Another breakage of JavaScript & TypeScript syntax in
                 IDE versions 2019.3.x

On 2020-01-28 a new issue has been created that describes the breakage
of the syntax highlighting for JavaScript as well as TypeScript (which
inherits values from the JavaScript editor scheme keys) in GH-115.
This is really strange since the affected elements were fixed in GH-78
[7] to mitigate the first breakage!
To fix the problem again, the color definitions were then defined
explicitly in GH-116 [8] instead of relying on the non-working
inheritance of other theme keys.

The comparison of the changes between Nord plugin version 0.9.0 and the
time the issue was created (2020-01-28) [9] again showing that there
were no changes to the highlighting of JavaScript or TypeScript syntax
elements in the editor color scheme.

It was also possible again to temporarily work around the problem by
re-enabling or even re-installing the plugin. This definitely shows that
the root cause must be somewhere in the way the IDE loads themes and how
editor color scheme keys are inherited from other keys.

Again, the "fixes" were then released in a the new plugin
version 0.10.0 [10] on 2020-02-11.

>>> 2020-02-11 - Now PHP and general "markup" languages are also
                 broken...

The latest case occurred only several hours after [Nord plugin version
0.10.0 [10] was deployed and made public through the "JetBrains Plugin
Marketplace". This time the highlighting of strings and comments in PHP,
Markdown font styles (bold & italic) as well as other elements of
"markup" languages are broken.

Again, a comparison of the changes between Nord plugin version 0.9.0 and
0.10.0 [11] shows that there no changes to the highlighting for editor
color scheme keys for PHP, Markdown or any "markup" languages or
"Language Default" styles.

During the testing of Nord plugin version 0.10.0, that was released to
fix the problems of the broken JavaScript & TypeScript highlighting,
there were no problems regarding "markup" styles and all elements were
working fine in Markdown files.
Right after deploying the plugin to the "JetBrains Plugin Marketplace",
the highlighting suddenly broke "out of nowhere" after updating the
plugin for my IntelliJ.

>> Conclusion

These random breakages "drive me nuts" and it's frustrating as a theme
author to no being able to track down the root cause. Since the problem
occurs randomly, but can also be temporarily mitigated through one or
more plugin re-activation or re-installations, the problem origin must
be a bug in the IDE itself.

>> Mitigation Steps

This commit implements a workaround to prevent more styles from
breaking. It replaces all editor color scheme keys that inherit values
from other keys with the explicit style definitions instead.
This causes the code of the editor scheme to increase drastically due to
duplicate and repeated styles, but it currently the only way to work
around this non-working style inheritance in the IDE theme API.

[1]: https://www.jetbrains.com/idea/whatsnew/#v2019-2-editor
[2]: https://macromates.com
[3]: https://github.com/arcticicestudio/nord-jetbrains/compare/master@%7B2019-05-23%7D...master@%7B2019-07-16%7D
[4]: https://github.com/arcticicestudio/nord-jetbrains/releases/tag/v0.8.0
[5]: https://github.com/arcticicestudio/nord-jetbrains/compare/v0.8.0...develop@%7B2019-12-02%7D
[6]: https://github.com/arcticicestudio/nord-jetbrains/releases/tag/v0.9.0
[7]: https://github.com/arcticicestudio/nord-jetbrains/pull/78/files#diff-1146aace8d65c51b72c60139418ad4d0R1016-R1018
[8]: https://github.com/arcticicestudio/nord-jetbrains/pull/116/files#diff-1146aace8d65c51b72c60139418ad4d0R1118-R1133
[9]: https://github.com/arcticicestudio/nord-jetbrains/compare/v0.9.0...develop@%7B2020-01-28%7D
[10]: https://github.com/arcticicestudio/nord-jetbrains/releases/tag/v0.10.0
[11]: v0.9.0...v0.10.0

Related to GH-69, GH-70, GH-77, GH-78, GH-108, GH-109, GH-115, GH-117,
           GH-119
GH-120
@Tom1206
Copy link

Tom1206 commented Feb 15, 2020

There is a few other brownish colours here and there:

Screenshot 2020-02-15 at 12 04 44

edit : this is probably #127
Screenshot 2020-02-15 at 12 04 35

Screenshot 2020-02-15 at 12 04 22

This one is quite common in C#
Screenshot 2020-02-15 at 12 03 22

Screenshot 2020-02-15 at 12 03 45

I just wanna say, thank you @arcticicestudio for all your work these last few days, it's amazing to see how much you care about the quality of Nord, and how much you communicate about it.

arcticicestudio added a commit that referenced this issue Feb 15, 2020
Selected and inactive tabs were previously styled using the
corresponding `ui.EditorTabs.*` UI themey keys. Some of these keys are
now deprecated or marked as "unknown" to the UI theme scheme validator.
The highlighting is now controlled using the new `TAB_SELECTED` and
`TAB_SELECTED_INACTIVE` editor color scheme keys added to the IDE
platform code in JetBrains/intellij-community@bf26eb8.

In my opinion there are some keys that should not be placed in the
editor scheme (including these both) and it feels like there is
inconsistency between the UI theme API and editor color scheme API.
Anyway, in order to style tabs correctly again, both new editor scheme
keys have been added using the same colors like the UI theme keys.

Reported by "Tom1206" (https://github.com/Tom1206) in #120 (comment)
Related to GH-120
GH-126
arcticicestudio added a commit that referenced this issue Feb 15, 2020
In JetBrains/intellij-community@6fb72d0,
the new `RUNTIME_ERROR` editor scheme key was added to the IDE platform
code to highlight runtime errors.

The new key has been added using `nord11` as foreground color.

Related to GH-120
GH-127
arcticicestudio added a commit that referenced this issue Feb 15, 2020
The "diff" UI [1] renders a line to separate the different sections of a
patch/diff that was added to the IDE platform code in
JetBrains/intellij-community@f8de2a5.
In order to style the elements the `DIFF_SEPARATORS_BACKGROUND` editor
scheme key has been added to use `nord3` as background color.

[1]: https://www.jetbrains.com/help/idea/comparing-files-and-folders.html
[2]: https://github.com/Tom1206

Reported with proposed solution by @Tom1206 [2] in
#120 (comment)
Related to GH-120
GH-128
@arcticicestudio arcticicestudio added this to the 0.11.0 milestone Feb 15, 2020
arcticicestudio added a commit that referenced this issue Feb 15, 2020
In GH-117, the `parent_scheme` attribute has been removed since it was
suspected that it caused "random highlighting breakages" that are
documented in detail in GH-120.

Anyway, contrary to the presumption that the attribute is not required,
it caused syntax elements of many different languages to ignore some
colors defined by the Nord plugin, like e.g. "markup" elements in
(documentation) comments, strings in PHP (GH-119), data flow control
characters like braces in TypeScript/JavaScript and even UI elements
like tabs. See feedback comments of @Tom1206 [1] and @yuru7 [2] in
GH-120 for more examples.

The color `#808080` was used for all these elements instead which is
"hardcoded" in different places in the IDE core platform code [3].
It was not possible to fix these elements using the available editor
scheme keys.

By simply adding back the attribute with the value `Darcula` all these
elements will "magically" use the colors defined by Nord again instead
of `#808080`. It is a strange behavior that this attribute is required
for almost no reason, but it has been added back again to fix the
massive style problems occurred as of Nord plugin version 0.10.0 [4] in
combination with the latest IDE versions 2019.3.3 [5] (that was release
the same day like the plugin update...)

[1]: https://github.com/Tom1206
[2]: https://github.com/yuru7
[3]: https://github.com/JetBrains/intellij-community/search?q=808080&unscoped_q=808080
[4]: https://github.com/arcticicestudio/nord-jetbrains/releases/tag/v0.10.0
[5]: https://blog.jetbrains.com/idea/2020/02/intellij-idea-2019-3-3-is-out

GH-129, GH-119
arcticicestudio added a commit that referenced this issue Feb 15, 2020
Selected and inactive tabs were previously styled using the
corresponding `ui.EditorTabs.*` UI themey keys. Some of these keys are
now deprecated or marked as "unknown" to the UI theme scheme validator.
The highlighting is now controlled using the new `TAB_SELECTED` and
`TAB_SELECTED_INACTIVE` editor color scheme keys added to the IDE
platform code in JetBrains/intellij-community@bf26eb8.

In my opinion there are some keys that should not be placed in the
editor scheme (including these both) and it feels like there is
inconsistency between the UI theme API and editor color scheme API.
Anyway, in order to style tabs correctly again, both new editor scheme
keys have been added using the same colors like the UI theme keys.

Reported by "Tom1206" (https://github.com/Tom1206) in #120 (comment)
Related to GH-120
Closes GH-126
arcticicestudio added a commit that referenced this issue Feb 15, 2020
The "diff" UI [1] renders a line to separate the different sections of a
patch/diff that was added to the IDE platform code in
JetBrains/intellij-community@f8de2a5.
In order to style the elements the `DIFF_SEPARATORS_BACKGROUND` editor
scheme key has been added to use `nord3` as background color.

[1]: https://www.jetbrains.com/help/idea/comparing-files-and-folders.html
[2]: https://github.com/Tom1206

Reported with proposed solution by @Tom1206 [2] in
#120 (comment)
Related to GH-120
Closes GH-128
arcticicestudio added a commit that referenced this issue Feb 15, 2020
In JetBrains/intellij-community@6fb72d0,
the new `RUNTIME_ERROR` editor scheme key was added to the IDE platform
code to highlight runtime errors.

The new key has been added using `nord11` as foreground color.

Related to GH-120
Closes GH-127
arcticicestudio added a commit that referenced this issue Feb 15, 2020
In GH-117, the `parent_scheme` attribute has been removed since it was
suspected that it caused "random highlighting breakages" that are
documented in detail in GH-120.

Anyway, contrary to the presumption that the attribute is not required,
it caused syntax elements of many different languages to ignore some
colors defined by the Nord plugin, like e.g. "markup" elements in
(documentation) comments, strings in PHP (GH-119), data flow control
characters like braces in TypeScript/JavaScript and even UI elements
like tabs. See feedback comments of @Tom1206 [1] and @yuru7 [2] in
GH-120 for more examples.

The color `#808080` was used for all these elements instead which is
"hardcoded" in different places in the IDE core platform code [3].
It was not possible to fix these elements using the available editor
scheme keys.

By simply adding back the attribute with the value `Darcula` all these
elements will "magically" use the colors defined by Nord again instead
of `#808080`. It is a strange behavior that this attribute is required
for almost no reason, but it has been added back again to fix the
massive style problems occurred as of Nord plugin version 0.10.0 [4] in
combination with the latest IDE versions 2019.3.3 [5] (that was release
the same day like the plugin update...)

[1]: https://github.com/Tom1206
[2]: https://github.com/yuru7
[3]: https://github.com/JetBrains/intellij-community/search?q=808080&unscoped_q=808080
[4]: https://github.com/arcticicestudio/nord-jetbrains/releases/tag/v0.10.0
[5]: https://blog.jetbrains.com/idea/2020/02/intellij-idea-2019-3-3-is-out

Fixes GH-129, GH-119
@arcticicestudio
Copy link
Contributor Author

Thanks for all the feedback 💙
The actual fix for all these broken colors was indeed the removed parent_scheme attribute. This is so strange that it is required to add this, otherwise many of the defined colors of a theme are simply ignored. I've written down some more details in #129 and reverted the change in #137.
I'll release and deploy plugin version 0.11.0 to the marketplace this evening which also includes some other new features.


Closed by #129, #137

@arcticicestudio arcticicestudio unpinned this issue Feb 15, 2020
arcticicestudio added a commit that referenced this issue Feb 15, 2020
This commit implements a change for the meta-issue GH-120 that collects
and aggregates all information regarding the problems related to
"randomly breaking syntax highlighting".
There is an continuously increasing amount of issues related this bug
were the root cause is still a mystery.

The following timeline shows the problem based on reported issues in
this repository.

>>> 2019-07-31 - First breakages of Go & JavaScript syntax since IDE
                 versions 2019.2.x

The first cases are documented in GH-69 & GH-77 where the syntax
highlighting of some Go & JavaScript elements were wrong after updating
to IntelliJ version 2019.2.0, the update that introduced support for 20+
languages [1] out-of-the-box by integrating TextMate [2] schemes.

It resulted in a change for some Go & JavaScript editor color scheme
keys that previously inherited the best matching global keys, but used
the attributes defined by the parent theme "Darcula" after the update
instead. Therefore Nord's highlighting for Go & JavaScript broke and
required to explicitly define the values for the some attributes
(merged in GH-70 & GH-78) in order to achieve the same highlight like in
previous versions:

A comparison of the changes between Nord plugin version 0.6.0 and 0.7.0
[3] shows that there were absolutely no changes to the editor color
scheme related to the highlighting of Go & JavaScript code.
To this time the guess was that the root cause was the integration of
"TextMate" themes and the "fixes" have been released in version 0.8.0
[4].

>>> 2019-12-02 - Second breakage of Go syntax since IDE versions
                 2019.3.x

The second case is documented in GH-108 where the syntax highlighting of
some Go elements were wrong again after updating to IntelliJ version
2019.3.0. A comparison of the changes between Nord plugin version 0.8.0
and the time the issue was created (2019-12-02) [5] shows again that
there were no changes to the editor color scheme related to the
highlighting of Go code.

An interesting observation was that the wrong highlighting could be
fixed by disabling and enabling the Nord plugin again without restarting
the IDE (deny/postpone to later when the question dialog shows up).

Again, the "fixes" were then released in a the new plugin version
version 0.9.0 [6].

>>> 2020-01-28 - Another breakage of JavaScript & TypeScript syntax in
                 IDE versions 2019.3.x

On 2020-01-28 a new issue has been created that describes the breakage
of the syntax highlighting for JavaScript as well as TypeScript (which
inherits values from the JavaScript editor scheme keys) in GH-115.
This is really strange since the affected elements were fixed in GH-78
[7] to mitigate the first breakage!
To fix the problem again, the color definitions were then defined
explicitly in GH-116 [8] instead of relying on the non-working
inheritance of other theme keys.

The comparison of the changes between Nord plugin version 0.9.0 and the
time the issue was created (2020-01-28) [9] again showing that there
were no changes to the highlighting of JavaScript or TypeScript syntax
elements in the editor color scheme.

It was also possible again to temporarily work around the problem by
re-enabling or even re-installing the plugin. This definitely shows that
the root cause must be somewhere in the way the IDE loads themes and how
editor color scheme keys are inherited from other keys.

Again, the "fixes" were then released in a the new plugin
version 0.10.0 [10] on 2020-02-11.

>>> 2020-02-11 - Now PHP and general "markup" languages are also
                 broken...

The latest case occurred only several hours after [Nord plugin version
0.10.0 [10] was deployed and made public through the "JetBrains Plugin
Marketplace". This time the highlighting of strings and comments in PHP,
Markdown font styles (bold & italic) as well as other elements of
"markup" languages are broken.

Again, a comparison of the changes between Nord plugin version 0.9.0 and
0.10.0 [11] shows that there no changes to the highlighting for editor
color scheme keys for PHP, Markdown or any "markup" languages or
"Language Default" styles.

During the testing of Nord plugin version 0.10.0, that was released to
fix the problems of the broken JavaScript & TypeScript highlighting,
there were no problems regarding "markup" styles and all elements were
working fine in Markdown files.
Right after deploying the plugin to the "JetBrains Plugin Marketplace",
the highlighting suddenly broke "out of nowhere" after updating the
plugin for my IntelliJ.

>> Conclusion

These random breakages "drive me nuts" and it's frustrating as a theme
author to no being able to track down the root cause. Since the problem
occurs randomly, but can also be temporarily mitigated through one or
more plugin re-activation or re-installations, the problem origin must
be a bug in the IDE itself.

>> Mitigation Steps

This commit implements a workaround to prevent more styles from
breaking. It replaces all editor color scheme keys that inherit values
from other keys with the explicit style definitions instead.
This causes the code of the editor scheme to increase drastically due to
duplicate and repeated styles, but it currently the only way to work
around this non-working style inheritance in the IDE theme API.

[1]: https://www.jetbrains.com/idea/whatsnew/#v2019-2-editor
[2]: https://macromates.com
[3]: https://github.com/arcticicestudio/nord-jetbrains/compare/master@%7B2019-05-23%7D...master@%7B2019-07-16%7D
[4]: https://github.com/arcticicestudio/nord-jetbrains/releases/tag/v0.8.0
[5]: https://github.com/arcticicestudio/nord-jetbrains/compare/v0.8.0...develop@%7B2019-12-02%7D
[6]: https://github.com/arcticicestudio/nord-jetbrains/releases/tag/v0.9.0
[7]: https://github.com/arcticicestudio/nord-jetbrains/pull/78/files#diff-1146aace8d65c51b72c60139418ad4d0R1016-R1018
[8]: https://github.com/arcticicestudio/nord-jetbrains/pull/116/files#diff-1146aace8d65c51b72c60139418ad4d0R1118-R1133
[9]: https://github.com/arcticicestudio/nord-jetbrains/compare/v0.9.0...develop@%7B2020-01-28%7D
[10]: https://github.com/arcticicestudio/nord-jetbrains/releases/tag/v0.10.0
[11]: v0.9.0...v0.10.0

Related to GH-69, GH-70, GH-77, GH-78, GH-108, GH-109, GH-115, GH-117,
           GH-119
GH-120
arcticicestudio added a commit that referenced this issue Feb 15, 2020
Selected and inactive tabs were previously styled using the
corresponding `ui.EditorTabs.*` UI themey keys. Some of these keys are
now deprecated or marked as "unknown" to the UI theme scheme validator.
The highlighting is now controlled using the new `TAB_SELECTED` and
`TAB_SELECTED_INACTIVE` editor color scheme keys added to the IDE
platform code in JetBrains/intellij-community@bf26eb8.

In my opinion there are some keys that should not be placed in the
editor scheme (including these both) and it feels like there is
inconsistency between the UI theme API and editor color scheme API.
Anyway, in order to style tabs correctly again, both new editor scheme
keys have been added using the same colors like the UI theme keys.

Reported by "Tom1206" (https://github.com/Tom1206) in #120 (comment)
Related to GH-120
Closes GH-126
arcticicestudio added a commit that referenced this issue Feb 15, 2020
The "diff" UI [1] renders a line to separate the different sections of a
patch/diff that was added to the IDE platform code in
JetBrains/intellij-community@f8de2a5.
In order to style the elements the `DIFF_SEPARATORS_BACKGROUND` editor
scheme key has been added to use `nord3` as background color.

[1]: https://www.jetbrains.com/help/idea/comparing-files-and-folders.html
[2]: https://github.com/Tom1206

Reported with proposed solution by @Tom1206 [2] in
#120 (comment)
Related to GH-120
Closes GH-128
arcticicestudio added a commit that referenced this issue Feb 15, 2020
In JetBrains/intellij-community@6fb72d0,
the new `RUNTIME_ERROR` editor scheme key was added to the IDE platform
code to highlight runtime errors.

The new key has been added using `nord11` as foreground color.

Related to GH-120
Closes GH-127
arcticicestudio added a commit that referenced this issue Feb 15, 2020
In GH-117, the `parent_scheme` attribute has been removed since it was
suspected that it caused "random highlighting breakages" that are
documented in detail in GH-120.

Anyway, contrary to the presumption that the attribute is not required,
it caused syntax elements of many different languages to ignore some
colors defined by the Nord plugin, like e.g. "markup" elements in
(documentation) comments, strings in PHP (GH-119), data flow control
characters like braces in TypeScript/JavaScript and even UI elements
like tabs. See feedback comments of @Tom1206 [1] and @yuru7 [2] in
GH-120 for more examples.

The color `#808080` was used for all these elements instead which is
"hardcoded" in different places in the IDE core platform code [3].
It was not possible to fix these elements using the available editor
scheme keys.

By simply adding back the attribute with the value `Darcula` all these
elements will "magically" use the colors defined by Nord again instead
of `#808080`. It is a strange behavior that this attribute is required
for almost no reason, but it has been added back again to fix the
massive style problems occurred as of Nord plugin version 0.10.0 [4] in
combination with the latest IDE versions 2019.3.3 [5] (that was release
the same day like the plugin update...)

[1]: https://github.com/Tom1206
[2]: https://github.com/yuru7
[3]: https://github.com/JetBrains/intellij-community/search?q=808080&unscoped_q=808080
[4]: https://github.com/arcticicestudio/nord-jetbrains/releases/tag/v0.10.0
[5]: https://blog.jetbrains.com/idea/2020/02/intellij-idea-2019-3-3-is-out

Fixes GH-129, GH-119
@arcticicestudio arcticicestudio pinned this issue Apr 27, 2020
arcticicestudio added a commit that referenced this issue Apr 27, 2020
PhpStorm [1] ships with support for specific languages, frameworks and
libraries for PHP development and of course advanced highlighting for
PHP. Due to the same problems documented in GH-120 (and mitigated in
GH-121) some syntax theme keys required to be replaced with explicit
definitions instead of reyling on color inheritances.

Therefore this commit adds explicit support for PhpStorm's bundled
language syntax:

1. Main support for "PHP" [2][3]
2. Laravel "Blade" Temapltes [4][5][6]
3. "Twig" template engine [7][8][9]
4. "Smarty" templates [10][11]

[1]: https://www.jetbrains.com/phpstorm
[2]: https://www.php.net
[3]: https://plugins.jetbrains.com/plugin/6610-php
[4]: https://laravel.com/docs/7.x/blade
[5]: https://www.jetbrains.com/help/phpstorm/blade-page.html
[6]: https://plugins.jetbrains.com/plugin/7569-blade
[7]: https://twig.symfony.com
[8]: https://www.jetbrains.com/help/phpstorm/symfony-twig.html
[9]: https://plugins.jetbrains.com/plugin/7303-twig
[10]: https://www.smarty.net
[11]: https://www.jetbrains.com/help/phpstorm/smarty.html

Related to GH-120,GH-121
GH-151

Co-authored-by: Sven Greb <[email protected]>
arcticicestudio added a commit that referenced this issue Apr 28, 2020
Add explicit support for bundled PhpStorm language syntax

PhpStorm [1] ships with support for specific languages, frameworks and
libraries for PHP development and of course advanced highlighting for
PHP. Due to the same problems documented in GH-120 (and mitigated in
GH-121) some syntax theme keys required to be replaced with explicit
definitions instead of relying on color inheritances.

Therefore this commit adds explicit support for PhpStorm's bundled
language syntax:

1. Main support for "PHP" [2] and the official JetBrains plugin [3]
2. Laravel "Blade" Templates [4]
   See JetBrains official "Blade" documentation [5] and the plugin [6]
   for more details.
3. "Twig" template engine [7]
   See JetBrains official "Twig" documentation [8] and the plugin [9]
   for more details.
4. "Smarty" templates [10]
   See JetBrains official "Smarty" documentation [11] for more details.

[1]: https://www.jetbrains.com/phpstorm
[2]: https://www.php.net
[3]: https://plugins.jetbrains.com/plugin/6610-php
[4]: https://laravel.com/docs/7.x/blade
[5]: https://www.jetbrains.com/help/phpstorm/blade-page.html
[6]: https://plugins.jetbrains.com/plugin/7569-blade
[7]: https://twig.symfony.com
[8]: https://www.jetbrains.com/help/phpstorm/symfony-twig.html
[9]: https://plugins.jetbrains.com/plugin/7303-twig
[10]: https://www.smarty.net
[11]: https://www.jetbrains.com/help/phpstorm/smarty.html

Related to GH-120, GH-121
Closes GH-151

Co-authored-by: Sven Greb <[email protected]>
arcticicestudio added a commit that referenced this issue Sep 22, 2020
Add explicit support for bundled PhpStorm language syntax

PhpStorm [1] ships with support for specific languages, frameworks and
libraries for PHP development and of course advanced highlighting for
PHP. Due to the same problems documented in GH-120 (and mitigated in
GH-121) some syntax theme keys required to be replaced with explicit
definitions instead of relying on color inheritances.

Therefore this commit adds explicit support for PhpStorm's bundled
language syntax:

1. Main support for "PHP" [2] and the official JetBrains plugin [3]
2. Laravel "Blade" Templates [4]
   See JetBrains official "Blade" documentation [5] and the plugin [6]
   for more details.
3. "Twig" template engine [7]
   See JetBrains official "Twig" documentation [8] and the plugin [9]
   for more details.
4. "Smarty" templates [10]
   See JetBrains official "Smarty" documentation [11] for more details.

[1]: https://www.jetbrains.com/phpstorm
[2]: https://www.php.net
[3]: https://plugins.jetbrains.com/plugin/6610-php
[4]: https://laravel.com/docs/7.x/blade
[5]: https://www.jetbrains.com/help/phpstorm/blade-page.html
[6]: https://plugins.jetbrains.com/plugin/7569-blade
[7]: https://twig.symfony.com
[8]: https://www.jetbrains.com/help/phpstorm/symfony-twig.html
[9]: https://plugins.jetbrains.com/plugin/7303-twig
[10]: https://www.smarty.net
[11]: https://www.jetbrains.com/help/phpstorm/smarty.html

Related to GH-120, GH-121
Closes GH-151

Co-authored-by: Sven Greb <[email protected]>
@arcticicestudio arcticicestudio unpinned this issue Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants