type ConstructorType = abstract new (...params: any[]) => any
function FooF<T extends ConstructorType>(Base: T) {
abstract class Foo extends Base {
abstract foo(): void;
}
return Foo;
}
class Bar extends FooF(Object) {
foo() {}
}
π Actual behavior
Note: I noticed this in my editor and not using the TS language service API directly, but I'm assuming the problem is at the Language Service layer
In the TS playground, if you try to "Find All / Go to References", "Rename symbol", or "Find All / Go to Implementation" (in VS Code, for example) for Foo.foo, it won't find/update Bar.foo.
π Expected behavior
I would expect TS to recognize that Bar.foo is a reference/implementation of Foo.foo. Note that TS does correctly require Bar to implement foo, so the compiler already has some idea that they are connected.
I know it's not within the scope of this repo but I'll mention it in case it helps with anything, but FWIW while IntelliJ also fails at finding references/implementations (probably because it defers to the TS Language service), IntelliJ also provides a "Go to Super method" function that does correctly jump from Bar.foo to Foo.foo.
Additional information about the issue
After snooping around the source a little, my guess is that either:
something around how TS represents mixin classes, as kind of un-named class expressions e.g. ((abstract new (...params: any[]) => Foo) & { prototype: FooF<any>.Foo; }) & T instead of typeof Foo & T in the above example (visible if you hover over FooF), and/or
π Search Terms
mixin mixins reference references implementation implementations find go to goto language service server protocol lsp
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?#code/C4TwDgpgBAwg9gOwM7AE4FcDGw6oCrjQC8UAhgEYqqnZQIQDuUAFAHTtinUC2SAXGQQgA2gF0AlFCIA+QSABQAM3QJsAS0RQAYnDhaAPHigQAHsAgIAJkliIqWHPkLTmAIVJIIAvJIDe8qECySjQaYChMABsPGx04YzMLayh3Tyh-IMzgqjCoRV1mcQEANzg1SwBuAKCAX2rA1AhgdFQEbV0quvkomJSuBPMrWN0tZgB5cgArCGw-eryCvzqaoA
π» Code
π Actual behavior
Note: I noticed this in my editor and not using the TS language service API directly, but I'm assuming the problem is at the Language Service layer
In the TS playground, if you try to "Find All / Go to References", "Rename symbol", or "Find All / Go to Implementation" (in VS Code, for example) for
Foo.foo
, it won't find/updateBar.foo
.π Expected behavior
I would expect TS to recognize that
Bar.foo
is a reference/implementation ofFoo.foo
. Note that TS does correctly requireBar
to implementfoo
, so the compiler already has some idea that they are connected.I know it's not within the scope of this repo but I'll mention it in case it helps with anything, but FWIW while IntelliJ also fails at finding references/implementations (probably because it defers to the TS Language service), IntelliJ also provides a "Go to Super method" function that does correctly jump from
Bar.foo
toFoo.foo
.Additional information about the issue
After snooping around the source a little, my guess is that either:
((abstract new (...params: any[]) => Foo) & { prototype: FooF<any>.Foo; }) & T
instead oftypeof Foo & T
in the above example (visible if you hover overFooF
), and/or