增加全局 conf 属性: extensionPath

This commit is contained in:
锦恢 2024-11-11 21:43:05 +08:00
parent 98e5de8686
commit c3a3ed6d6e
8 changed files with 47 additions and 17 deletions

View File

@ -26,5 +26,6 @@
"info.welcome.join-qq-group": "Klicken Sie auf den Link, um der QQ-Gruppe beizutreten", "info.welcome.join-qq-group": "Klicken Sie auf den Link, um der QQ-Gruppe beizutreten",
"info.level.test": "Dies ist ein einfaches Beispiel", "info.level.test": "Dies ist ein einfaches Beispiel",
"info.progress.build-ip-module-tree": "构建 IP 模块树", "info.progress.build-ip-module-tree": "构建 IP 模块树",
"info.treeview.ip-no-active.message": "当前 IP 还未激活,请通过 Xilinx 工具链将 XCI 文件生成完整的 IP 核" "info.treeview.ip-no-active.message": "当前 IP 还未激活,请通过 Xilinx 工具链将 XCI 文件生成完整的 IP 核",
"info.progress.initialize-configure": "初始化项目配置"
} }

View File

@ -26,5 +26,6 @@
"info.welcome.join-qq-group": "Click the link to join the QQ group", "info.welcome.join-qq-group": "Click the link to join the QQ group",
"info.level.test": "This is a simple example", "info.level.test": "This is a simple example",
"info.progress.build-ip-module-tree": "构建 IP 模块树", "info.progress.build-ip-module-tree": "构建 IP 模块树",
"info.treeview.ip-no-active.message": "当前 IP 还未激活,请通过 Xilinx 工具链将 XCI 文件生成完整的 IP 核" "info.treeview.ip-no-active.message": "当前 IP 还未激活,请通过 Xilinx 工具链将 XCI 文件生成完整的 IP 核",
"info.progress.initialize-configure": "初始化项目配置"
} }

View File

@ -26,5 +26,6 @@
"info.welcome.join-qq-group": "リンクをクリックして QQ グループに参加", "info.welcome.join-qq-group": "リンクをクリックして QQ グループに参加",
"info.level.test": "これは簡単な例です", "info.level.test": "これは簡単な例です",
"info.progress.build-ip-module-tree": "构建 IP 模块树", "info.progress.build-ip-module-tree": "构建 IP 模块树",
"info.treeview.ip-no-active.message": "当前 IP 还未激活,请通过 Xilinx 工具链将 XCI 文件生成完整的 IP 核" "info.treeview.ip-no-active.message": "当前 IP 还未激活,请通过 Xilinx 工具链将 XCI 文件生成完整的 IP 核",
"info.progress.initialize-configure": "初始化项目配置"
} }

View File

@ -26,5 +26,6 @@
"info.welcome.join-qq-group": "点击链接加入 QQ 群", "info.welcome.join-qq-group": "点击链接加入 QQ 群",
"info.level.test": "这是一个简单的样例", "info.level.test": "这是一个简单的样例",
"info.progress.build-ip-module-tree": "构建 IP 模块树", "info.progress.build-ip-module-tree": "构建 IP 模块树",
"info.treeview.ip-no-active.message": "当前 IP 还未激活,请通过 Xilinx 工具链将 XCI 文件生成完整的 IP 核" "info.treeview.ip-no-active.message": "当前 IP 还未激活,请通过 Xilinx 工具链将 XCI 文件生成完整的 IP 核",
"info.progress.initialize-configure": "初始化项目配置"
} }

View File

@ -26,5 +26,6 @@
"info.welcome.join-qq-group": "點擊鏈接加入 QQ 群", "info.welcome.join-qq-group": "點擊鏈接加入 QQ 群",
"info.level.test": "這是一個簡單的樣例", "info.level.test": "這是一個簡單的樣例",
"info.progress.build-ip-module-tree": "构建 IP 模块树", "info.progress.build-ip-module-tree": "构建 IP 模块树",
"info.treeview.ip-no-active.message": "当前 IP 还未激活,请通过 Xilinx 工具链将 XCI 文件生成完整的 IP 核" "info.treeview.ip-no-active.message": "当前 IP 还未激活,请通过 Xilinx 工具链将 XCI 文件生成完整的 IP 核",
"info.progress.initialize-configure": "初始化项目配置"
} }

View File

@ -44,7 +44,23 @@ async function launch(context: vscode.ExtensionContext) {
await registerCommand(context, versionString); await registerCommand(context, versionString);
}); });
await lspClient.activate(context, versionString); await vscode.window.withProgress({
location: vscode.ProgressLocation.Window,
title: t('info.progress.initialize-configure')
}, async () => {
// 初始化 OpeParam
// 包含基本的插件的文件系统信息、用户配置文件和系统配置文件的合并数据结构
const refreshPrjConfig = await manager.prjManage.initOpeParam(context);
MainOutput.report('finish initialise opeParam', ReportType.Info);
manager.prjManage.refreshPrjFolder(refreshPrjConfig);
});
await vscode.window.withProgress({
location: vscode.ProgressLocation.Window,
title: "启动 Digital LSP 语言服务器"
}, async () => {
await lspClient.activate(context, versionString);
});
await vscode.window.withProgress({ await vscode.window.withProgress({
location: vscode.ProgressLocation.Window, location: vscode.ProgressLocation.Window,
@ -63,9 +79,7 @@ async function launch(context: vscode.ExtensionContext) {
}); });
MainOutput.report('Digital-IDE has launched, Version: ' + versionString, ReportType.Launch); MainOutput.report('Digital-IDE 已经启动,当前版本:' + versionString, ReportType.Launch);
MainOutput.report('OS: ' + opeParam.os, ReportType.Launch);
console.log(hdlParam); console.log(hdlParam);
// show welcome information (if first install) // show welcome information (if first install)

View File

@ -11,7 +11,7 @@ import * as fs from 'fs';
import * as zlib from 'zlib'; import * as zlib from 'zlib';
import * as tar from 'tar'; import * as tar from 'tar';
import { platform } from "os"; import { platform } from "os";
import { IProgress, LspClient } from '../../global'; import { IProgress, LspClient, opeParam } from '../../global';
import axios, { AxiosResponse } from "axios"; import axios, { AxiosResponse } from "axios";
import { chooseBestDownloadSource, getGiteeDownloadLink, getGithubDownloadLink, getPlatformPlatformSignature } from "./cdn"; import { chooseBestDownloadSource, getGiteeDownloadLink, getGithubDownloadLink, getPlatformPlatformSignature } from "./cdn";
import { hdlDir, hdlPath } from "../../hdlFs"; import { hdlDir, hdlPath } from "../../hdlFs";
@ -166,6 +166,16 @@ export async function activate(context: vscode.ExtensionContext, version: string
debug: run, debug: run,
}; };
let workspaceFolder: undefined | { uri: vscode.Uri, name: string, index: number } = undefined;
if (vscode.workspace.workspaceFolders) {
const currentWsFolder = vscode.workspace.workspaceFolders[0];
workspaceFolder = currentWsFolder;
}
let extensionPath = hdlPath.toSlash(context.extensionPath);
vscode.window.showInformationMessage("toolchain: " + opeParam.prjInfo.toolChain);
let clientOptions: LanguageClientOptions = { let clientOptions: LanguageClientOptions = {
documentSelector: [ documentSelector: [
{ {
@ -183,7 +193,13 @@ export async function activate(context: vscode.ExtensionContext, version: string
], ],
progressOnInitialization: true, progressOnInitialization: true,
markdown: { markdown: {
isTrusted: true isTrusted: true,
supportHtml: true
},
workspaceFolder,
initializationOptions: {
extensionPath,
toolChain: opeParam.prjInfo.toolChain
} }
}; };

View File

@ -175,11 +175,6 @@ class PrjManage {
console.time('launch'); console.time('launch');
} }
// 初始化 OpeParam
// 包含基本的插件的文件系统信息、用户配置文件和系统配置文件的合并数据结构
const refreshPrjConfig = await this.initOpeParam(context);
MainOutput.report('finish initialise opeParam', ReportType.Info);
prjManage.refreshPrjFolder(refreshPrjConfig);
// 解析 hdl 文件,构建 hdlParam // 解析 hdl 文件,构建 hdlParam
const hdlFiles = await this.getPrjHardwareFiles(); const hdlFiles = await this.getPrjHardwareFiles();