-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Description
As a developer working with Custom Elements classes that have their class members available in runtime, I would like to use Symbol to hide internal methods and properties from the public API.
The drawback of this approach is that "go to definition" currently does not recognise the case when Symbol is used for a method, and jumps to the place where the Symbol itself is defined.
I'm not sure whether this is a bug or feature.
TypeScript Version: 3.8.0-dev.20191126
Search Terms: Go to definition, ECMAScript Symbols, Symbol
Code
const method = Symbol('method');
class Parent {
protected [method]() {
return 'parent';
}
}
class Child extends Parent {
protected [method]() {
return super[method]() + ' child';
}
}Expected behavior:
When clicking on super[method], it should be possible to go to the line 4.
Actual behavior:
When clicking on super[method], go to definition moves to the line 1.
Related Issues:
I didn't found any related issue but the approach with using ES2015 Symbols was suggested to be used as a workaround for protected methods in mixins at #17744 (comment)