cholick / idea-spock-enhancements

A plugin for IntelliJ IDEA that improves integration with the Spock specification framework
Other
30 stars 10 forks source link

I upgraded to IDEA 15 and the syntax highlighting foreground color has stopped working #23

Closed mike-duvall closed 1 year ago

mike-duvall commented 8 years ago

I tried uninstalling and reinstalling the plugin but that had no effect.

cholick commented 8 years ago

I haven't been able to reproduce this. Using 15 Ultimate, I'm able to change the color Other Settings -> Spock and see it reflected in the UI. The only difference I see is that changing the color doesn't apply on an open file until the contents change, as opposed to 14, where it happens immediately.

mike-duvall commented 8 years ago

More info: I tried changing the contents of the file, and the color still did not work. I did notice that Bold and Italic settings do work(but only after file contents changes).

I also tried deleting my .IntelliJIdea15 folder and reconfiguring from scratch, but that had no effect.

I'm running Linux Mint 17 with Oracle Java 8

gillius commented 8 years ago

I have the same issue with IDEA 15.0.1 on Windows 7. When I open the file, there is no highlighting, or maybe just the first term is highlighted. If I change the line then sometimes that when/then/expect gets highlighted and others have highlights removed, or sometimes nothing happens. Sometimes when I edit the first half of the file is highlighted. Sometimes when I edit I see the "when" highlight yellow for a brief moment then go back to no highlight (white).

I think error detection (like no then for when) is still working consistently, though.

When I first opened this project, I experienced indexing errors (reported in #24), so this may or may not be impacting the highlighting.

cholick commented 8 years ago

Fixed up #24 and this isn't related.

I still can't reproduce this though. I spun up a VM with Mint 17 + Oracle's JVM to check in the same environment, but I still don't see the behavior.

If you open the project https://github.com/cholick/idea-spock-enhancements/tree/master/test_project, does this happen for you on BigBrotherSpec or TestSpec? (Ignore ChildSpec and SetupSpec; they're negative tests so the plugin won't do anything in those files):

Blackbaud-MikeDuVall commented 8 years ago

Very interesting. When I open up your test project, I see proper highlighting for BigBrotherSpec, but the highlighting does NOT work for TestSpec. If I make a copy of BigBrotherSpec, the highlighting works. If I make a copy of TestSpec, the highlighting doesn't work. I'll keep playing around and see if I can figure out what the difference is.

Blackbaud-MikeDuVall commented 8 years ago

I've been unable to come to any more clarity on what it makes it sometimes work, sometimes not. I'm now able to sometimes see BigBrotherSpec not work and TestSpec work, i.e. the opposite of above, so I don't think it has anything to do with those particular specs. I uninstalled practically every plugin but the bare bones and it still doesn't work. I also did a fresh install of LInux Mint 17 on a virtual box with IntelliJ and Oracle Java 7, replicating my current dev environment(including plugins), and it works flawlessly. So it seems like something in my current environment is causing the problem, but I can't pin it down so far.

quintonm commented 8 years ago

I am seeing similar behavior on IntelliJ 15.0.2 running on OSX (using Darcula theme). The highlighting for spock labels sometimes works and sometimes does not work. Most of the time, the highlighting works for some labels but them stops within the same test class. For example, for a class that contains 3 tests, the highlighting might work as expected in the first test, part of the second and none of the third.

I configured the spock highlighting to use a bright red color with bold and italics. To make it really stand out from the normal label highlighting which is white without bold or italics. What I am seeing is that only the color is not changed. Within a test class, all of the spock labels are bold and italic but the color is only applied part of the way though the file.

I believe that the cause of the issue might be due to a race condition between the IntelliJ's default highlighting for labels and the plugin's settings for spock highlighting. The darcula theme sets the color for labels to a gray-ish color (A9B7C6) which is what I am seeing for some of the spock labels. If I copy the theme and disable the explicit foreground color, then the spock labels are shown with the correct color. I can also just change to the default theme which does not set an explicit foreground colors for labels as well to resolve the issue.

mike-duvall commented 8 years ago

I'm seeing exactly the same results that quintonm just reported above. If I use 'Darcula' theme, the color highlighting either doesn't work or works erratically. If I switch the 'Intellij" theme, the color highlighting works. If I modify the Darcula theme to remove the Groovy label color, the color specified by the spock plugin again works. So that's at least a workaround. Thanks for figuring that out quintonm.

vanta commented 8 years ago

IntelliJ EAP 2016.2:

image

arturowczarek commented 7 years ago

Still the same in IntelliJ EAP 2017.2.1 zrzut ekranu z 2017-08-14 11-41-02

iriiiina commented 6 years ago

I have the same problem - currently I use IntelliJ IDEA CE 2017.3

2017 3
mayaul commented 5 years ago
  1. Go Intellij Preferences
  2. Set Color on 'Others Settings -> Spock -> Foreground'
  3. Set Color on 'Editor -> Color Scheme Font -> Groovy -> Label'

You can fix it if you are set 1 and 2 the same color.

currently, I use IntelliJ IDEA 2018.3 (Ultimate Edition).