-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Bring back typedef property expansion #25784
Comments
@mjbvz maybe we need a way for ppl to "expand" a type alias declaration in the quick info.. are there any experiences like that in VSCode that we can model after? |
Yes, I think I misunderstood this specific issue but having a way to expand types dynamically in hover would be very helpful. We have no concept of this in VS Code currently. Visual Studio might though |
VS does not either. i think eclipse does. |
@mhegazy @mjbvz /** @type {DoneStatus} */
var ns = {
}
/**
* @typedef {{ status: Status, m(n: number): void }} DoneStatus
* @typedef {{
hello: 'world'
}} Status */ However, there is no way to provide a description of a property for auto-complete hints Therefore, the quickest solution before providing expansion of types is to allow writing /**
* @typedef {{ status: Status, m(n: number): void }} DoneStatus
* @prop {Status} status The status
* @typedef {{
hello: 'world'
}} Status */ (Note the additional |
@weswigham I don't think that your change from here which is the point of this topic will be reverted, but is it possible to at least implement the suggestion in the post above ^? thanks. |
@zavr-1 That PR brought JSDoc into the same style of printout that we used for TS, but the core issue is that when a type is aliased within quickinfo, there's no way to inspect what's "inside the alias" right at that point, as it were. Hence @mhegazy and @mjbvz 's remarks on new UI to enable that in vscode/VS. We've talked about it in the past - it seems generally useful for inspecting large type hierarchies. |
@weswigham OK but why is it possible to inspect what's inside using
but not
What I'm saying OK fine I get the point of aliases for large type hierarchies, but could you not allow me to write At the moment, it's either: Forcing nested properties, but no description in auto-complete/**
* @typedef {{ prop: TypeB }} TypeA
* @prop {TypeB} prop A test Prop
* @typedef {string} TypeB
*/ Type alias, with description in auto-complete/**
* @typedef {Object} TypeA
* @prop {TypeB} prop A test Prop
* @typedef {string} TypeB
*/ |
I'd love to see this happen as internal typedefs are usually quite important in terms of their structure. A quick set of ideas to please both people who need it and people who prefer the simplified view:
|
Related feature request: #56010. |
Is there any progress? |
In relation to this, recently we have merged into VS Code a proposed API for expanding and contracting hovers (see PR here microsoft/vscode#210472), so if the TypeScript server adopts quick info expansion, we could implement this in VS Code too. |
From @zavr-1 on July 18, 2018 20:25
In the newer version, I can only see the type of an argument which is an object, compared to how it was expanded in the previous versions.
It was actually very useful to see all properties on hover which served as a documentation.
I think if you hide the details of the type, you should also provide means to expand its properties via a UI, or provide a setting for it.
Copied from original issue: microsoft/vscode#54609
The text was updated successfully, but these errors were encountered: