Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Shows method and property modifiers in intellisense #25701

Closed
mjbvz opened this issue Jul 16, 2018 · 3 comments
Closed

Feature Request: Shows method and property modifiers in intellisense #25701

mjbvz opened this issue Jul 16, 2018 · 3 comments
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@mjbvz
Copy link
Contributor

mjbvz commented 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 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.

Copied from original issue: microsoft/vscode#49234

@mjbvz
Copy link
Contributor Author

mjbvz commented Jul 16, 2018

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 mjbvz removed their assignment Jul 16, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Jul 16, 2018

@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:
image

@mhegazy mhegazy added the External Relates to another program, environment, or user action which we cannot control. label Jul 16, 2018
@mjbvz
Copy link
Contributor Author

mjbvz commented Jul 16, 2018

Good point, this is tracked by microsoft/vscode#23927 on our side

@mjbvz mjbvz closed this as completed Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

2 participants