You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, VSCode only shows (method) and (property) before the method name and property name, e.g.
(method) A.show(str: string): void and (property) A.text: string.
But it didn't tell whether the property or method is public, protected or private, it doesn't appear being a problem when dealing with TypeScript most of the case.
But when writing JavaScript code, especially for a user who imports a third party module. The author of that module would want to hide those protected and private properties.
One of the history version of VSCode did hide those, but it was soon removed, possibly because JavaScript always allow a user to access all properties of the class, and VSCode doesn't want to make it confused and cause troubles.
But, such a feature is still very important. Since hiding those properties isn't that appropriate, I suggest adding modifiers before the property name and method name in the intallisense hint. e.g.
(public) A.show(str: string): void and (private) A.text: string, or (private readonly) A.text: string.
In this form, the hint text keeps short and clear, and tells the visibility of the property, so that the user knows whether the property is accessible or rewritable in his code, especially for JavaScript.
I think this feature will be very helpful both in TypeScript and JavaScript, hope it could be implemented in the next VSCode version.
Moving upstream since, while we can fix this on the VS Code side, it would probably be better to have the displayParts return this information so that all typescript users benefit
@mjbvz the kindModifiers should include this information. the intention is that these are not shown as (public) but rather that they control the icons shown.
The rational is (public) on virtually every property/method seems like a lot of noise for users, but the icon conveys the meaning without wasting UI real state.
For example, this is how VS shows it:
mhegazy
added
the
External
Relates to another program, environment, or user action which we cannot control.
label
Jul 16, 2018
From @hyurl on May 4, 2018 17:47
Currently, VSCode only shows
(method)
and(property)
before the method name and property name, e.g.(method) A.show(str: string): void
and(property) A.text: string
.But it didn't tell whether the property or method is
public
,protected
orprivate
, it doesn't appear being a problem when dealing with TypeScript most of the case.But when writing JavaScript code, especially for a user who imports a third party module. The author of that module would want to hide those protected and private properties.
One of the history version of VSCode did hide those, but it was soon removed, possibly because JavaScript always allow a user to access all properties of the class, and VSCode doesn't want to make it confused and cause troubles.
But, such a feature is still very important. Since hiding those properties isn't that appropriate, I suggest
adding modifiers before the property name and method name in the intallisense hint. e.g.
(public) A.show(str: string): void
and(private) A.text: string
, or(private readonly) A.text: string
.In this form, the hint text keeps short and clear, and tells the visibility of the property, so that the user knows whether the property is accessible or rewritable in his code, especially for JavaScript.
I think this feature will be very helpful both in TypeScript and JavaScript, hope it could be implemented in the next VSCode version.
Copied from original issue: microsoft/vscode#49234
The text was updated successfully, but these errors were encountered: