From f20edcfff808eeb3ee1ea0ecf11bab4af8f067da Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Thu, 9 Jan 2025 17:47:29 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n/bundle.l10n.de.json | 5 +++- l10n/bundle.l10n.en.json | 5 +++- l10n/bundle.l10n.ja.json | 5 +++- l10n/bundle.l10n.zh-cn.json | 5 +++- l10n/bundle.l10n.zh-tw.json | 5 +++- package.json | 5 ++++ package.nls.de.json | 3 ++- package.nls.ja.json | 3 ++- package.nls.json | 3 ++- package.nls.zh-cn.json | 3 ++- package.nls.zh-tw.json | 3 ++- src/function/index.ts | 9 ++++++- src/function/lsp-client/cdn.ts | 9 +++++-- src/function/lsp-client/index.ts | 46 ++++++++++++++++++++++++++++++-- update.bat | 2 ++ 15 files changed, 96 insertions(+), 15 deletions(-) create mode 100644 update.bat diff --git a/l10n/bundle.l10n.de.json b/l10n/bundle.l10n.de.json index a53a58d..0973b84 100644 --- a/l10n/bundle.l10n.de.json +++ b/l10n/bundle.l10n.de.json @@ -117,5 +117,8 @@ "info.addDevice.add-success": "Gerät {0} wurde erfolgreich hinzugefügt", "info.delDevice.placeholder": "Wählen Sie das zu löschende Gerät aus", "info.delDevice.del-success": "Gerät {0} wurde erfolgreich gelöscht", - "info.progress.launch-lsp": "Starten Sie den Digital LSP-Sprachserver" + "info.progress.launch-lsp": "Starten Sie den Digital LSP-Sprachserver", + "info.choose.digital-lsp-targz": "Wählen Sie das Digital LSP-Archiv aus", + "info.digital-lsp.targz": "Digitales LSP-Paket", + "error.digital-lsp.incorrect-filename": "Die von Ihnen bereitgestellte Digital-LSP-Archivdatei {0} entspricht nicht der aktuellen Systemarchitektur. Bitte laden Sie die Archivdatei mit dem Namen {1} herunter!" } \ No newline at end of file diff --git a/l10n/bundle.l10n.en.json b/l10n/bundle.l10n.en.json index 60fdbf4..4fe28b0 100644 --- a/l10n/bundle.l10n.en.json +++ b/l10n/bundle.l10n.en.json @@ -117,5 +117,8 @@ "info.addDevice.add-success": "Device {0} has been successfully added", "info.delDevice.placeholder": "Select the device to delete", "info.delDevice.del-success": "Device {0} has been successfully deleted", - "info.progress.launch-lsp": "Start the Digital LSP language server" + "info.progress.launch-lsp": "Start the Digital LSP language server", + "info.choose.digital-lsp-targz": "Select the Digital LSP archive", + "info.digital-lsp.targz": "Digital LSP Package", + "error.digital-lsp.incorrect-filename": "The digital LSP archive file {0} you provided does not match the current system architecture. Please download the archive file named {1}!" } \ No newline at end of file diff --git a/l10n/bundle.l10n.ja.json b/l10n/bundle.l10n.ja.json index 0143285..70ff430 100644 --- a/l10n/bundle.l10n.ja.json +++ b/l10n/bundle.l10n.ja.json @@ -117,5 +117,8 @@ "info.addDevice.add-success": "デバイス {0} が正常に追加されました", "info.delDevice.placeholder": "削除するデバイスを選択してください", "info.delDevice.del-success": "デバイス {0} は正常に削除されました", - "info.progress.launch-lsp": "Digital LSP 言語サーバーを起動する" + "info.progress.launch-lsp": "Digital LSP 言語サーバーを起動する", + "info.choose.digital-lsp-targz": "Digital LSPのアーカイブを選択してください", + "info.digital-lsp.targz": "デジタルLSPパッケージ", + "error.digital-lsp.incorrect-filename": "提供されたデジタルLSPアーカイブファイル{0}は、現在のシステムアーキテクチャに適合していません。{1}という名前のアーカイブファイルをダウンロードしてください!" } \ No newline at end of file diff --git a/l10n/bundle.l10n.zh-cn.json b/l10n/bundle.l10n.zh-cn.json index a9bd5f7..bb3d0e0 100644 --- a/l10n/bundle.l10n.zh-cn.json +++ b/l10n/bundle.l10n.zh-cn.json @@ -117,5 +117,8 @@ "info.addDevice.add-success": "device {0} 已被成功添加", "info.delDevice.placeholder": "选择需要删除的 device", "info.delDevice.del-success": "device {0} 已被成功删除", - "info.progress.launch-lsp": "启动 Digital LSP 语言服务器" + "info.progress.launch-lsp": "启动 Digital LSP 语言服务器", + "info.choose.digital-lsp-targz": "选择 Digital LSP 的压缩包", + "info.digital-lsp.targz": "Digital LSP 压缩包", + "error.digital-lsp.incorrect-filename": "您提供的 digital lsp 压缩包文件 {0} 并不是一个符合当前系统架构的,请下载名为 {1} 的压缩包文件!" } \ No newline at end of file diff --git a/l10n/bundle.l10n.zh-tw.json b/l10n/bundle.l10n.zh-tw.json index da35311..7c81f56 100644 --- a/l10n/bundle.l10n.zh-tw.json +++ b/l10n/bundle.l10n.zh-tw.json @@ -117,5 +117,8 @@ "info.addDevice.add-success": "設備 {0} 已成功添加", "info.delDevice.placeholder": "選擇需要刪除的設備", "info.delDevice.del-success": "設備 {0} 已被成功刪除", - "info.progress.launch-lsp": "啟動 Digital LSP 語言伺服器" + "info.progress.launch-lsp": "啟動 Digital LSP 語言伺服器", + "info.choose.digital-lsp-targz": "選擇 Digital LSP 的壓縮包", + "info.digital-lsp.targz": "數位LSP壓縮包", + "error.digital-lsp.incorrect-filename": "您提供的 digital lsp 壓縮包文件 {0} 並不是一個符合當前系統架構的,請下載名為 {1} 的壓縮包文件!" } \ No newline at end of file diff --git a/package.json b/package.json index 8381721..0fd74bf 100644 --- a/package.json +++ b/package.json @@ -608,6 +608,11 @@ "category": "Digital-IDE", "title": "%digital-ide.digital-lsp.download.title%" }, + { + "command": "digital-ide.digital-lsp.install", + "category": "Digital-IDE", + "title": "%digital-ide.digital-lsp.install.title%" + }, { "command": "digital-ide.vhdl2vlog", "title": "%digital-ide.vhdl2vlog.title%", diff --git a/package.nls.de.json b/package.nls.de.json index f3e4836..d409ce5 100644 --- a/package.nls.de.json +++ b/package.nls.de.json @@ -105,5 +105,6 @@ "digital-ide.function.netlist.schema-mode.0.title": "Prä-Verhaltenssynthese", "digital-ide.function.netlist.schema-mode.1.title": "Post-Verhaltenssynthese", "digital-ide.function.netlist.schema-mode.2.title": "Post-RTL-Synthese", - "digital-ide.run-ys.title": "yosys-Skript ausführen" + "digital-ide.run-ys.title": "yosys-Skript ausführen", + "digital-ide.digital-lsp.install.title": "Digital LSP-Sprachserver installieren" } \ No newline at end of file diff --git a/package.nls.ja.json b/package.nls.ja.json index af24420..10447dc 100644 --- a/package.nls.ja.json +++ b/package.nls.ja.json @@ -105,5 +105,6 @@ "digital-ide.function.netlist.schema-mode.0.title": "ビヘイビア前合成", "digital-ide.function.netlist.schema-mode.1.title": "ビヘイビア後合成", "digital-ide.function.netlist.schema-mode.2.title": "RTL後合成", - "digital-ide.run-ys.title": "yosys スクリプトを実行" + "digital-ide.run-ys.title": "yosys スクリプトを実行", + "digital-ide.digital-lsp.install.title": "Digital LSP 言語サーバーをインストール" } \ No newline at end of file diff --git a/package.nls.json b/package.nls.json index ea49a91..fbbfa89 100644 --- a/package.nls.json +++ b/package.nls.json @@ -105,5 +105,6 @@ "digital-ide.function.netlist.schema-mode.0.title": "Pre-Behavioral Synthesis", "digital-ide.function.netlist.schema-mode.1.title": "Post-Behavioral Synthesis", "digital-ide.function.netlist.schema-mode.2.title": "Post-RTL Synthesis", - "digital-ide.run-ys.title": "Run yosys script" + "digital-ide.run-ys.title": "Run yosys script", + "digital-ide.digital-lsp.install.title": "Install Digital LSP Language Server" } \ No newline at end of file diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index 260745e..a9f64dd 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -105,5 +105,6 @@ "digital-ide.function.netlist.schema-mode.0.title": "行为前综合", "digital-ide.function.netlist.schema-mode.1.title": "行为后综合", "digital-ide.function.netlist.schema-mode.2.title": "RTL后综合", - "digital-ide.run-ys.title": "运行 yosys 脚本" + "digital-ide.run-ys.title": "运行 yosys 脚本", + "digital-ide.digital-lsp.install.title": "安装 Digital LSP 语言服务器" } \ No newline at end of file diff --git a/package.nls.zh-tw.json b/package.nls.zh-tw.json index 341b940..8d662ca 100644 --- a/package.nls.zh-tw.json +++ b/package.nls.zh-tw.json @@ -105,5 +105,6 @@ "digital-ide.function.netlist.schema-mode.0.title": "行為前綜合", "digital-ide.function.netlist.schema-mode.1.title": "行為後綜合", "digital-ide.function.netlist.schema-mode.2.title": "RTL後綜合", - "digital-ide.run-ys.title": "運行 yosys 腳本" + "digital-ide.run-ys.title": "運行 yosys 腳本", + "digital-ide.digital-lsp.install.title": "安裝 Digital LSP 語言伺服器" } \ No newline at end of file diff --git a/src/function/index.ts b/src/function/index.ts index 0ba61db..ec70de7 100644 --- a/src/function/index.ts +++ b/src/function/index.ts @@ -16,7 +16,7 @@ import * as FSM from './fsm'; import * as Netlist from './dide-netlist'; import * as WaveView from './dide-viewer'; import { ModuleDataItem } from './treeView/tree'; -import { downloadLsp } from './lsp-client'; +import { downloadLsp, installLsp } from './lsp-client'; import { hdlPath } from '../hdlFs'; function registerDocumentation(context: vscode.ExtensionContext) { @@ -101,6 +101,13 @@ function registerLsp(context: vscode.ExtensionContext, version: string) { downloadLsp(context, version, versionFolderPath) }); + vscode.commands.registerCommand('digital-ide.digital-lsp.install', () => { + const versionFolderPath = context.asAbsolutePath( + path.join('resources', 'dide-lsp', 'server', version) + ); + installLsp(context, version, versionFolderPath); + }); + const vlogSelector: vscode.DocumentSelector = {scheme: 'file', language: 'verilog'}; const svlogSelector: vscode.DocumentSelector = {scheme: 'file', language: 'systemverilog'}; const vhdlSelector: vscode.DocumentSelector = {scheme: 'file', language: 'vhdl'}; diff --git a/src/function/lsp-client/cdn.ts b/src/function/lsp-client/cdn.ts index a5bfe15..b35c8c5 100644 --- a/src/function/lsp-client/cdn.ts +++ b/src/function/lsp-client/cdn.ts @@ -1,16 +1,21 @@ import axios from 'axios'; import { performance } from 'perf_hooks'; +export function getLspFileName(version: string, signature: string) { + return `digital-lsp_${version}_${signature}.tar.gz`; +} // const link1 = 'https://gitee.com/Digital-IDE/Digital-IDE/releases/download/0.4.0/digital-lsp_0.4.0_darwin_aarch64.tar.gz'; // const link2 = 'https://github.com/Digital-EDA/Digital-IDE/releases/download/0.4.0/digital-lsp_0.4.0_darwin_aarch64.tar.gz'; export function getGithubDownloadLink(signature: string, version: string): string { - return `https://github.com/Digital-EDA/Digital-IDE/releases/download/${version}/digital-lsp_${version}_${signature}.tar.gz`; + const filename = getLspFileName(version, signature); + return `https://github.com/Digital-EDA/Digital-IDE/releases/download/${version}/${filename}`; } export function getGiteeDownloadLink(signature: string, version: string): string { - return `https://gitee.com/Digital-IDE/Digital-IDE/releases/download/${version}/digital-lsp_${version}_${signature}.tar.gz`; + const filename = getLspFileName(version, signature); + return `https://gitee.com/Digital-IDE/Digital-IDE/releases/download/${version}/${filename}`; } function measureRequestTimecost(url: string, timeout: number = 5): Promise { diff --git a/src/function/lsp-client/index.ts b/src/function/lsp-client/index.ts index 30f7812..4f1e314 100644 --- a/src/function/lsp-client/index.ts +++ b/src/function/lsp-client/index.ts @@ -13,7 +13,7 @@ import * as tar from 'tar'; import { platform } from "os"; import { IProgress, LspClient, opeParam } from '../../global'; import axios, { AxiosResponse } from "axios"; -import { chooseBestDownloadSource } from "./cdn"; +import { chooseBestDownloadSource, getLspFileName } from "./cdn"; import { hdlDir, hdlPath } from "../../hdlFs"; import { registerConfigurationUpdater, registerLinter } from "./config"; import { t } from "../../i18n"; @@ -115,7 +115,7 @@ export async function downloadLsp(context: vscode.ExtensionContext, version: str console.log('choose download link: ' + downloadLink); clearInterval(intervalHandler); - return downloadLink + return downloadLink; }); const tarGzFilePath = await vscode.window.withProgress({ @@ -142,6 +142,48 @@ export async function downloadLsp(context: vscode.ExtensionContext, version: str return false; } + +export async function installLsp(context: vscode.ExtensionContext, version: string, versionFolderPath: string): Promise { + + const uri = await vscode.window.showOpenDialog({ + title: t('info.choose.digital-lsp-targz'), + canSelectFiles: true, + canSelectFolders: false, + canSelectMany: false, + filters: { + [t('info.digital-lsp.targz')]: ['tar.gz'], + [t('info.vcd-viewer.all-file')]: ['*'] + } + }); + + if (!uri) { + return false; + } + + const tarGzFilePath = uri[0].fsPath; + const filename = path.basename(tarGzFilePath); + const signature = getPlatformPlatformSignature().toString(); + const expectFilename = getLspFileName(version, signature); + if (expectFilename !== filename) { + vscode.window.showErrorMessage(t('error.digital-lsp.incorrect-filename', filename, expectFilename)); + return false; + } + + await vscode.window.withProgress({ + location: vscode.ProgressLocation.Notification, + title: t('info.progress.extract-digital-lsp') + }, async (progress: vscode.Progress, token: vscode.CancellationToken) => { + if (fs.existsSync(tarGzFilePath)) { + console.log('check finish, begin to extract'); + await extractTarGz(tarGzFilePath, versionFolderPath); + } else { + vscode.window.showErrorMessage(t('error.lsp.download-digital-lsp') + version); + } + }); + + return false; +} + export async function activate(context: vscode.ExtensionContext, packageJson: any) { const version = packageJson.version; await checkAndDownload(context, version); diff --git a/update.bat b/update.bat new file mode 100644 index 0000000..649121b --- /dev/null +++ b/update.bat @@ -0,0 +1,2 @@ +yarn build +scp -P 2233 -r src/.vuepress/dist/* ubuntu@nc-ai.cn:/home/ubuntu/html \ No newline at end of file From 1b91990cb35a1489c144da6b0b7b75cfd5062c30 Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Fri, 10 Jan 2025 15:17:35 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=87=BA=20pdf?= =?UTF-8?q?=20=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- l10n/bundle.l10n.de.json | 6 +++++- l10n/bundle.l10n.en.json | 6 +++++- l10n/bundle.l10n.ja.json | 6 +++++- l10n/bundle.l10n.zh-cn.json | 6 +++++- l10n/bundle.l10n.zh-tw.json | 6 +++++- project/property-schema.json | 3 ++- src/function/dide-doc/index.ts | 5 +++++ src/function/dide-doc/pdf.ts | 25 +++++++++++++++++++------ src/function/dide-netlist/api.ts | 2 +- 10 files changed, 53 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 160ecdc..4f231f0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## Digital IDE | All in one vscode plugin for Verilog/VHDL development -[Document (New)](https://sterben.nitcloud.cn/) | [中文文档 (New)](https://sterben.nitcloud.cn/zh/) | [Bilibili Video](https://www.bilibili.com/video/BV1t14y1179V/?spm_id_from=333.999.0.0) +[Document (New)](https://nc-ai.cn/en/) | [中文文档 (New)](https://nc-ai.cn/) | [Bilibili Video](https://www.bilibili.com/video/BV1t14y1179V/?spm_id_from=333.999.0.0) ![](https://img.shields.io/badge/version-0.4.0-purple) ![](https://img.shields.io/badge/Verilog-support-green) diff --git a/l10n/bundle.l10n.de.json b/l10n/bundle.l10n.de.json index 0973b84..26310e9 100644 --- a/l10n/bundle.l10n.de.json +++ b/l10n/bundle.l10n.de.json @@ -120,5 +120,9 @@ "info.progress.launch-lsp": "Starten Sie den Digital LSP-Sprachserver", "info.choose.digital-lsp-targz": "Wählen Sie das Digital LSP-Archiv aus", "info.digital-lsp.targz": "Digitales LSP-Paket", - "error.digital-lsp.incorrect-filename": "Die von Ihnen bereitgestellte Digital-LSP-Archivdatei {0} entspricht nicht der aktuellen Systemarchitektur. Bitte laden Sie die Archivdatei mit dem Namen {1} herunter!" + "error.digital-lsp.incorrect-filename": "Die von Ihnen bereitgestellte Digital-LSP-Archivdatei {0} entspricht nicht der aktuellen Systemarchitektur. Bitte laden Sie die Archivdatei mit dem Namen {1} herunter!", + "error.not-valid-browser": "{0} ist kein gültiger Browser-Pfad!", + "info.config-browser-path": "Browser-Pfad konfigurieren", + "info.pdf.exporting": "PDF wird nach {0} exportiert", + "info.generate-pdf-to": "PDF wurde unter {0} generiert" } \ No newline at end of file diff --git a/l10n/bundle.l10n.en.json b/l10n/bundle.l10n.en.json index 4fe28b0..5764fc0 100644 --- a/l10n/bundle.l10n.en.json +++ b/l10n/bundle.l10n.en.json @@ -120,5 +120,9 @@ "info.progress.launch-lsp": "Start the Digital LSP language server", "info.choose.digital-lsp-targz": "Select the Digital LSP archive", "info.digital-lsp.targz": "Digital LSP Package", - "error.digital-lsp.incorrect-filename": "The digital LSP archive file {0} you provided does not match the current system architecture. Please download the archive file named {1}!" + "error.digital-lsp.incorrect-filename": "The digital LSP archive file {0} you provided does not match the current system architecture. Please download the archive file named {1}!", + "error.not-valid-browser": "{0} is not a valid browser path!", + "info.config-browser-path": "Configure browser path", + "info.pdf.exporting": "Exporting PDF to {0}", + "info.generate-pdf-to": "PDF has been generated to {0}" } \ No newline at end of file diff --git a/l10n/bundle.l10n.ja.json b/l10n/bundle.l10n.ja.json index 70ff430..76192ad 100644 --- a/l10n/bundle.l10n.ja.json +++ b/l10n/bundle.l10n.ja.json @@ -120,5 +120,9 @@ "info.progress.launch-lsp": "Digital LSP 言語サーバーを起動する", "info.choose.digital-lsp-targz": "Digital LSPのアーカイブを選択してください", "info.digital-lsp.targz": "デジタルLSPパッケージ", - "error.digital-lsp.incorrect-filename": "提供されたデジタルLSPアーカイブファイル{0}は、現在のシステムアーキテクチャに適合していません。{1}という名前のアーカイブファイルをダウンロードしてください!" + "error.digital-lsp.incorrect-filename": "提供されたデジタルLSPアーカイブファイル{0}は、現在のシステムアーキテクチャに適合していません。{1}という名前のアーカイブファイルをダウンロードしてください!", + "error.not-valid-browser": "{0} は有効なブラウザのパスではありません!", + "info.config-browser-path": "ブラウザのパスを設定", + "info.pdf.exporting": "PDFを{0}にエクスポート中", + "info.generate-pdf-to": "PDFは{0}に生成されました" } \ No newline at end of file diff --git a/l10n/bundle.l10n.zh-cn.json b/l10n/bundle.l10n.zh-cn.json index bb3d0e0..953bc9f 100644 --- a/l10n/bundle.l10n.zh-cn.json +++ b/l10n/bundle.l10n.zh-cn.json @@ -120,5 +120,9 @@ "info.progress.launch-lsp": "启动 Digital LSP 语言服务器", "info.choose.digital-lsp-targz": "选择 Digital LSP 的压缩包", "info.digital-lsp.targz": "Digital LSP 压缩包", - "error.digital-lsp.incorrect-filename": "您提供的 digital lsp 压缩包文件 {0} 并不是一个符合当前系统架构的,请下载名为 {1} 的压缩包文件!" + "error.digital-lsp.incorrect-filename": "您提供的 digital lsp 压缩包文件 {0} 并不是一个符合当前系统架构的,请下载名为 {1} 的压缩包文件!", + "error.not-valid-browser": "{0} 并不是一个有效的浏览器路径!", + "info.config-browser-path": "配置浏览器路径", + "info.pdf.exporting": "正在导出 pdf 到 {0}", + "info.generate-pdf-to": "pdf 已经生成至 {0}" } \ No newline at end of file diff --git a/l10n/bundle.l10n.zh-tw.json b/l10n/bundle.l10n.zh-tw.json index 7c81f56..9ee0e87 100644 --- a/l10n/bundle.l10n.zh-tw.json +++ b/l10n/bundle.l10n.zh-tw.json @@ -120,5 +120,9 @@ "info.progress.launch-lsp": "啟動 Digital LSP 語言伺服器", "info.choose.digital-lsp-targz": "選擇 Digital LSP 的壓縮包", "info.digital-lsp.targz": "數位LSP壓縮包", - "error.digital-lsp.incorrect-filename": "您提供的 digital lsp 壓縮包文件 {0} 並不是一個符合當前系統架構的,請下載名為 {1} 的壓縮包文件!" + "error.digital-lsp.incorrect-filename": "您提供的 digital lsp 壓縮包文件 {0} 並不是一個符合當前系統架構的,請下載名為 {1} 的壓縮包文件!", + "error.not-valid-browser": "{0} 並不是一個有效的瀏覽器路徑!", + "info.config-browser-path": "配置瀏覽器路徑", + "info.pdf.exporting": "正在導出PDF到{0}", + "info.generate-pdf-to": "PDF 已生成至 {0}" } \ No newline at end of file diff --git a/project/property-schema.json b/project/property-schema.json index 364c338..2a329ee 100644 --- a/project/property-schema.json +++ b/project/property-schema.json @@ -198,7 +198,8 @@ "xc7a35tftg256-1", "xc7a35tcsg324-1", "xc7z035ffg676-2", - "xc7z020clg484-1" + "xc7z020clg484-1", + "hello-world" ] } }, diff --git a/src/function/dide-doc/index.ts b/src/function/dide-doc/index.ts index 459fd5f..9e281d5 100644 --- a/src/function/dide-doc/index.ts +++ b/src/function/dide-doc/index.ts @@ -43,6 +43,11 @@ function registerFileDocExport(context: vscode.ExtensionContext) { new ExportFunctionItem('html', ' html', 'only support light theme', exportCurrentFileDocAsHTML) ]; + if (uri === undefined && vscode.window.activeTextEditor) { + // TODO: 制作新的 doc UI + uri = vscode.Uri.file(vscode.window.activeTextEditor.document.fileName); + } + const item = await vscode.window.showQuickPick(items, option); if (item) { item.exportFunc(uri); diff --git a/src/function/dide-doc/pdf.ts b/src/function/dide-doc/pdf.ts index 6130b33..03abc30 100644 --- a/src/function/dide-doc/pdf.ts +++ b/src/function/dide-doc/pdf.ts @@ -5,6 +5,7 @@ import * as puppeteer from 'puppeteer-core'; import { makeShowHTML } from './html'; import { hdlFile, hdlPath } from '../../hdlFs'; import { AbsPath, MainOutput, opeParam, ReportType } from '../../global'; +import { t } from '../../i18n'; // TODO : finish it in each platform function getDefaultBrowerPath(): AbsPath { @@ -27,10 +28,18 @@ function getDefaultBrowerPath(): AbsPath { async function htmlFile2PdfFile(htmlPath: AbsPath, pdfPath: AbsPath) { const pdfConfig = vscode.workspace.getConfiguration("digital-ide.function.doc.pdf"); const platformDefaultBrowerPath = getDefaultBrowerPath(); - const browserPath = pdfConfig.get('browserPath', platformDefaultBrowerPath); + + const browserPath = pdfConfig.get('browserPath') || platformDefaultBrowerPath; if (!fs.existsSync(browserPath)) { - vscode.window.showErrorMessage("Path " + browserPath + " is not a valid browser path!"); + const res = await vscode.window.showErrorMessage( + t('error.not-valid-browser', browserPath), + { title: t('info.config-browser-path'), value: true } + ); + + if (res?.value) { + await vscode.commands.executeCommand('workbench.action.openSettings', 'digital-ide.function.doc.pdf.browserPath'); + } return; } const browser = await puppeteer.launch({ @@ -48,7 +57,7 @@ async function htmlFile2PdfFile(htmlPath: AbsPath, pdfPath: AbsPath) { scale: pdfConfig.scale, displayHeaderFooter: pdfConfig.displayHeaderFooter, headerTemplate: pdfConfig.headerTemplate, - footerTemplate: pdfConfig.footerTemplate, + footerTemplate: `
CodeDoc - Powered By Digital IDE
`, printBackground: pdfConfig.printBackground, landscape: pdfConfig.landscape, format: pdfConfig.format, @@ -74,7 +83,8 @@ async function exportCurrentFileDocAsPDF(uri: vscode.Uri) { return vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, - title: '[Digital-IDE]: Export ' + currentFilePath + '...' + title: t('info.pdf.exporting', currentFilePath), + cancellable: true }, async progress => { try { const html = await makeShowHTML(uri, "pdf"); @@ -102,15 +112,18 @@ async function exportCurrentFileDocAsPDF(uri: vscode.Uri) { fs.writeFileSync(tempHtmlPath, html); await htmlFile2PdfFile(tempHtmlPath, pdfPath); - hdlFile.rmSync(tempHtmlPath); + // hdlFile.rmSync(tempHtmlPath); // 在当前编辑器中打开生成的 pdf - vscode.window.showInformationMessage('pdf generated at ' + pdfPath); + if (fs.existsSync(pdfPath)) { + vscode.window.showInformationMessage(t('info.generate-pdf-to', pdfFolderPath)); + } } catch (error) { MainOutput.report("error happen in export pdf: " + error, { level: ReportType.Error }); + return; } }); } diff --git a/src/function/dide-netlist/api.ts b/src/function/dide-netlist/api.ts index 46ba9df..d0817d5 100644 --- a/src/function/dide-netlist/api.ts +++ b/src/function/dide-netlist/api.ts @@ -170,7 +170,7 @@ async function html2pdf(htmlPath: string, pdfPath: string, moduleName: string, w scale: 1, displayHeaderFooter: true, // headerTemplate: `
module ${moduleName}
`, - footerTemplate: `
Netlist for ${moduleName} - 由 Digital IDE 生成
`, + footerTemplate: `
Netlist for ${moduleName} - Powered By Digital IDE
`, printBackground: true, landscape: true, width: width From dbd4e430d41c971bc0d60890d35e91a993ed1cba Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Fri, 10 Jan 2025 17:03:30 +0800 Subject: [PATCH 3/8] save --- scripts/vscode-package.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/vscode-package.py b/scripts/vscode-package.py index d3f5fa1..7ff1518 100644 --- a/scripts/vscode-package.py +++ b/scripts/vscode-package.py @@ -64,12 +64,12 @@ def modify_vsix(): os.remove(dist_path) # webview - print("") + print("move netlist") copy_dir('./resources/dide-netlist/view', os.path.join(extract_folder, 'extension', 'resources', 'dide-netlist', 'view')) - copy_dir('./resources/dide-netlist/static/share', os.path.join(extract_folder, 'extension', 'resources', 'dide-viewer', 'static', 'share')) - copy_file('./resources/dide-netlist/static/yosys.wasm', os.path.join(extract_folder, 'extension', 'resources', 'dide-viewer', 'static', 'yosys.wasm')) + copy_dir('./resources/dide-netlist/static/share', os.path.join(extract_folder, 'extension', 'resources', 'dide-netlist', 'static', 'share')) + copy_file('./resources/dide-netlist/static/yosys.wasm', os.path.join(extract_folder, 'extension', 'resources', 'dide-netlist', 'static', 'yosys.wasm')) - print("") + print("move vcd") copy_dir('./resources/dide-viewer/view', os.path.join(extract_folder, 'extension', 'resources', 'dide-viewer', 'view')) # remake From 2886673c941fae0be1b500d1ec2669b732c95837 Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Fri, 10 Jan 2025 17:54:43 +0800 Subject: [PATCH 4/8] update --- l10n/bundle.l10n.de.json | 4 ++- l10n/bundle.l10n.en.json | 4 ++- l10n/bundle.l10n.ja.json | 4 ++- l10n/bundle.l10n.zh-cn.json | 4 ++- l10n/bundle.l10n.zh-tw.json | 4 ++- resources/script/xilinx/simulate.tcl | 18 ++++++++++++ src/function/dide-netlist/index.ts | 3 +- src/manager/PL/xilinx.ts | 42 ++++++++++++++++++++++++++++ 8 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 resources/script/xilinx/simulate.tcl diff --git a/l10n/bundle.l10n.de.json b/l10n/bundle.l10n.de.json index 26310e9..8df01b2 100644 --- a/l10n/bundle.l10n.de.json +++ b/l10n/bundle.l10n.de.json @@ -124,5 +124,7 @@ "error.not-valid-browser": "{0} ist kein gültiger Browser-Pfad!", "info.config-browser-path": "Browser-Pfad konfigurieren", "info.pdf.exporting": "PDF wird nach {0} exportiert", - "info.generate-pdf-to": "PDF wurde unter {0} generiert" + "info.generate-pdf-to": "PDF wurde unter {0} generiert", + "info.vivado-gui.started": "Vivado GUI wird gestartet, bitte warten Sie einen Moment", + "ok": "Gut" } \ No newline at end of file diff --git a/l10n/bundle.l10n.en.json b/l10n/bundle.l10n.en.json index 5764fc0..6e0b938 100644 --- a/l10n/bundle.l10n.en.json +++ b/l10n/bundle.l10n.en.json @@ -124,5 +124,7 @@ "error.not-valid-browser": "{0} is not a valid browser path!", "info.config-browser-path": "Configure browser path", "info.pdf.exporting": "Exporting PDF to {0}", - "info.generate-pdf-to": "PDF has been generated to {0}" + "info.generate-pdf-to": "PDF has been generated to {0}", + "info.vivado-gui.started": "Vivado GUI is starting, please wait a moment", + "ok": "Good" } \ No newline at end of file diff --git a/l10n/bundle.l10n.ja.json b/l10n/bundle.l10n.ja.json index 76192ad..ed37dfe 100644 --- a/l10n/bundle.l10n.ja.json +++ b/l10n/bundle.l10n.ja.json @@ -124,5 +124,7 @@ "error.not-valid-browser": "{0} は有効なブラウザのパスではありません!", "info.config-browser-path": "ブラウザのパスを設定", "info.pdf.exporting": "PDFを{0}にエクスポート中", - "info.generate-pdf-to": "PDFは{0}に生成されました" + "info.generate-pdf-to": "PDFは{0}に生成されました", + "info.vivado-gui.started": "Vivado GUI を起動しています、少々お待ちください", + "ok": "良い" } \ No newline at end of file diff --git a/l10n/bundle.l10n.zh-cn.json b/l10n/bundle.l10n.zh-cn.json index 953bc9f..b327d92 100644 --- a/l10n/bundle.l10n.zh-cn.json +++ b/l10n/bundle.l10n.zh-cn.json @@ -124,5 +124,7 @@ "error.not-valid-browser": "{0} 并不是一个有效的浏览器路径!", "info.config-browser-path": "配置浏览器路径", "info.pdf.exporting": "正在导出 pdf 到 {0}", - "info.generate-pdf-to": "pdf 已经生成至 {0}" + "info.generate-pdf-to": "pdf 已经生成至 {0}", + "info.vivado-gui.started": "Vivado GUI 正在启动中,稍等片刻", + "ok": "好的" } \ No newline at end of file diff --git a/l10n/bundle.l10n.zh-tw.json b/l10n/bundle.l10n.zh-tw.json index 9ee0e87..8aec2ff 100644 --- a/l10n/bundle.l10n.zh-tw.json +++ b/l10n/bundle.l10n.zh-tw.json @@ -124,5 +124,7 @@ "error.not-valid-browser": "{0} 並不是一個有效的瀏覽器路徑!", "info.config-browser-path": "配置瀏覽器路徑", "info.pdf.exporting": "正在導出PDF到{0}", - "info.generate-pdf-to": "PDF 已生成至 {0}" + "info.generate-pdf-to": "PDF 已生成至 {0}", + "info.vivado-gui.started": "Vivado GUI 正在啟動中,稍等片刻", + "ok": "好的" } \ No newline at end of file diff --git a/resources/script/xilinx/simulate.tcl b/resources/script/xilinx/simulate.tcl new file mode 100644 index 0000000..5556bcb --- /dev/null +++ b/resources/script/xilinx/simulate.tcl @@ -0,0 +1,18 @@ + +if {[current_sim] != ""} { + relaunch_sim -quiet +} else { + launch_simulation -quiet +} + +set curr_wave [current_wave_config] +if { [string length $curr_wave] == 0 } { + if { [llength [get_objects]] > 0} { + add_wave / + set_property needs_save false [current_wave_config] + } else { + send_msg_id Add_Wave-1 WARNING "No top level signals found. Simulator will start without a wave window. If you want to open a wave window go to 'File->New Waveform Configuration' or type 'create_wave_config' in the TCL console." + } +} +run 1us +file delete c:/Users/11934/Project/Digital-IDE/digital-ide/resources/script/xilinx/simulate.tcl -force diff --git a/src/function/dide-netlist/index.ts b/src/function/dide-netlist/index.ts index bf3d2dc..661ecfc 100644 --- a/src/function/dide-netlist/index.ts +++ b/src/function/dide-netlist/index.ts @@ -20,7 +20,6 @@ interface SimpleOpe { extensionPath: string } -const workerScriptPath = hdlPath.join(__dirname, 'worker.js'); class NetlistRender { panel?: vscode.WebviewPanel; @@ -177,6 +176,7 @@ function checkResource() { export async function openNetlistViewer(context: vscode.ExtensionContext, uri: vscode.Uri, moduleName: string) { checkResource(); + const workerScriptPath = hdlPath.join(opeParam.extensionPath, 'out', 'function', 'dide-netlist', 'worker.js'); const worker = new Worker(workerScriptPath); let success = true; @@ -245,6 +245,7 @@ async function showErrorLogFile(data: any) { export async function runYsScript(context: vscode.ExtensionContext, uri: vscode.Uri) { checkResource(); + const workerScriptPath = hdlPath.join(opeParam.extensionPath, 'out', 'function', 'dide-netlist', 'worker.js'); const worker = new Worker(workerScriptPath); worker.on('message', message => { diff --git a/src/manager/PL/xilinx.ts b/src/manager/PL/xilinx.ts index 0b792b9..a75e68f 100644 --- a/src/manager/PL/xilinx.ts +++ b/src/manager/PL/xilinx.ts @@ -444,6 +444,10 @@ class XilinxOperation { * @param context */ public refresh(context: PLContext) { + vscode.window.showInformationMessage( + "Xilinx: Refresh", + { title: 'ok', value: true } + ); const cmd = this.getRefreshXprDesignSourceCommand(); context.process?.stdin.write(cmd + '\n'); } @@ -477,6 +481,11 @@ class XilinxOperation { } public simulateGui(context: PLContext) { + vscode.window.showInformationMessage( + "Xilinx: Simulate GUI", + { title: 'ok', value: true } + ); + const scriptPath = `${this.xilinxPath}/simulate.tcl`; const script = ` @@ -508,6 +517,11 @@ file delete ${scriptPath} -force\n`; } public simulateCli(context: PLContext) { + vscode.window.showInformationMessage( + "Xilinx: Simulate CLI", + { title: 'ok', value: true } + ); + const scriptPath = hdlPath.join(this.xilinxPath, 'simulate.tcl'); const script = ` if {[current_sim] != ""} { @@ -536,6 +550,11 @@ file delete ${scriptPath} -force\n`; } public synth(context: PLContext) { + vscode.window.showInformationMessage( + "Xilinx: Synth", + { title: 'ok', value: true } + ); + let quietArg = ''; if (opeParam.prjInfo.enableShowLog) { quietArg = '-quiet'; @@ -550,6 +569,11 @@ file delete ${scriptPath} -force\n`; } impl(context: PLContext) { + vscode.window.showInformationMessage( + "Xilinx: Impl", + { title: 'ok', value: true } + ); + let quietArg = ''; if (opeParam.prjInfo.enableShowLog) { quietArg = '-quiet'; @@ -566,6 +590,10 @@ file delete ${scriptPath} -force\n`; } build(context: PLContext) { + vscode.window.showInformationMessage( + "Xilinx: Build", + { title: 'ok', value: true } + ); let quietArg = ''; if (this.prjConfig.enableShowLog) { quietArg = '-quiet'; @@ -595,6 +623,11 @@ file delete ${scriptPath} -force\n`; generateBit(context: PLContext) { + vscode.window.showInformationMessage( + "Xilinx: BitStream", + { title: 'ok', value: true } + ); + let scripts: string[] = []; let core = this.prjConfig.soc.core; let sysdefPath = `${this.prjInfo.path}/${this.prjInfo.name}.runs` + @@ -626,6 +659,11 @@ file delete ${scriptPath} -force\n`; } program(context: PLContext) { + vscode.window.showInformationMessage( + "Xilinx: Program", + { title: 'ok', value: true } + ); + let scriptPath = `${this.xilinxPath}/program.tcl`; let script = ` open_hw -quiet @@ -672,6 +710,10 @@ file delete ${scriptPath} -force\n`; } tclProcess.stdin.write('start_gui -quiet\n'); + vscode.window.showInformationMessage( + t('info.vivado-gui.started'), + { title: t('ok'), value: true } + ); HardwareOutput.report(t('info.pl.gui.report-title'), { level: ReportType.Info }); From 27db47c467c2516371d47c63be7ca203222f3243 Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Fri, 10 Jan 2025 21:08:06 +0800 Subject: [PATCH 5/8] update --- resources/script/xilinx/program.tcl | 27 --------------- resources/script/xilinx/simulate.tcl | 18 ---------- src/function/dide-netlist/worker.ts | 1 + src/manager/prj.ts | 49 ++++++++++++++++++++++++++-- 4 files changed, 48 insertions(+), 47 deletions(-) delete mode 100644 resources/script/xilinx/program.tcl delete mode 100644 resources/script/xilinx/simulate.tcl diff --git a/resources/script/xilinx/program.tcl b/resources/script/xilinx/program.tcl deleted file mode 100644 index b2174e7..0000000 --- a/resources/script/xilinx/program.tcl +++ /dev/null @@ -1,27 +0,0 @@ - -open_hw -quiet -connect_hw_server -quiet -set found 0 -foreach hw_target [get_hw_targets] { - current_hw_target $hw_target - open_hw_target -quiet - foreach hw_device [get_hw_devices] { - if { [string equal -length 6 [get_property PART $hw_device] xc7z020clg400-2] == 1 } { - puts "------Successfully Found Hardware Target with a xc7z020clg400-2 device------ " - current_hw_device $hw_device - set found 1 - } - } - if {$found == 1} {break} - close_hw_target -} - -#download the hw_targets -if {$found == 0 } { - puts "******ERROR : Did not find any Hardware Target with a xc7z020clg400-2 device****** " -} else { - set_property PROGRAM.FILE ./[current_project].bit [current_hw_device] - program_hw_devices [current_hw_device] -quiet - disconnect_hw_server -quiet -} -file delete /home/dide/project/Digital-IDE/resources/script/xilinx/program.tcl -force diff --git a/resources/script/xilinx/simulate.tcl b/resources/script/xilinx/simulate.tcl deleted file mode 100644 index 5556bcb..0000000 --- a/resources/script/xilinx/simulate.tcl +++ /dev/null @@ -1,18 +0,0 @@ - -if {[current_sim] != ""} { - relaunch_sim -quiet -} else { - launch_simulation -quiet -} - -set curr_wave [current_wave_config] -if { [string length $curr_wave] == 0 } { - if { [llength [get_objects]] > 0} { - add_wave / - set_property needs_save false [current_wave_config] - } else { - send_msg_id Add_Wave-1 WARNING "No top level signals found. Simulator will start without a wave window. If you want to open a wave window go to 'File->New Waveform Configuration' or type 'create_wave_config' in the TCL console." - } -} -run 1us -file delete c:/Users/11934/Project/Digital-IDE/digital-ide/resources/script/xilinx/simulate.tcl -force diff --git a/src/function/dide-netlist/worker.ts b/src/function/dide-netlist/worker.ts index 90c6ddf..9a439fd 100644 --- a/src/function/dide-netlist/worker.ts +++ b/src/function/dide-netlist/worker.ts @@ -311,6 +311,7 @@ class Netlist { wasi_snapshot_preview1: wasi.wasiImport }); + try { const exitCode = wasi.start(instance); } catch (error) { diff --git a/src/manager/prj.ts b/src/manager/prj.ts index 52aefa7..add1ba9 100644 --- a/src/manager/prj.ts +++ b/src/manager/prj.ts @@ -342,18 +342,55 @@ class PrjManage { continue; } + const sourcePath = hdlPath.join(workspace, file); + + // 排除非 hdl 文件 + if (hdlFile.isFile(sourcePath) && !hdlFile.isHDLFile(sourcePath)) { + continue; + } + if (file.startsWith(plname)) { const targetFolder = hdlPath.join(workspace, 'prj', 'xilinx'); - const sourcePath = hdlPath.join(workspace, file); hdlFile.move(sourcePath, targetFolder); } else { const targetFolder = hdlPath.join(workspace, 'user', 'src'); - const sourcePath = hdlPath.join(workspace, file); + hdlFile.move(sourcePath, targetFolder); } } } + /** + * @description 搬移 Xilinx 项目中的 BD + * + * bd 一般在 ${workspace}/${plname}.srcs/sources_xxx/bd 里面 + */ + function transformBD( + matchPrefix: string, + workspace: string, + plname: string + ) { + const xilinxSrcsPath = hdlPath.join(workspace, plname + '.srcs'); + const standardBdPath = hdlPath.join(workspace, 'user', 'bd'); + if (!fs.existsSync(xilinxSrcsPath)) { + return; + } + const sourceNames = fs.readdirSync(xilinxSrcsPath).filter(filename => filename.startsWith(matchPrefix)); + for (const sn of sourceNames) { + const bdPath = hdlPath.join(xilinxSrcsPath, sn, 'bd'); + if (!hdlFile.isDir(bdPath)) { + continue; + } + + for (const bdname of fs.readdirSync(bdPath)) { + const sourcePath = hdlPath.join(bdPath, bdname); + hdlDir.mvdir(sourcePath, standardBdPath, true); + } + hdlDir.rmdir(bdPath); + } + } + + /** * @description 搬移 Xilinx 项目中的 IP * @@ -481,11 +518,15 @@ class PrjManage { // 创建标准项目结构基本文件夹 // xilinx prj hdlDir.mkdir(hdlPath.join(workspacePath, 'prj', 'xilinx')); + // hardware hdlDir.mkdir(hdlPath.join(workspacePath, 'user', 'src')); hdlDir.mkdir(hdlPath.join(workspacePath, 'user', 'sim')); hdlDir.mkdir(hdlPath.join(workspacePath, 'user', 'data')); hdlDir.mkdir(hdlPath.join(workspacePath, 'user', 'ip')); + + hdlDir.mkdir(hdlPath.join(workspacePath, 'user', 'bd')); + // software hdlDir.mkdir(hdlPath.join(workspacePath, 'user', 'sdk')); hdlDir.mkdir(hdlPath.join(workspacePath, 'user', 'sdk', 'data')); @@ -498,6 +539,10 @@ class PrjManage { transformIP('sources_', workspacePath, plname); transformIP('sim_', workspacePath, plname); + // 迁移 BD + transformBD('sources_', workspacePath, plname); + transformBD('sim_', workspacePath, plname); + // 迁移文件夹 ${workspace}/${plname}.srcs transformXilinxPL('src', 'sources_', workspacePath, plname); transformXilinxPL('sim', 'sim_', workspacePath, plname); From a66628abffc63341ce18cb9796b4dff21dc9d80b Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Fri, 10 Jan 2025 21:09:20 +0800 Subject: [PATCH 6/8] update --- src/manager/prj.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/manager/prj.ts b/src/manager/prj.ts index add1ba9..8bb8e10 100644 --- a/src/manager/prj.ts +++ b/src/manager/prj.ts @@ -344,17 +344,15 @@ class PrjManage { const sourcePath = hdlPath.join(workspace, file); - // 排除非 hdl 文件 - if (hdlFile.isFile(sourcePath) && !hdlFile.isHDLFile(sourcePath)) { - continue; - } - if (file.startsWith(plname)) { const targetFolder = hdlPath.join(workspace, 'prj', 'xilinx'); hdlFile.move(sourcePath, targetFolder); } else { + // 排除非 hdl 文件 + if (hdlFile.isFile(sourcePath) && !hdlFile.isHDLFile(sourcePath)) { + continue; + } const targetFolder = hdlPath.join(workspace, 'user', 'src'); - hdlFile.move(sourcePath, targetFolder); } } From 48ee528020b5f7b0b8ecbaa95091368cd012ef0e Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Fri, 10 Jan 2025 21:37:27 +0800 Subject: [PATCH 7/8] update --- update.bat | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 update.bat diff --git a/update.bat b/update.bat deleted file mode 100644 index 649121b..0000000 --- a/update.bat +++ /dev/null @@ -1,2 +0,0 @@ -yarn build -scp -P 2233 -r src/.vuepress/dist/* ubuntu@nc-ai.cn:/home/ubuntu/html \ No newline at end of file From 3838196cca3b041f9324ef7788847a91d45658b6 Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Fri, 10 Jan 2025 23:36:10 +0800 Subject: [PATCH 8/8] update --- .vscodeignore | 3 ++- scripts/vscode-package.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.vscodeignore b/.vscodeignore index d95d7c3..f6f5c37 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -19,4 +19,5 @@ design lib *.vcd *.zip -figures \ No newline at end of file +figures +scripts \ No newline at end of file diff --git a/scripts/vscode-package.py b/scripts/vscode-package.py index 7ff1518..d1a5a76 100644 --- a/scripts/vscode-package.py +++ b/scripts/vscode-package.py @@ -96,6 +96,9 @@ def install_extension(): vsix_path = os.path.join('dist', vsix_files[0]) os.system('code --install-extension ' + vsix_path) +if os.path.exists('dist'): + shutil.rmtree('dist') + pipe = CommandPipe() pipe.add_command('uninstall original extension', 'code --uninstall-extension sterben.fpga-support') pipe.add_command('compile typescript', 'tsc -p ./ --outDir out-js')