Merge branch 'main' of https://github.com/Digital-EDA/Digital-IDE
This commit is contained in:
commit
cbb9c40940
10
package.json
10
package.json
@ -284,12 +284,12 @@
|
|||||||
"default": "vivado",
|
"default": "vivado",
|
||||||
"description": "%digital-ide.function.lsp.linter.vhdl.diagnostor.title%"
|
"description": "%digital-ide.function.lsp.linter.vhdl.diagnostor.title%"
|
||||||
},
|
},
|
||||||
"digital-ide.function.lsp.linter.linter-mode": {
|
"digital-ide.function.lsp.linter.mode": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enumDescriptions": [
|
"enumDescriptions": [
|
||||||
"%digital-ide.function.lsp.linter.linter-mode.0.title%",
|
"%digital-ide.function.lsp.linter.mode.0.title%",
|
||||||
"%digital-ide.function.lsp.linter.linter-mode.1.title%",
|
"%digital-ide.function.lsp.linter.mode.1.title%",
|
||||||
"%digital-ide.function.lsp.linter.linter-mode.2.title%"
|
"%digital-ide.function.lsp.linter.mode.2.title%"
|
||||||
],
|
],
|
||||||
"enum": [
|
"enum": [
|
||||||
"full",
|
"full",
|
||||||
@ -297,7 +297,7 @@
|
|||||||
"shutdown"
|
"shutdown"
|
||||||
],
|
],
|
||||||
"default": "full",
|
"default": "full",
|
||||||
"description": "%digital-ide.function.lsp.linter.linter-mode.title%"
|
"description": "%digital-ide.function.lsp.linter.mode.title%"
|
||||||
},
|
},
|
||||||
"digital-ide.function.lsp.linter.linter-level": {
|
"digital-ide.function.lsp.linter.linter-level": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -94,10 +94,10 @@
|
|||||||
"digital-ide.structure.from-xilinx-to-standard.title": "Konvertieren Sie Xilinx-Projekte in die Digital IDE-Standardprojektstruktur",
|
"digital-ide.structure.from-xilinx-to-standard.title": "Konvertieren Sie Xilinx-Projekte in die Digital IDE-Standardprojektstruktur",
|
||||||
"digital-ide.prj.verible.install.path.title": "Installationsverzeichnispfad für verible, also der absolute Pfad des Ordners, der die ausführbare Datei verible-verilog-syntax enthält. Wenn nicht angegeben, wird standardmäßig verible-verilog-syntax für die Diagnose verwendet.",
|
"digital-ide.prj.verible.install.path.title": "Installationsverzeichnispfad für verible, also der absolute Pfad des Ordners, der die ausführbare Datei verible-verilog-syntax enthält. Wenn nicht angegeben, wird standardmäßig verible-verilog-syntax für die Diagnose verwendet.",
|
||||||
"digital-ide.prj.verilator.install.path.title": "Installationsverzeichnispfad für verilator, also der absolute Pfad des Ordners, der die ausführbare Datei verilator enthält. Wenn nicht angegeben, wird standardmäßig verilator für die Diagnose verwendet.",
|
"digital-ide.prj.verilator.install.path.title": "Installationsverzeichnispfad für verilator, also der absolute Pfad des Ordners, der die ausführbare Datei verilator enthält. Wenn nicht angegeben, wird standardmäßig verilator für die Diagnose verwendet.",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.title": "Diagnosemodus des Linters festlegen",
|
"digital-ide.function.lsp.linter.mode.title": "Diagnosemodus des Linters festlegen",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.0.title": "Diagnostizieren Sie alle Designquellen direkt und melden Sie Fehler, unabhängig davon, ob die Dateien geöffnet sind.",
|
"digital-ide.function.lsp.linter.mode.0.title": "Diagnostizieren Sie alle Designquellen direkt und melden Sie Fehler, unabhängig davon, ob die Dateien geöffnet sind.",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.1.title": "Wenn eine einzelne Datei geschlossen ist, wird der entsprechende Fehler entfernt, und nur die geöffnete Datei wird diagnostiziert.",
|
"digital-ide.function.lsp.linter.mode.1.title": "Wenn eine einzelne Datei geschlossen ist, wird der entsprechende Fehler entfernt, und nur die geöffnete Datei wird diagnostiziert.",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.2.title": "Global deaktiviert, d.h. für das gesamte Projekt werden keine Projektfehler gemeldet.",
|
"digital-ide.function.lsp.linter.mode.2.title": "Global deaktiviert, d.h. für das gesamte Projekt werden keine Projektfehler gemeldet.",
|
||||||
"digital-ide.function.lsp.linter.linter-level.title": "Diagnoselevel-Einstellungen des Linters",
|
"digital-ide.function.lsp.linter.linter-level.title": "Diagnoselevel-Einstellungen des Linters",
|
||||||
"digital-ide.function.lsp.linter.linter-level.error.title": "Nur Fehler anzeigen",
|
"digital-ide.function.lsp.linter.linter-level.error.title": "Nur Fehler anzeigen",
|
||||||
"digital-ide.function.lsp.linter.linter-level.warning.title": "Fehler und Warnungen anzeigen"
|
"digital-ide.function.lsp.linter.linter-level.warning.title": "Fehler und Warnungen anzeigen"
|
||||||
|
@ -94,10 +94,10 @@
|
|||||||
"digital-ide.structure.from-xilinx-to-standard.title": "Xilinx プロジェクトを Digital IDE 標準プロジェクト構造に変換する",
|
"digital-ide.structure.from-xilinx-to-standard.title": "Xilinx プロジェクトを Digital IDE 標準プロジェクト構造に変換する",
|
||||||
"digital-ide.prj.verible.install.path.title": "verible のインストールディレクトリパス。つまり、verible-verilog-syntax 実行ファイルを含むフォルダの絶対パス。指定しない場合、デフォルトで verible-verilog-syntax が診断に使用されます。",
|
"digital-ide.prj.verible.install.path.title": "verible のインストールディレクトリパス。つまり、verible-verilog-syntax 実行ファイルを含むフォルダの絶対パス。指定しない場合、デフォルトで verible-verilog-syntax が診断に使用されます。",
|
||||||
"digital-ide.prj.verilator.install.path.title": "verilator のインストールディレクトリパス。つまり、verilator 実行ファイルを含むフォルダの絶対パス。指定しない場合、デフォルトで verilator が診断に使用されます。",
|
"digital-ide.prj.verilator.install.path.title": "verilator のインストールディレクトリパス。つまり、verilator 実行ファイルを含むフォルダの絶対パス。指定しない場合、デフォルトで verilator が診断に使用されます。",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.title": "リンターの診断モードを指定",
|
"digital-ide.function.lsp.linter.mode.title": "リンターの診断モードを指定",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.0.title": "すべての設計ソースを直接診断し、エラーを報告します。ファイルが開いているかどうかに関係なく。",
|
"digital-ide.function.lsp.linter.mode.0.title": "すべての設計ソースを直接診断し、エラーを報告します。ファイルが開いているかどうかに関係なく。",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.1.title": "単一のファイルが閉じられた場合、対応するエラーが削除され、開いているファイルのみが診断されます。",
|
"digital-ide.function.lsp.linter.mode.1.title": "単一のファイルが閉じられた場合、対応するエラーが削除され、開いているファイルのみが診断されます。",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.2.title": "グローバルに無効化され、プロジェクト全体でプロジェクトエラーが報告されません。",
|
"digital-ide.function.lsp.linter.mode.2.title": "グローバルに無効化され、プロジェクト全体でプロジェクトエラーが報告されません。",
|
||||||
"digital-ide.function.lsp.linter.linter-level.title": "診断器の診断レベル設定",
|
"digital-ide.function.lsp.linter.linter-level.title": "診断器の診断レベル設定",
|
||||||
"digital-ide.function.lsp.linter.linter-level.error.title": "エラーのみ表示",
|
"digital-ide.function.lsp.linter.linter-level.error.title": "エラーのみ表示",
|
||||||
"digital-ide.function.lsp.linter.linter-level.warning.title": "エラーと警告を表示"
|
"digital-ide.function.lsp.linter.linter-level.warning.title": "エラーと警告を表示"
|
||||||
|
@ -94,10 +94,10 @@
|
|||||||
"digital-ide.structure.from-xilinx-to-standard.title": "Convert Xilinx projects to Digital IDE standard project structure",
|
"digital-ide.structure.from-xilinx-to-standard.title": "Convert Xilinx projects to Digital IDE standard project structure",
|
||||||
"digital-ide.prj.verible.install.path.title": "Installation directory path for verible, which is the absolute path of the folder containing the verible-verilog-syntax executable. If not specified, verible-verilog-syntax will be used for diagnostics by default.",
|
"digital-ide.prj.verible.install.path.title": "Installation directory path for verible, which is the absolute path of the folder containing the verible-verilog-syntax executable. If not specified, verible-verilog-syntax will be used for diagnostics by default.",
|
||||||
"digital-ide.prj.verilator.install.path.title": "Installation directory path for verilator, which is the absolute path of the folder containing the verilator executable. If not specified, verilator will be used for diagnostics by default.",
|
"digital-ide.prj.verilator.install.path.title": "Installation directory path for verilator, which is the absolute path of the folder containing the verilator executable. If not specified, verilator will be used for diagnostics by default.",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.title": "Specify the diagnostic mode of the linter",
|
"digital-ide.function.lsp.linter.mode.title": "Specify the diagnostic mode of the linter",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.0.title": "Diagnose all design sources directly and report errors, regardless of whether the files are open.",
|
"digital-ide.function.lsp.linter.mode.0.title": "Diagnose all design sources directly and report errors, regardless of whether the files are open.",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.1.title": "When a single file is closed, the corresponding error is removed, and only the file that is opened is diagnosed.",
|
"digital-ide.function.lsp.linter.mode.1.title": "When a single file is closed, the corresponding error is removed, and only the file that is opened is diagnosed.",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.2.title": "Globally disabled, meaning no project errors are reported for the entire project.",
|
"digital-ide.function.lsp.linter.mode.2.title": "Globally disabled, meaning no project errors are reported for the entire project.",
|
||||||
"digital-ide.function.lsp.linter.linter-level.title": "Diagnostic Level Settings for the Linter",
|
"digital-ide.function.lsp.linter.linter-level.title": "Diagnostic Level Settings for the Linter",
|
||||||
"digital-ide.function.lsp.linter.linter-level.error.title": "Show Only Errors",
|
"digital-ide.function.lsp.linter.linter-level.error.title": "Show Only Errors",
|
||||||
"digital-ide.function.lsp.linter.linter-level.warning.title": "Show Errors and Warnings"
|
"digital-ide.function.lsp.linter.linter-level.warning.title": "Show Errors and Warnings"
|
||||||
|
@ -94,10 +94,10 @@
|
|||||||
"digital-ide.structure.from-xilinx-to-standard.title": "将 Xilinx 项目转换成 Digital IDE 标准项目结构",
|
"digital-ide.structure.from-xilinx-to-standard.title": "将 Xilinx 项目转换成 Digital IDE 标准项目结构",
|
||||||
"digital-ide.prj.verible.install.path.title": "verible 的安装目录路径,也就是包含 verible-verilog-syntax 可执行文件的文件夹的绝对路径。如果不指定,默认采用 verible-verilog-syntax 执行诊断。",
|
"digital-ide.prj.verible.install.path.title": "verible 的安装目录路径,也就是包含 verible-verilog-syntax 可执行文件的文件夹的绝对路径。如果不指定,默认采用 verible-verilog-syntax 执行诊断。",
|
||||||
"digital-ide.prj.verilator.install.path.title": "verilator 的安装目录路径,也就是包含了 verilator 可执行文件的文件夹的绝对路径。不如不指定,默认采用 verilator 执行诊断。",
|
"digital-ide.prj.verilator.install.path.title": "verilator 的安装目录路径,也就是包含了 verilator 可执行文件的文件夹的绝对路径。不如不指定,默认采用 verilator 执行诊断。",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.title": "指定诊断器的诊断模式",
|
"digital-ide.function.lsp.linter.mode.title": "指定诊断器的诊断模式",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.0.title": "将所有设计源直接进行诊断,并报错,无论文件是否打开。",
|
"digital-ide.function.lsp.linter.mode.0.title": "将所有设计源直接进行诊断,并报错,无论文件是否打开。",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.1.title": "单文件关闭时,对应报错去除,打开哪个文件就对哪个文件进行诊断。",
|
"digital-ide.function.lsp.linter.mode.1.title": "单文件关闭时,对应报错去除,打开哪个文件就对哪个文件进行诊断。",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.2.title": "全局关闭,即整个工程都不进行工程报错。",
|
"digital-ide.function.lsp.linter.mode.2.title": "全局关闭,即整个工程都不进行工程报错。",
|
||||||
"digital-ide.function.lsp.linter.linter-level.title": "诊断器诊断等级设置",
|
"digital-ide.function.lsp.linter.linter-level.title": "诊断器诊断等级设置",
|
||||||
"digital-ide.function.lsp.linter.linter-level.error.title": "只显示错误",
|
"digital-ide.function.lsp.linter.linter-level.error.title": "只显示错误",
|
||||||
"digital-ide.function.lsp.linter.linter-level.warning.title": "显示错误和警告"
|
"digital-ide.function.lsp.linter.linter-level.warning.title": "显示错误和警告"
|
||||||
|
@ -94,10 +94,10 @@
|
|||||||
"digital-ide.structure.from-xilinx-to-standard.title": "將 Xilinx 專案轉換成 Digital IDE 標準專案結構",
|
"digital-ide.structure.from-xilinx-to-standard.title": "將 Xilinx 專案轉換成 Digital IDE 標準專案結構",
|
||||||
"digital-ide.prj.verible.install.path.title": "verible 的安裝目錄路徑,也就是包含 verible-verilog-syntax 可執行文件的文件夾的絕對路徑。如果不指定,默認採用 verible-verilog-syntax 執行診斷。",
|
"digital-ide.prj.verible.install.path.title": "verible 的安裝目錄路徑,也就是包含 verible-verilog-syntax 可執行文件的文件夾的絕對路徑。如果不指定,默認採用 verible-verilog-syntax 執行診斷。",
|
||||||
"digital-ide.prj.verilator.install.path.title": "verilator 的安裝目錄路徑,也就是包含了 verilator 可執行文件的文件夾的絕對路徑。不如不指定,默認採用 verilator 執行診斷。",
|
"digital-ide.prj.verilator.install.path.title": "verilator 的安裝目錄路徑,也就是包含了 verilator 可執行文件的文件夾的絕對路徑。不如不指定,默認採用 verilator 執行診斷。",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.title": "指定診斷器的診斷模式",
|
"digital-ide.function.lsp.linter.mode.title": "指定診斷器的診斷模式",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.0.title": "將所有設計源直接進行診斷,並報錯,無論文件是否打開。",
|
"digital-ide.function.lsp.linter.mode.0.title": "將所有設計源直接進行診斷,並報錯,無論文件是否打開。",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.1.title": "單文件關閉時,對應報錯去除,打開哪個文件就對哪個文件進行診斷。",
|
"digital-ide.function.lsp.linter.mode.1.title": "單文件關閉時,對應報錯去除,打開哪個文件就對哪個文件進行診斷。",
|
||||||
"digital-ide.function.lsp.linter.linter-mode.2.title": "全局關閉,即整個工程都不進行工程報錯。",
|
"digital-ide.function.lsp.linter.mode.2.title": "全局關閉,即整個工程都不進行工程報錯。",
|
||||||
"digital-ide.function.lsp.linter.linter-level.title": "診斷器診斷等級設置",
|
"digital-ide.function.lsp.linter.linter-level.title": "診斷器診斷等級設置",
|
||||||
"digital-ide.function.lsp.linter.linter-level.error.title": "只顯示錯誤",
|
"digital-ide.function.lsp.linter.linter-level.error.title": "只顯示錯誤",
|
||||||
"digital-ide.function.lsp.linter.linter-level.warning.title": "顯示錯誤和警告"
|
"digital-ide.function.lsp.linter.linter-level.warning.title": "顯示錯誤和警告"
|
||||||
|
Binary file not shown.
@ -581,14 +581,6 @@
|
|||||||
"description":"interface name; ... endinterface"
|
"description":"interface name; ... endinterface"
|
||||||
},
|
},
|
||||||
|
|
||||||
"display":{
|
|
||||||
"prefix":"display",
|
|
||||||
"body":[
|
|
||||||
"\\$display($0);"
|
|
||||||
],
|
|
||||||
"description":"$display(\"...\", params...)"
|
|
||||||
},
|
|
||||||
|
|
||||||
"set Module":{
|
"set Module":{
|
||||||
"prefix":"setmodule",
|
"prefix":"setmodule",
|
||||||
"body":[
|
"body":[
|
||||||
@ -663,22 +655,6 @@
|
|||||||
"description": "forever begin ... end"
|
"description": "forever begin ... end"
|
||||||
},
|
},
|
||||||
|
|
||||||
"write":{
|
|
||||||
"prefix": "$write",
|
|
||||||
"body": [
|
|
||||||
"\\$write($1)"
|
|
||||||
],
|
|
||||||
"description": ""
|
|
||||||
},
|
|
||||||
|
|
||||||
"clog2":{
|
|
||||||
"prefix": "$clog2",
|
|
||||||
"body": [
|
|
||||||
"\\$clog2($1)"
|
|
||||||
],
|
|
||||||
"description": ""
|
|
||||||
},
|
|
||||||
|
|
||||||
"signed":{
|
"signed":{
|
||||||
"prefix": "$signed",
|
"prefix": "$signed",
|
||||||
"body": [
|
"body": [
|
||||||
@ -695,14 +671,6 @@
|
|||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
|
||||||
"random" : {
|
|
||||||
"prefix": "$random",
|
|
||||||
"body": [
|
|
||||||
"\\$random($1)"
|
|
||||||
],
|
|
||||||
"description": ""
|
|
||||||
},
|
|
||||||
|
|
||||||
"wavedrom comment": {
|
"wavedrom comment": {
|
||||||
"prefix" : "wavedrom",
|
"prefix" : "wavedrom",
|
||||||
"body": [
|
"body": [
|
||||||
@ -712,26 +680,5 @@
|
|||||||
"}",
|
"}",
|
||||||
"*/"
|
"*/"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
|
|
||||||
"dumpfile": {
|
|
||||||
"prefix": "$dumpfile",
|
|
||||||
"body": [
|
|
||||||
"\\$dumpfile(\"$1\");"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
"dumpvars": {
|
|
||||||
"prefix": "$dumpvars",
|
|
||||||
"body": [
|
|
||||||
"\\$dumpvars;"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
"finish": {
|
|
||||||
"prefix": "$finish",
|
|
||||||
"body": [
|
|
||||||
"\\$finish;"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -42,6 +42,12 @@ function getArrowSvgString(name: 'left' | 'right' | 'left-right' | 'left-dot' |
|
|||||||
return svgString;
|
return svgString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 生成文档化中用于描述一个 module 的简易 diagram
|
||||||
|
* @param params
|
||||||
|
* @param ports
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
function makeDiagram(params: HdlModuleParam[], ports: HdlModulePort[]): string {
|
function makeDiagram(params: HdlModuleParam[], ports: HdlModulePort[]): string {
|
||||||
// make params block
|
// make params block
|
||||||
const diagramParamWrapper = makeDiagramParamWrapper(params);
|
const diagramParamWrapper = makeDiagramParamWrapper(params);
|
||||||
@ -77,8 +83,15 @@ function makeDiagramPortWrapper(ports: HdlModulePort[]): string {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
const leftPorts = ports.filter(port => port.type === HdlModulePortType.Input || port.type === HdlModulePortType.Inout);
|
const leftPorts = ports.filter(port =>
|
||||||
const rightPorts = ports.filter(port => port.type === HdlModulePortType.Output);
|
port.type === HdlModulePortType.Input ||
|
||||||
|
port.type === HdlModulePortType.Inout ||
|
||||||
|
port.type === HdlModulePortType.VhdlInput
|
||||||
|
);
|
||||||
|
const rightPorts = ports.filter(port =>
|
||||||
|
port.type === HdlModulePortType.Output ||
|
||||||
|
port.type === HdlModulePortType.VhdlOutput
|
||||||
|
);
|
||||||
|
|
||||||
const leftDirection = makeLeftDirection(leftPorts);
|
const leftDirection = makeLeftDirection(leftPorts);
|
||||||
const diagramPorts = makeDiagramPorts(leftPorts, rightPorts);
|
const diagramPorts = makeDiagramPorts(leftPorts, rightPorts);
|
||||||
@ -107,13 +120,13 @@ function makePortArrow(port: HdlModulePort, direction: 'left' | 'right'): string
|
|||||||
return getArrowSvgString('left-right');
|
return getArrowSvgString('left-right');
|
||||||
}
|
}
|
||||||
if (direction === 'left') {
|
if (direction === 'left') {
|
||||||
if (port.type === HdlModulePortType.Input) {
|
if (port.type === HdlModulePortType.Input || port.type === HdlModulePortType.VhdlInput) {
|
||||||
if (isValidWidth(port.width)) {
|
if (isValidWidth(port.width)) {
|
||||||
return getArrowSvgString('right-dot');
|
return getArrowSvgString('right-dot');
|
||||||
} else {
|
} else {
|
||||||
return getArrowSvgString('right');
|
return getArrowSvgString('right');
|
||||||
}
|
}
|
||||||
} else if (port.type === HdlModulePortType.Output) {
|
} else if (port.type === HdlModulePortType.Output || port.type === HdlModulePortType.VhdlOutput) {
|
||||||
if (isValidWidth(port.width)) {
|
if (isValidWidth(port.width)) {
|
||||||
return getArrowSvgString('left-dot');
|
return getArrowSvgString('left-dot');
|
||||||
} else {
|
} else {
|
||||||
@ -121,13 +134,13 @@ function makePortArrow(port: HdlModulePort, direction: 'left' | 'right'): string
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (direction === 'right') {
|
} else if (direction === 'right') {
|
||||||
if (port.type === HdlModulePortType.Input) {
|
if (port.type === HdlModulePortType.Input || port.type === HdlModulePortType.VhdlInput) {
|
||||||
if (isValidWidth(port.width)) {
|
if (isValidWidth(port.width)) {
|
||||||
return getArrowSvgString('left-dot');
|
return getArrowSvgString('left-dot');
|
||||||
} else {
|
} else {
|
||||||
return getArrowSvgString('left');
|
return getArrowSvgString('left');
|
||||||
}
|
}
|
||||||
} else if (port.type === HdlModulePortType.Output) {
|
} else if (port.type === HdlModulePortType.Output || port.type === HdlModulePortType.VhdlOutput) {
|
||||||
if (isValidWidth(port.width)) {
|
if (isValidWidth(port.width)) {
|
||||||
return getArrowSvgString('right-dot');
|
return getArrowSvgString('right-dot');
|
||||||
} else {
|
} else {
|
||||||
@ -151,9 +164,9 @@ function makeLeftDirection(leftPorts: HdlModulePort[]): string {
|
|||||||
|
|
||||||
function makePortName(port: HdlModulePort): string {
|
function makePortName(port: HdlModulePort): string {
|
||||||
let portClass = '';
|
let portClass = '';
|
||||||
if (port.type === HdlModulePortType.Input) {
|
if (port.type === HdlModulePortType.Input || port.type === HdlModulePortType.VhdlInput) {
|
||||||
portClass = 'i-port-name';
|
portClass = 'i-port-name';
|
||||||
} else if (port.type === HdlModulePortType.Output) {
|
} else if (port.type === HdlModulePortType.Output || port.type === HdlModulePortType.VhdlOutput) {
|
||||||
portClass = 'o-port-name';
|
portClass = 'o-port-name';
|
||||||
} else {
|
} else {
|
||||||
portClass = 'io-port-name';
|
portClass = 'io-port-name';
|
||||||
|
@ -254,6 +254,8 @@ async function getDocsFromModule(module: HdlModule): Promise<MarkdownString> {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
// 对于多文件,找出所有依赖项
|
// 对于多文件,找出所有依赖项
|
||||||
|
console.log(module);
|
||||||
|
|
||||||
insts = [...module.getAllDependenceInstance()];
|
insts = [...module.getAllDependenceInstance()];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,6 +130,7 @@ export async function registerConfigurationUpdater(client: LanguageClient, packa
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 如果诊断模式发生变化,进行一次刷新
|
// 如果诊断模式发生变化,进行一次刷新
|
||||||
|
if (event.affectsConfiguration(Linter.getLinterModeConfigurationName())) {
|
||||||
await vscode.window.withProgress({
|
await vscode.window.withProgress({
|
||||||
location: vscode.ProgressLocation.Window,
|
location: vscode.ProgressLocation.Window,
|
||||||
title: t('info.progress.doing-diagnostic')
|
title: t('info.progress.doing-diagnostic')
|
||||||
@ -137,6 +138,7 @@ export async function registerConfigurationUpdater(client: LanguageClient, packa
|
|||||||
const hdlFiles = await prjManage.getPrjHardwareFiles();
|
const hdlFiles = await prjManage.getPrjHardwareFiles();
|
||||||
await refreshWorkspaceDiagonastics(client, hdlFiles, false, progress);
|
await refreshWorkspaceDiagonastics(client, hdlFiles, false, progress);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +51,10 @@ export function getLinterInstallConfigurationName(linterName: SupportLinterName)
|
|||||||
return `digital-ide.prj.${linterName}.install.path`;
|
return `digital-ide.prj.${linterName}.install.path`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getLinterModeConfigurationName(): string {
|
||||||
|
return 'digital-ide.function.lsp.linter.mode';
|
||||||
|
}
|
||||||
|
|
||||||
export function getLinterInstallPath(linterName: SupportLinterName): string {
|
export function getLinterInstallPath(linterName: SupportLinterName): string {
|
||||||
const configuration = vscode.workspace.getConfiguration();
|
const configuration = vscode.workspace.getConfiguration();
|
||||||
const linterInstallConfigurationName = getLinterInstallConfigurationName(linterName);
|
const linterInstallConfigurationName = getLinterInstallConfigurationName(linterName);
|
||||||
@ -117,7 +121,7 @@ export enum LinterMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getLinterMode(): LinterMode {
|
export function getLinterMode(): LinterMode {
|
||||||
return vscode.workspace.getConfiguration().get<LinterMode>('digital-ide.function.lsp.linter.linter-mode', LinterMode.Full);
|
return vscode.workspace.getConfiguration().get<LinterMode>('digital-ide.function.lsp.linter.mode') || LinterMode.Common;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IConfigReminder {
|
export interface IConfigReminder {
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
|
|
||||||
import { LspClient, LinterOutput, ReportType, AbsPath, IProgress } from '../../../global';
|
import { LinterOutput, ReportType, AbsPath, IProgress } from '../../../global';
|
||||||
import { HdlLangID } from '../../../global/enum';
|
import { HdlLangID } from '../../../global/enum';
|
||||||
import { hdlFile, hdlPath } from '../../../hdlFs';
|
import { hdlFile, hdlPath } from '../../../hdlFs';
|
||||||
import { t } from '../../../i18n';
|
import { t } from '../../../i18n';
|
||||||
import { getLinterConfigurationName, getLinterInstallConfigurationName, getLinterName, IConfigReminder, LinterItem, LinterMode, makeLinterNamePickItem, makeLinterOptions, SupportLinterName, updateLinterConfigurationName } from './common';
|
import { getLinterConfigurationName, getLinterInstallConfigurationName, getLinterMode, getLinterName, IConfigReminder, LinterItem, LinterMode, makeLinterNamePickItem, makeLinterOptions, SupportLinterName, updateLinterConfigurationName } from './common';
|
||||||
import { UpdateConfigurationType } from '../../../global/lsp';
|
import { UpdateConfigurationType } from '../../../global/lsp';
|
||||||
import { LanguageClient } from 'vscode-languageclient/node';
|
import { LanguageClient } from 'vscode-languageclient/node';
|
||||||
import { toEscapePath } from '../../../hdlFs/path';
|
|
||||||
|
|
||||||
export class LinterManager {
|
export class LinterManager {
|
||||||
/**
|
/**
|
||||||
@ -318,22 +317,23 @@ export async function refreshWorkspaceDiagonastics(
|
|||||||
progress: vscode.Progress<IProgress>
|
progress: vscode.Progress<IProgress>
|
||||||
) {
|
) {
|
||||||
const parallelChunk = Math.min(os.cpus().length, 32);
|
const parallelChunk = Math.min(os.cpus().length, 32);
|
||||||
const configuration = vscode.workspace.getConfiguration();
|
const linterMode = getLinterMode();
|
||||||
const linterMode = configuration.get<LinterMode>('digital-ide.function.lsp.linter.linter-mode', LinterMode.Common);
|
|
||||||
|
|
||||||
if (linterMode === LinterMode.Full) {
|
if (linterMode === LinterMode.Full) {
|
||||||
// full,对工作区所有文件进行诊断
|
// full,对工作区所有文件进行诊断
|
||||||
const consumer = async (path: string) => {
|
const consumer = async (path: string) => {
|
||||||
await publishDiagnostics(client, path);
|
await publishDiagnostics(client, path);
|
||||||
}
|
}
|
||||||
await asyncConsumer(lintPaths, consumer, parallelChunk);
|
await asyncConsumer(lintPaths, consumer, parallelChunk, progress);
|
||||||
} else if (linterMode === LinterMode.Common) {
|
} else if (linterMode === LinterMode.Common) {
|
||||||
// common, 只对打开文件进行操作
|
// common, 只对打开文件进行操作
|
||||||
|
if (!isInitialise) {
|
||||||
// 先清除所有的诊断结果
|
// 先清除所有的诊断结果
|
||||||
const clearConsumer = async (path: string) => {
|
const clearConsumer = async (path: string) => {
|
||||||
await clearDiagnostics(client, path);
|
await clearDiagnostics(client, path);
|
||||||
}
|
}
|
||||||
await asyncConsumer(lintPaths, clearConsumer, parallelChunk);
|
await asyncConsumer(lintPaths, clearConsumer, parallelChunk);
|
||||||
|
}
|
||||||
|
|
||||||
// 再对激活区域进行诊断
|
// 再对激活区域进行诊断
|
||||||
const consumer = async (path: string) => {
|
const consumer = async (path: string) => {
|
||||||
@ -355,14 +355,14 @@ export async function refreshWorkspaceDiagonastics(
|
|||||||
return files;
|
return files;
|
||||||
});
|
});
|
||||||
|
|
||||||
await asyncConsumer(tabArray, consumer, parallelChunk);
|
await asyncConsumer(tabArray, consumer, parallelChunk, progress);
|
||||||
} else {
|
} else {
|
||||||
|
if (!isInitialise) {
|
||||||
// shutdown, 如果是初始化阶段,什么都不需要做
|
// shutdown, 如果是初始化阶段,什么都不需要做
|
||||||
const consumer = async (path: string) => {
|
const consumer = async (path: string) => {
|
||||||
await clearDiagnostics(client, path);
|
await clearDiagnostics(client, path);
|
||||||
};
|
};
|
||||||
if (!isInitialise) {
|
await asyncConsumer(lintPaths, consumer, parallelChunk, progress);
|
||||||
await asyncConsumer(lintPaths, consumer, parallelChunk);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ class ModuleTreeProvider implements vscode.TreeDataProvider<ModuleDataItem> {
|
|||||||
// set tooltip
|
// set tooltip
|
||||||
treeItem.tooltip = element.path;
|
treeItem.tooltip = element.path;
|
||||||
if (!treeItem.tooltip) {
|
if (!treeItem.tooltip) {
|
||||||
treeItem.tooltip = t('info.treeview.item.tooltip');
|
treeItem.tooltip = 'src';
|
||||||
}
|
}
|
||||||
|
|
||||||
// set iconPath
|
// set iconPath
|
||||||
@ -201,10 +201,10 @@ class ModuleTreeProvider implements vscode.TreeDataProvider<ModuleDataItem> {
|
|||||||
const type = moduleType as keyof FirstTop;
|
const type = moduleType as keyof FirstTop;
|
||||||
|
|
||||||
// 默认选择依赖模块最多的作为 first top
|
// 默认选择依赖模块最多的作为 first top
|
||||||
let firstTop: { path: string, name: string } | undefined = undefined;
|
let firstTop = this.firstTop[type];
|
||||||
|
|
||||||
|
if (!firstTop) {
|
||||||
let maxDepSize = 0;
|
let maxDepSize = 0;
|
||||||
|
|
||||||
|
|
||||||
for (const hdlModule of topModules) {
|
for (const hdlModule of topModules) {
|
||||||
// 此处断言是因为当前的 name 和 path 是从 topModules 中提取的
|
// 此处断言是因为当前的 name 和 path 是从 topModules 中提取的
|
||||||
// 它们对应的 hdlModule 一定存在
|
// 它们对应的 hdlModule 一定存在
|
||||||
@ -216,15 +216,18 @@ class ModuleTreeProvider implements vscode.TreeDataProvider<ModuleDataItem> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstTop === undefined) {
|
if (firstTop) {
|
||||||
|
// 将当前模块设置为 first top
|
||||||
|
this.setFirstTop(type, firstTop.name, firstTop.path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!firstTop) {
|
||||||
// 没有找到顶层模块,代表当前本来就是空的
|
// 没有找到顶层模块,代表当前本来就是空的
|
||||||
// 此时 topModuleItemList 一定是 []
|
// 此时 topModuleItemList 一定是 []
|
||||||
return topModuleItemList;
|
return topModuleItemList;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将当前模块设置为 first top
|
|
||||||
this.setFirstTop(type, firstTop.name, firstTop.path);
|
|
||||||
|
|
||||||
// 将 first top 放到数据列表开头
|
// 将 first top 放到数据列表开头
|
||||||
const firstTopIcon = this.makeFirstTopIconName(type);
|
const firstTopIcon = this.makeFirstTopIconName(type);
|
||||||
|
|
||||||
|
@ -27,6 +27,8 @@ enum HdlModulePortType {
|
|||||||
Inout = 'inout',
|
Inout = 'inout',
|
||||||
Output = 'output',
|
Output = 'output',
|
||||||
Input = 'input',
|
Input = 'input',
|
||||||
|
VhdlInput = 'in',
|
||||||
|
VhdlOutput = 'out',
|
||||||
Unknown = 'unknown'
|
Unknown = 'unknown'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -247,6 +247,11 @@ class HdlParam {
|
|||||||
for (const inst of this.unhandleInstances) {
|
for (const inst of this.unhandleInstances) {
|
||||||
if (inst.type === moduleName) {
|
if (inst.type === moduleName) {
|
||||||
unsolvedInstances.push(inst);
|
unsolvedInstances.push(inst);
|
||||||
|
} else if (inst.type.includes('(')) {
|
||||||
|
const entityName = moduleName.split('(')[0];
|
||||||
|
if (entityName === moduleName) {
|
||||||
|
unsolvedInstances.push(inst);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return unsolvedInstances;
|
return unsolvedInstances;
|
||||||
@ -471,7 +476,6 @@ class HdlParam {
|
|||||||
|
|
||||||
public updateFast(path: string, fast: common.Fast) {
|
public updateFast(path: string, fast: common.Fast) {
|
||||||
const moduleFile = this.getHdlFile(path);
|
const moduleFile = this.getHdlFile(path);
|
||||||
|
|
||||||
if (moduleFile === undefined) {
|
if (moduleFile === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -867,8 +871,8 @@ class HdlModule {
|
|||||||
// 获取自身的
|
// 获取自身的
|
||||||
for (const inst of this.nameToInstances.values()) {
|
for (const inst of this.nameToInstances.values()) {
|
||||||
instances.add(inst);
|
instances.add(inst);
|
||||||
// 递归获取 inst 的
|
// 递归获取 inst 的,防止无限递归
|
||||||
if (inst.module) {
|
if (inst.module && inst.module !== this) {
|
||||||
for (const subInst of inst.module.getAllDependenceInstance()) {
|
for (const subInst of inst.module.getAllDependenceInstance()) {
|
||||||
instances.add(subInst);
|
instances.add(subInst);
|
||||||
}
|
}
|
||||||
@ -890,7 +894,7 @@ class HdlModule {
|
|||||||
rawHdlInstance.instports,
|
rawHdlInstance.instports,
|
||||||
rawHdlInstance.range,
|
rawHdlInstance.range,
|
||||||
this);
|
this);
|
||||||
if (!searchResult.path) {
|
if (!searchResult.path || !hdlPath.exist(searchResult.path)) {
|
||||||
hdlParam.addUnhandleInstance(hdlInstance);
|
hdlParam.addUnhandleInstance(hdlInstance);
|
||||||
this.addUnhandleInstance(hdlInstance);
|
this.addUnhandleInstance(hdlInstance);
|
||||||
}
|
}
|
||||||
@ -910,8 +914,9 @@ class HdlModule {
|
|||||||
rawHdlInstance.range,
|
rawHdlInstance.range,
|
||||||
this);
|
this);
|
||||||
|
|
||||||
if (hdlInstance.module === undefined) {
|
if (!searchResult.path || !hdlPath.exist(searchResult.path)) {
|
||||||
hdlInstance.module = this;
|
hdlParam.addUnhandleInstance(hdlInstance);
|
||||||
|
this.addUnhandleInstance(hdlInstance);
|
||||||
}
|
}
|
||||||
if (this.nameToInstances) {
|
if (this.nameToInstances) {
|
||||||
const key = this.makeInstanceKey(rawHdlInstance.name, rawHdlInstance.type);
|
const key = this.makeInstanceKey(rawHdlInstance.name, rawHdlInstance.type);
|
||||||
@ -1152,7 +1157,6 @@ export class HdlFile {
|
|||||||
|
|
||||||
// make nameToModule
|
// make nameToModule
|
||||||
this.nameToModule = new Map<string, HdlModule>();
|
this.nameToModule = new Map<string, HdlModule>();
|
||||||
|
|
||||||
for (const rawHdlModule of modules) {
|
for (const rawHdlModule of modules) {
|
||||||
this.createHdlModule(rawHdlModule);
|
this.createHdlModule(rawHdlModule);
|
||||||
}
|
}
|
||||||
|
@ -105,6 +105,7 @@ class PlManage extends BaseManage {
|
|||||||
public setSrcTop(item: ModuleDataItem) {
|
public setSrcTop(item: ModuleDataItem) {
|
||||||
this.context.ope.setSrcTop(item.name, this.context);
|
this.context.ope.setSrcTop(item.name, this.context);
|
||||||
const type = moduleTreeProvider.getItemType(item);
|
const type = moduleTreeProvider.getItemType(item);
|
||||||
|
|
||||||
if (type === HdlFileProjectType.Src) {
|
if (type === HdlFileProjectType.Src) {
|
||||||
moduleTreeProvider.setFirstTop(HdlFileProjectType.Src, item.name, item.path);
|
moduleTreeProvider.setFirstTop(HdlFileProjectType.Src, item.name, item.path);
|
||||||
moduleTreeProvider.refreshSrc();
|
moduleTreeProvider.refreshSrc();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user