From 219391810a1459b694d54c9f5fae8dabbe38209a Mon Sep 17 00:00:00 2001 From: "zhuo.quan" Date: Fri, 5 Jul 2024 15:51:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=83=A8=E5=88=86=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/build.mjs | 2 +- client/package.json | 2 +- client/src/extension.ts | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/build/build.mjs b/build/build.mjs index 1ee9769..a96a6d3 100644 --- a/build/build.mjs +++ b/build/build.mjs @@ -58,7 +58,7 @@ class KylinIdePackage extends PackageStep { } modifyPackageJson() { - this.packageJsonData.downloadUrl = 'https://gitee.com/openKylin/extensions-repo/tree/master/KylinIDETeam/cmake-intellisence'; + this.packageJsonData.downloadUrl = 'https://gitee.com/openkylin/cmake-intellisence/releases'; this.packageJsonData.keywords = [ "KylinIdeDev", "KylinIdeDevEdit", diff --git a/client/package.json b/client/package.json index ea49cd5..3481b79 100644 --- a/client/package.json +++ b/client/package.json @@ -4,7 +4,7 @@ "description": "Language Client for CMake IntelliSence extension", "author": "quanzhuo", "license": "MIT", - "publisher": "openKylin", + "publisher": "KylinIdeTeam", "engines": { "vscode": "^1.68.0" }, diff --git a/client/src/extension.ts b/client/src/extension.ts index f3de448..1436101 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -1,15 +1,14 @@ +import { stat } from 'node:fs/promises'; import * as path from 'path'; -import { getConfigLogLevel, Logger } from './logging'; -import { workspace, ExtensionContext, window, commands } from 'vscode'; +import { commands, ExtensionContext, window, workspace } from 'vscode'; import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient/node'; -import { existsSync } from 'fs'; -import { stat } from 'node:fs/promises'; import * as which from 'which'; +import { getConfigLogLevel, Logger } from './logging'; export const SERVER_ID = 'cmakeIntelliSence'; @@ -17,7 +16,7 @@ export const SERVER_NAME = 'CMake Language Server'; let client: LanguageClient; -async function checkCMakeExecutable(cmakePath: string) : Promise { +async function checkCMakeExecutable(cmakePath: string): Promise { try { await stat(cmakePath); } catch (error) { @@ -37,7 +36,7 @@ export async function activate(context: ExtensionContext) { const serverModule = context.asAbsolutePath( path.join('dist', 'server.js') - ); + ); async function checkAndStart(cmakePath: string) { if (await checkCMakeExecutable(cmakePath)) { @@ -60,7 +59,7 @@ export async function activate(context: ExtensionContext) { if (e.affectsConfiguration(`${SERVER_ID}.cmakePath`)) { const cmakePath = workspace.getConfiguration(SERVER_ID).get('cmakePath'); - if (! client?.isRunning()) { + if (!client?.isRunning()) { checkAndStart(cmakePath); } }