izhangzhihao / intellij-rainbow-brackets

🌈Rainbow Brackets for IntelliJ based IDEs/Android Studio/HUAWEI DevEco Studio/Fleet
https://plugins.jetbrains.com/plugin/10080-rainbow-brackets
GNU General Public License v3.0
4.39k stars 206 forks source link

Rainbow Variables not correctly identifying Typescript Class variables and Dependency Injection variables inside methods #2642

Closed absantanna2412 closed 1 year ago

absantanna2412 commented 1 year ago

Please check

Your programming languages

Angular 9.0

Expected Behavior

Class and Dependency Injection variables must have the same color inside method as they are when we are declaring them.

Current Behavior

Class Variables are correctly Rainbowfied, but when I use it inside any methods I need to put this. in front of the variable and now the plugin does not work, and the variables receives a standard color. The same happens with Dependency Injection variables.

Possible Solution

Not a clue.

Code snippet for reproduce (for bugs)

image

import {Injectable, OnInit} from '@angular/core';
import {MenuItem} from 'primeng';
import {Subject} from 'rxjs';

@Injectable()
export class TestService {
    private itemsSource = new Subject<MenuItem[]>();
    setItems(items: MenuItem[]) {
        this.itemsSource.next(items);
    }
}

export class TestClass implements OnInit {
    loading = false;
    processing = false;
    constructor(private testService: TestService) {
        this.processing = true;
        this.testService.setItems([{label: 'Demonstrativo Editor'}]);
    }
    ngOnInit() {
        this.loading = true;
    }
}

Your Environment

Non-Bundled Plugins: org.jetbrains.plugins.go-template (231.8109.91) com.intellij.ideolog (203.0.30.0) com.crunch42.openapi (1.56) dev.meanmail.plugin.nginx-intellij-plugin (2022.1.1) com.intellij.properties.bundle.editor (231.8109.91) org.jetbrains.plugins.go (231.9011.4) com.tabnine.TabNine (1.0.16) com.samdark.intellij-visual-studio-code-dark-plus (2.7) String Manipulation (9.9.0) com.chylex.intellij.inspectionlens (1.3.0) com.intellij.jsf (231.8109.90) izhangzhihao.rainbow.brackets (2023.2.11) com.intellij.javaee.batch (231.8109.90) com.ifengxue.plugin.jpa-support (2.1.0-RC3) com.haulmont.jpab (2023.2.4-231) tv.twelvetone.intellij.plugins.intellivue (1.1.32) com.mallowigi (90.0.0) mobi.hsz.idea.gitignore (4.5.0) com.intellij.spring.batch (231.8770.17)

Kotlin: 231-1.8.21-IJ9011.34

open-collective-bot[bot] commented 1 year ago

Hey @absantanna2412 :wave:,

Thank you for opening an issue/feature request. We will get back to you as soon as we can.

Please consider support us by buying a license here or donating from OpenCollective https://opencollective.com/intellij-rainbow-brackets.

And we have a special plan for paid users, if you are a paid user, your issue or feature request will have a higher priority.

If you are creating a issue, please make sure you already read the latest change log here.

izhangzhihao commented 1 year ago

Hi, the feature 'Rainbow Variables for TypeScript' comes from the 'Semantic Highlighting for TypeScript', a built-in IDE WebStorm feature. So you should report this issue to WebStorm here.

absantanna2412 commented 1 year ago

I`ve paid for your plugin and I hoped a better support.

The Semantic Highlighting for TypeScript does not colorize Class variables or Dependency Injection variables, your plugin does!

image

Look at the same file with your plugin turned off.

So, if your plugin colorizes the variables it should colorizes in all places. Or not colorize at all.

izhangzhihao commented 1 year ago

Ok, good to know, can you highlight the difference between the two screenshots? I can look into this later.

absantanna2412 commented 1 year ago

Hi Thanks.

With your plugin turned on, I`ve the the loading and processing class variables colorized, the testService injection also colorized (red arrow), but not colorized inside methods (yellow arrows)

image

But when I turn the plugin off, the variables stay in the Semantic Highlighting for TypeScript default color. Same color red and yellow arrows.

image

If you are not able to colorize the variable usage inside methods, I think you shouldn't colorize at declaration.

Hope this helps.

Best.

izhangzhihao commented 1 year ago

Hi, I tested these two cases:

image image image

So, I can say this issue is not because of this plugin, I already reported a YouTrack ticket for JetBrains, we can follow up there.

Thanks again for reporting issues.