Skip to content

Add Type Definition Provider API - #19699

Merged
Matt Bierner (mjbvz) merged 5 commits into
microsoft:masterfrom
mjbvz:add-type-definition-provider
Feb 2, 2017
Merged

Matt Bierner (mjbvz) merged 5 commits into
microsoft:masterfrom
mjbvz:add-type-definition-provider

Conversation

@mjbvz

Copy link
Copy Markdown
Contributor

Fixes #10489

Adds a new vscode API to support type definition providers and adds an type definition provider for TypeScript

@mention-bot

Copy link
Copy Markdown

Matt Bierner (@mjbvz), thanks for your PR! By analyzing the history of the files in this pull request, we identified Johannes Rieken (@jrieken) and alexandrudima to be potential reviewers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restore previous coding style

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Comment thread src/vs/vscode.d.ts Outdated

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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.

Matt Bierner added 4 commits February 2, 2017 11:29
Adds a new API to support type definition providers and adds an initial type definition provider for TypeScript
@mjbvz
Matt Bierner (mjbvz) merged commit a87586c into microsoft:master Feb 2, 2017
@jrieken

Copy link
Copy Markdown
Contributor

Matt Bierner (@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 DefinitionProvider.

@mjbvz

Copy link
Copy Markdown
Contributor Author

Johannes Rieken (@jrieken) I'd be fine with that. The only arguments I see in having a separate TypeDefinitionProvider interface:

  • It is more consistent with the existing DefinitionProvider and ImplementationProvider api. Each of these power a single piece of editor functionality, such as go to definition or go to implementation
  • Adding an optional provideTypeDefinition method on DefinitionProvider means that an extension could not register only as a type definition provider. They would have to implement provideDefinition as well, even if they return empty results

Let me know if you think we refactor the api this way or if you have any alternate design proposals.

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Go to inferred type definition via keyboard shortcut

4 participants