You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VSCode扩展功能对应的Eclipse插件等价API及文档咨询

VSCode扩展API对应Eclipse插件API映射及文档来源

VSCode API 与 Eclipse 插件 API 映射

  • vscode.window.activeTextEditor.document.uri:通过PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()获取当前编辑器,再调用getEditorInput().getURI()获取文件URI
  • vscode.window.activeTextEditor.selection:当前编辑器的选择可通过activeEditor.getSite().getSelectionProvider().getSelection()获取,若为文本选择可强转为ITextSelection,对应VSCode的选区信息
  • vscode.window.showInformationMessage:使用MessageDialog.openInformation(Shell parent, String title, String message),Shell可通过PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()获取
  • vscode.workspace.getConfiguration:通过Platform.getPreferencesService().getInstanceScope().getNode("你的插件ID")获取插件专属配置节点,对应VSCode的工作区/用户配置
  • vscode.window.showInputBox:使用InputDialog.open(Shell parent, String title, String message, String initialValue)弹出输入框获取用户输入
  • vscode.window.showQuickPick:使用ListDialog.open(Shell parent, Object[] elements)展示选项列表,供用户快速选择
  • vscode.window.activeTextEditor.edit:先通过IDocumentProvider.getDocument(editorInput)获取当前文档,再调用replace(int offset, int length, String text)替换选中内容,修改后可按需调用editor.getDocumentProvider().saveDocument(null, editorInput, null, false)保存

Eclipse插件API文档最佳来源

  • Eclipse IDE内置的Platform Plug-in Developer Guide:包含插件开发核心概念、API详解、分步教程等,可通过IDE的Help > Help Contents直接访问
  • Eclipse API Javadoc文档:每个组件的类、方法注释都在Javadoc中,可通过IDE的代码跳转(Ctrl+点击类/方法名)查看,也能在帮助系统中找到对应API的完整参考

内容的提问来源于stack exchange,提问作者David Souther

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.24 10:22:07