register tree view

This commit is contained in:
锦恢 2023-04-12 01:34:33 +08:00
parent 0fb86a70a1
commit a246fbdebe
6 changed files with 208 additions and 40 deletions

View File

@ -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": [
{

View File

@ -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"
}

View File

@ -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": ""
}

View File

@ -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": ""
}

View File

@ -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);
}

View File

@ -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'
}