ballerina-platform / plugin-intellij

Ballerina extension for IntelliJ IDEA.
Apache License 2.0
118 stars 4 forks source link

Add same name identifier highlighting feature #56

Closed ThemiraChathumina closed 4 months ago

ThemiraChathumina commented 4 months ago

Purpose

Highlight the same identifiers in the file and add location information to the error stripe. Related to https://github.com/ballerina-platform/plugin-intellij/issues/55

Approach

Filter out the IDENTIFIER tokens which have the same name as the identifier that the editor caret is on. Get the current UI theme text color, increase the opacity to blend with the background and add box type highlighting to all selected PSI elements. Also add the identifier location to the error stripe.

Samples

Highlighted identifiers and their location on the right side error stripe in both dark mode and light mode image

image