From a246fbdebe686bd6076188039c344af71d2ea52e Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Wed, 12 Apr 2023 01:34:33 +0800 Subject: [PATCH] register tree view --- package.json | 129 +++++++++++++++++++++++++++---- package.nls.json | 36 +++++++-- package.nls.zh-cn.json | 22 +++++- package.nls.zh-tw.json | 22 +++++- src/function/index.ts | 5 ++ src/function/treeView/command.ts | 34 ++++---- 6 files changed, 208 insertions(+), 40 deletions(-) diff --git a/package.json b/package.json index 327538a..ce59c7f 100644 --- a/package.json +++ b/package.json @@ -167,15 +167,118 @@ "light": "images/svg/light/debug.svg", "dark": "images/svg/dark/debug.svg" } + }, + { + "command": "digital-ide.treeView.arch.expand", + "category": "tool", + "icon": "$(expand-all)", + "title": "%digital-ide.treeView.arch.expand.title%" + }, + { + "command": "digital-ide.treeView.arch.collapse", + "category": "tool", + "icon": "$(collapse-all)", + "title": "%digital-ide.treeView.arch.collapse.title%" + }, + { + "command": "digital-ide.treeView.arch.refresh", + "category": "tool", + "icon": "$(refresh)", + "title": "%digital-ide.treeView.arch.refresh.title%" + }, + { + "command": "digital-ide.treeView.arch.openFile", + "category": "tool", + "title": "%digital-ide.treeView.arch.openFile.title%" + }, + { + "command": "digital-ide.tool.tool.clean", + "category": "tool", + "title": "%digital-ide.tool.tool.clean.title%" + }, + { + "command": "digital-ide.soft.launch", + "category": "tool", + "title": "%digital-ide.soft.launch.title%" + }, + { + "command": "digital-ide.soft.build", + "category": "tool", + "title": "%digital-ide.soft.build.title%" + }, + { + "command": "digital-ide.soft.download", + "category": "tool", + "title": "%digital-ide.soft.download.title%" + }, + { + "command": "digital-ide.hard.launch", + "category": "tool", + "title": "%digital-ide.hard.launch.title%" + }, + { + "command": "digital-ide.hard.simulate", + "category": "tool", + "title": "%digital-ide.hard.simulate.title%" + }, + { + "command": "digital-ide.hard.simulate.cli", + "category": "tool", + "title": "%digital-ide.hard.simulate.cli.title%" + }, + { + "command": "digital-ide.hard.simulate.gui", + "category": "tool", + "title": "%digital-ide.hard.simulate.gui.title%" + }, + { + "command": "digital-ide.hard.refresh", + "category": "tool", + "title": "%digital-ide.hard.refresh.title%" + }, + { + "command": "digital-ide.hard.build", + "category": "tool", + "title": "%digital-ide.hard.build.title%" + }, + { + "command": "digital-ide.hard.build.synth", + "category": "tool", + "title": "%digital-ide.hard.build.synth.title%" + }, + { + "command": "digital-ide.hard.build.impl", + "category": "tool", + "title": "%digital-ide.hard.build.impl.title%" + }, + { + "command": "digital-ide.hard.build.bitstream", + "category": "tool", + "title": "%digital-ide.hard.build.bitstream.title%" + }, + { + "command": "digital-ide.hard.program", + "category": "tool", + "title": "%digital-ide.hard.program.title%" + }, + { + "command": "digital-ide.hard.gui", + "category": "tool", + "title": "%digital-ide.hard.gui.title%" + }, + { + "command": "digital-ide.hard.exit", + "category": "tool", + "title": "%digital-ide.hard.exit.title%" } ], "menus": { "editor/title": [ { - "when": "editorLangId == verilog || editorLangId == systemverilog || editorLangId == vhdl", - "command": "digital-ide.tool.icarus.simulateFile", - "group": "navigation@1" - }, + "when": "editorLangId == verilog || editorLangId == systemverilog || editorLangId == vhdl", + "command": "digital-ide.tool.icarus.simulateFile", + "group": "navigation@1" + }, { "when": "editorLangId == verilog || editorLangId == systemverilog || editorLangId == vhdl", "command": "digital-ide.hdlDoc.showWebview", @@ -286,11 +389,11 @@ "configuration": "./config/link.configuration.json" }, { - "id": "digital-ide-output", - "mimetypes": [ - "text/x-code-output" - ] - } + "id": "digital-ide-output", + "mimetypes": [ + "text/x-code-output" + ] + } ], "jsonValidation": [ { @@ -330,10 +433,10 @@ "path": "./syntaxes/systemverilog.json" }, { - "language": "digital-ide-output", - "scopeName": "digital-ide.output", - "path": "./syntaxes/digital-ide-output.json" - } + "language": "digital-ide-output", + "scopeName": "digital-ide.output", + "path": "./syntaxes/digital-ide-output.json" + } ], "snippets": [ { diff --git a/package.nls.json b/package.nls.json index 44efe66..372f648 100644 --- a/package.nls.json +++ b/package.nls.json @@ -1,10 +1,30 @@ { - "digital-ide.property-json.generate.title": "generate property.json", - "digital-ide.property-json.overwrite.title": "overwrite property.json template", - "digital-ide.hdlDoc.exportFile.title": "export the document of current file", - "digital-ide.hdlDoc.exportProject.title": "export the document of current project", - "digital-ide.hdlDoc.showWebview.title": "show the document of current file in a webview", - "digital-ide.tool.instance.title": "generate instance template from selected module", - "digital-ide.tool.testbench.title": "generate testbench template from current file", - "digital-ide.tool.icarus.simulateFile.title": "do simulation for current file" + "digital-ide.property-json.generate.title": "Generate property.json", + "digital-ide.property-json.overwrite.title": "Overwrite property.json template", + "digital-ide.hdlDoc.exportFile.title": "Export the document of current file", + "digital-ide.hdlDoc.exportProject.title": "Export the document of current project", + "digital-ide.hdlDoc.showWebview.title": "Show the document of current file in a webview", + "digital-ide.tool.instance.title": "Generate instance template from selected module", + "digital-ide.tool.testbench.title": "Generate testbench template from current file", + "digital-ide.tool.icarus.simulateFile.title": "Do simulation for current file", + "digital-ide.treeView.arch.expand.title": "expand all the items in tree view", + "digital-ide.treeView.arch.collapse.title": "collapse all the items in tree view", + "digital-ide.treeView.arch.refresh.title": "refresh the tree view", + "digital-ide.treeView.arch.openFile.title": "Open the corresponding file in tree view", + "digital-ide.tool.tool.clean.title": "Clean the current project", + "digital-ide.soft.launch.title": "Launch SDK development assist function", + "digital-ide.soft.build.title": "Build the current SDK project", + "digital-ide.soft.download.title": "Download the boot file into the device", + "digital-ide.hard.launch.title": "Launch FPGA development assist function", + "digital-ide.hard.simulate.title": "Launch the manufacturer Simulation", + "digital-ide.hard.simulate.cli.title": "Launch the manufacturer Simulation in CLI", + "digital-ide.hard.simulate.gui.title": "Launch the manufacturer Simulation in GUI", + "digital-ide.hard.refresh.title": "Refresh the current project file", + "digital-ide.hard.build.title": "Build the current fpga project", + "digital-ide.hard.build.synth.title": "Synth the current project", + "digital-ide.hard.build.impl.title": "Impl the current project", + "digital-ide.hard.build.bitstream.title": "Generate the BIT File", + "digital-ide.hard.program.title": "Download the bit file into the device", + "digital-ide.hard.gui.title": "Open the GUI", + "digital-ide.hard.exit.title": "Exit the current project" } \ No newline at end of file diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index 3fb29a2..d50b45a 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -6,5 +6,25 @@ "digital-ide.hdlDoc.showWebview.title": "在 webview 中展示文档", "digital-ide.tool.instance.title": "生成选中 module 的例化模板", "digital-ide.tool.testbench.title": "从当前文件中选择 module 生成 testbench", - "digital-ide.tool.icarus.simulateFile.title": "对当前文件进行仿真" + "digital-ide.tool.icarus.simulateFile.title": "对当前文件进行仿真", + "digital-ide.treeView.arch.expand.title": "", + "digital-ide.treeView.arch.collapse.title": "", + "digital-ide.treeView.arch.refresh.title": "", + "digital-ide.treeView.arch.openFile.title": "", + "digital-ide.tool.tool.clean.title": "", + "digital-ide.soft.launch.title": "", + "digital-ide.soft.build.title": "", + "digital-ide.soft.download.title": "", + "digital-ide.hard.launch.title": "", + "digital-ide.hard.simulate.title": "", + "digital-ide.hard.simulate.cli.title": "", + "digital-ide.hard.simulate.gui.title": "", + "digital-ide.hard.refresh.title": "", + "digital-ide.hard.build.title": "", + "digital-ide.hard.build.synth.title": "", + "digital-ide.hard.build.impl.title": "", + "digital-ide.hard.build.bitstream.title": "", + "digital-ide.hard.program.title": "", + "digital-ide.hard.gui.title": "", + "digital-ide.hard.exit.title": "" } \ No newline at end of file diff --git a/package.nls.zh-tw.json b/package.nls.zh-tw.json index af08476..e13fb9c 100644 --- a/package.nls.zh-tw.json +++ b/package.nls.zh-tw.json @@ -6,5 +6,25 @@ "digital-ide.hdlDoc.showWebview.title": "", "digital-ide.tool.instance.title": "", "digital-ide.tool.testbench.title": "", - "digital-ide.tool.icarus.simulateFile.title": "" + "digital-ide.tool.icarus.simulateFile.title": "", + "digital-ide.treeView.arch.expand.title": "", + "digital-ide.treeView.arch.collapse.title": "", + "digital-ide.treeView.arch.refresh.title": "", + "digital-ide.treeView.arch.openFile.title": "", + "digital-ide.tool.tool.clean.title": "", + "digital-ide.soft.launch.title": "", + "digital-ide.soft.build.title": "", + "digital-ide.soft.download.title": "", + "digital-ide.hard.launch.title": "", + "digital-ide.hard.simulate.title": "", + "digital-ide.hard.simulate.cli.title": "", + "digital-ide.hard.simulate.gui.title": "", + "digital-ide.hard.refresh.title": "", + "digital-ide.hard.build.title": "", + "digital-ide.hard.build.synth.title": "", + "digital-ide.hard.build.impl.title": "", + "digital-ide.hard.build.bitstream.title": "", + "digital-ide.hard.program.title": "", + "digital-ide.hard.gui.title": "", + "digital-ide.hard.exit.title": "" } \ No newline at end of file diff --git a/src/function/index.ts b/src/function/index.ts index e67bc7a..6693458 100644 --- a/src/function/index.ts +++ b/src/function/index.ts @@ -33,6 +33,11 @@ function registerTreeView(context: vscode.ExtensionContext) { // constant used in tree vscode.commands.executeCommand('setContext', 'TOOL-tree-expand', false); + // register command in tree + vscode.commands.registerCommand('digital-ide.treeView.arch.expand', treeView.expandTreeView); + vscode.commands.registerCommand('digital-ide.treeView.arch.collapse', treeView.collapseTreeView); + vscode.commands.registerCommand('digital-ide.treeView.arch.refresh', treeView.refreshArchTree); + vscode.commands.registerCommand('digital-ide.treeView.arch.openFile', treeView.openFileByUri); } diff --git a/src/function/treeView/command.ts b/src/function/treeView/command.ts index 3280c50..c350e87 100644 --- a/src/function/treeView/command.ts +++ b/src/function/treeView/command.ts @@ -77,66 +77,66 @@ class HardwareTreeProvider extends BaseCommandTreeProvider { constructor() { const config: CommandConfig = { Launch: { - cmd: 'HARD.Launch', + cmd: 'digital-ide.hard.launch', icon: 'cmd', tip: 'Launch FPGA development assist function' }, Simulate: { - cmd: 'HARD.Simulate', + cmd: 'digital-ide.hard.simulate', icon: 'toolBox', tip: 'Launch the manufacturer Simulation', children: { CLI: { - cmd: 'HARD.simCLI', + cmd: 'digital-ide.hard.simulate.cli', icon: 'branch', tip: 'Launch the manufacturer Simulation in CLI' }, GUI: { - cmd: 'HARD.simGUI', + cmd: 'digital-ide.hard.simulate.gui', icon: 'branch', tip: 'Launch the manufacturer Simulation in GUI' }, } }, Refresh: { - cmd: 'HARD.Refresh', + cmd: 'digital-ide.hard.refresh', icon: 'cmd', tip: 'Refresh the current project file' }, Build: { - cmd: 'HARD.Build', + cmd: 'digital-ide.hard.build', icon: 'toolBox', tip: 'Build the current fpga project', children: { Synth: { - cmd: 'HARD.Synth', + cmd: 'digital-ide.hard.build.synth', icon: 'branch', tip: 'Synth the current project' }, Impl: { - cmd: 'HARD.Impl', + cmd: 'digital-ide.hard.build.impl', icon: 'branch', - tip: 'Impl the current project' + tip: 'Impl the current project' }, BitStream: { - cmd: 'HARD.Bit', + cmd: 'digital-ide.hard.build.bitstream', icon: 'branch', tip: 'Generate the BIT File' }, } }, Program: { - cmd: 'HARD.Program', + cmd: 'digital-ide.hard.program', icon: 'cmd', tip: 'Download the bit file into the device' }, GUI: { - cmd: 'HARD.GUI', + cmd: 'digital-ide.hard.gui', icon: 'cmd', tip: 'Open the GUI' }, Exit: { - cmd: 'HARD.Exit', + cmd: 'digital-ide.hard.exit', icon: 'cmd', tip: 'Exit the current project' } @@ -150,17 +150,17 @@ class SoftwareTreeProvider extends BaseCommandTreeProvider { constructor() { const config: CommandConfig = { Launch: { - cmd: 'SOFT.Launch', + cmd: 'digital-ide.soft.launch', icon: 'cmd', tip: 'Launch SDK development assist function' }, Build: { - cmd: 'SOFT.Launch', + cmd: 'digital-ide.soft.build', icon: 'cmd', tip: 'Build the current SDK project' }, Download: { - cmd: 'SOFT.Launch', + cmd: 'digital-ide.soft.download', icon: 'cmd', tip: 'Download the boot file into the device' }, @@ -174,7 +174,7 @@ class ToolTreeProvider extends BaseCommandTreeProvider { constructor() { const config: CommandConfig = { Clean: { - cmd: 'TOOL.Clean', + cmd: 'digital-ide.tool.tool.clean', icon: 'clean', tip: 'Clean the current project' }