microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 235 forks source link

Find all references highlights all instances of symbol text #59

Open mbraude opened 9 years ago

mbraude commented 9 years ago

Find all references should only highlight the symbol, not all instances of the symbol text.

Steps to reproduce:

  1. Copy this text into a new .ts file:

class Foo { public method(method: any) { }

public test() {
    this.method(null);
}

}

  1. Put the cursor on 'method' and press ctrl +t, ctrl + r.

Expected: There is a reference to the method declaration, and the symbol 'method' is underlined. Actual: All instances of the text 'method' are highlighted in the reference. So in

D:/async/experimental/test.ts: 2: public method(method: any) {

All 'method' strings are underlined. Only the first should be underlined.

steveluc commented 9 years ago

We have a fix.

billti commented 9 years ago

@steveluc. Ping on this. You mention above you have a fix, did this not get checked in yet? I'm still seeing the 'method' param get underlined.

steveluc commented 9 years ago

Fix is expensive because it involves a re-factoring of the find references view. The re-factoring has other benefits (generalizes the find references view so we can use it for any list of code locations). On the roadmap, but responding to perf and function bugs is a higher priority right now.

zhengbli commented 9 years ago

@steveluc Now we are working on the refactoring, is there any chance your fix can be incorporated too?