redhat-developer / redhat-developer/vscode-java

Incorrect TextMate semantic meaning of tokens when using Lombok

Open
#3,719 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug highlighting Lombok
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

When I add lombok @SneakyThrows method annotation, tokens color theme changes to incorrect one. This happens because TextMate rules stop working and semantic meaning of tokens recognises incorectly.

Environment
  • Operating System: Windows 11

  • JDK version: 21

  • Visual Studio Code version: 1.91.1

  • Java extension version: v1.32.0

Steps To Reproduce

image
Notice the differnce between the "classType" method parameter in top "generate" function and bottom one.

Current Result

Tokens color is incorrect

Expected Result

Tokens color is correct

Additional Informations

This is my TextMate color theme:

  "editor.tokenColorCustomizations": {
    "textMateRules": [
      {
        "scope": "variable.parameter",
        "settings": {
          "foreground": "#deffcb"
        }
      }
    ]
  }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the coloring difference with Lombok @SneakyThrows in the Java extension on the versions listed, then trace how semantic tokens and TextMate rules classify the classType parameter. Done means the parameter receives the expected variable.parameter coloring in the reported case without regressing ordinary Java methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.