返回介绍

Complex Commands API

发布于 2020-03-27 16:12:55 字数 5082 浏览 857 评论 0 收藏 0

This document lists a set of complex commands that we consider stable. They are called complex commands because they require parameters and often return a value. You can use the commands in conjunction with the executeCommand API.

The following is a sample of how to preview a HTML document:

let uri = Uri.parse('file:///some/path/to/file.html');
let success = await commands.executeCommand('vscode.previewHtml', uri);

Commands

vscode.executeWorkspaceSymbolProvider - Execute all workspace symbol provider.

  • query Search string
  • (returns) A promise that resolves to an array of SymbolInformation-instances.

vscode.executeDefinitionProvider - Execute all definition provider.

  • uri Uri of a text document
  • position Position of a symbol
  • (returns) A promise that resolves to an array of Location-instances.

vscode.executeHoverProvider - Execute all hover provider.

  • uri Uri of a text document
  • position Position of a symbol
  • (returns) A promise that resolves to an array of Hover-instances.

vscode.executeDocumentHighlights - Execute document highlight provider.

  • uri Uri of a text document
  • position Position in a text document
  • (returns) A promise that resolves to an array of DocumentHighlight-instances.

vscode.executeReferenceProvider - Execute reference provider.

  • uri Uri of a text document
  • position Position in a text document
  • (returns) A promise that resolves to an array of Location-instances.

vscode.executeDocumentRenameProvider - Execute rename provider.

  • uri Uri of a text document
  • position Position in a text document
  • newName The new symbol name
  • (returns) A promise that resolves to a WorkspaceEdit.

vscode.executeSignatureHelpProvider - Execute signature help provider.

  • uri Uri of a text document
  • position Position in a text document
  • (returns) A promise that resolves to SignatureHelp.

vscode.executeDocumentSymbolProvider - Execute document symbol provider.

  • uri Uri of a text document
  • (returns) A promise that resolves to an array of SymbolInformation-instances.

vscode.executeCompletionItemProvider - Execute completion item provider.

  • uri Uri of a text document
  • position Position in a text document
  • (returns) A promise that resolves to a CompletionList-instance.

vscode.executeCodeActionProvider - Execute code action provider.

  • uri Uri of a text document
  • range Range in a text document
  • (returns) A promise that resolves to an array of CompletionItem-instances.

vscode.executeCodeLensProvider - Execute completion item provider.

  • uri Uri of a text document
  • (returns) A promise that resolves to an array of Commands.

vscode.executeFormatDocumentProvider - Execute document format provider.

  • uri Uri of a text document
  • options Formatting options
  • (returns) A promise that resolves to an array of TextEdits.

vscode.executeFormatRangeProvider - Execute range format provider.

  • uri Uri of a text document
  • range Range in a text document
  • options Formatting options
  • (returns) A promise that resolves to an array of TextEdits.

vscode.executeFormatOnTypeProvider - Execute document format provider.

  • uri Uri of a text document
  • position Position in a text document
  • ch Character that got typed
  • options Formatting options
  • (returns) A promise that resolves to an array of TextEdits.

vscode.previewHtml - Preview an html document.

  • uri Uri of the document to preview.
  • column (optional) Column in which to preview.

editor.action.showReferences - Show references at a position in a file

  • uri The text document in which to show references
  • position The position at which to show
  • locations An array of locations.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文