-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Add Type Definition Provider API #19699
Conversation
@mjbvz, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jrieken and @alexandrudima to be potential reviewers. |
constructor( | ||
private documents: ExtHostDocuments, | ||
private provider: vscode.DefinitionProvider) | ||
{ } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore previous coding style
this._documents = documents; | ||
this._provider = provider; | ||
} | ||
constructor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@@ -145,6 +137,26 @@ class ImplementationAdapter { | |||
} | |||
} | |||
|
|||
class TypeDefinitionAdapter { | |||
constructor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@@ -1668,6 +1668,24 @@ declare module 'vscode' { | |||
} | |||
|
|||
/** | |||
* The type definition provider defines the contract between extensions and | |||
* the go to type definition feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the other language features this needs a section the doc (editing evolved) such that people has a clear understanding of what this is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #19731 to track this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the PR: microsoft/vscode-docs#823
}, | ||
menuOpts: { | ||
group: 'navigation', | ||
order: 1.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order
collides with the one above with means lex sort is applied which means order changes from language to language
menuOpts: { | ||
group: 'navigation', | ||
order: 1.3 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general we need to revisit the context menu because now it becomes more and more loaded. We will now have
- Find References
- Go to Definition
- Peek Definition
- Go to Implementation
- Peek Implementation
- Go to Type Definition
- Peek Type Definition
which I think is a little messy already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.I think we should remove peek implementation and peek type definition from the menu.
Adds a new API to support type definition providers and adds an initial type definition provider for TypeScript
7959132
to
16484f8
Compare
@mjbvz We should maybe revisit this or think more about this. I wonder if it would make more sense to not have a separate provider here but to make this an option the existing |
@jrieken I'd be fine with that. The only arguments I see in having a separate
Let me know if you think we refactor the api this way or if you have any alternate design proposals. |
Fixes #10489
Adds a new vscode API to support type definition providers and adds an type definition provider for TypeScript