lfod1997 / theme-dark-plus-darcula

Ports the flavor of JetBrains Darcula into VS Code
https://marketplace.visualstudio.com/items?itemName=oasin.theme-dark-plus-darcula
MIT License
2 stars 1 forks source link

Lack of highlighting for class `fields`, `ENUMs`, and `annotations` in Java code #1

Open Herman0802 opened 5 months ago

Herman0802 commented 5 months ago

In recent times, the components listed in the title are being displayed incorrectly in Java code. Below is an example of how the same code currently looks compared to the original theme in IntelliJ IDEA:

Dark Plus Darcula (IntelliJ imitation)

Screenshot 2024-06-02 at 20 26 42

Darcula IntelliJ IDEA

Screenshot 2024-06-02 at 20 27 35

Unfortunately, it's obvious to the naked eye how much the code readability has decreased :(

lfod1997 commented 5 months ago

Hi Herman, thanks for the issue. Can replicate this problem and will look into this soon.

lfod1997 commented 5 months ago

@Herman0802 This actually a combination of two problems:

1. This theme lacks support for certain Textmate scopes

I've published v1.2.0 to fix it. Just update the extension in VS Code.

2. Your local VS Code environment provides no semantic highlighting for Java

The default pattern-based highlighting (Textmate) that comes with the editor does not suffice. So the theme won't know that a particular "symbol" stands for a field in a Java class. That's why the color falls back to no-coloring.

To address this, nothing can be done on the theme's side. However, there are solid plugins like redhat.java that provides extended Java support, including what's known as semantic highlighting. Such services provide themes with "understandings" of your code, so the highlighting would be more accurate.

Dark Plus Darcula fully supports semantic highlighting. Here's how your code would be colored using theme v1.2.0, without semantic highlighting (editor default):

without language support

With semantic highlighting (using redhat.java):

with language support
Herman0802 commented 5 months ago

@lfod1997, after your update, it has become better. However, could you additionally share your settings for this extension to ensure the creation of an identical design?

lfod1997 commented 5 months ago

@Herman0802 I believe there is no extra settings for the extension in my VS Code. I installed the extension, and it works out of the box :p

Herman0802 commented 5 months ago

Well, in the redhat.java plus oasin.theme-dark-plus-darcula pair, in my case, there is still no support for ENUMs and annotations:

Screenshot 2024-06-04 at 11 04 25

This is how it looks using only oasin.theme-dark-plus-darcula:

Screenshot 2024-06-04 at 11 04 04
lfod1997 commented 4 months ago

@Herman0802 Hey could you try providing the token info of the uncolored enum members? Here's how:

  1. open your source file and see the bug reporduce
  2. open command palette by pressing Ctrl (Command) + Shift + P
  3. enter tokens after the ">" symbol, and select "Developer: Inspect Editor Tokens and Scopes"
  4. there will be a popup that follows your cursor; click on the uncolored enum members in your source file
  5. see the token show up in the popup, paste me the following information that it gives (all, if multiple items in one category):
    • semantic token type (if exists)
    • modifiers (if exists)
    • textmate token
    • textmate scopes

Thanks, it will help me fix your specific problem.