更新部分内容
This commit is contained in:
parent
3b2c2c1510
commit
219391810a
|
@ -58,7 +58,7 @@ class KylinIdePackage extends PackageStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
modifyPackageJson() {
|
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 = [
|
this.packageJsonData.keywords = [
|
||||||
"KylinIdeDev",
|
"KylinIdeDev",
|
||||||
"KylinIdeDevEdit",
|
"KylinIdeDevEdit",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"description": "Language Client for CMake IntelliSence extension",
|
"description": "Language Client for CMake IntelliSence extension",
|
||||||
"author": "quanzhuo",
|
"author": "quanzhuo",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"publisher": "openKylin",
|
"publisher": "KylinIdeTeam",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.68.0"
|
"vscode": "^1.68.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
|
import { stat } from 'node:fs/promises';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { getConfigLogLevel, Logger } from './logging';
|
import { commands, ExtensionContext, window, workspace } from 'vscode';
|
||||||
import { workspace, ExtensionContext, window, commands } from 'vscode';
|
|
||||||
import {
|
import {
|
||||||
LanguageClient,
|
LanguageClient,
|
||||||
LanguageClientOptions,
|
LanguageClientOptions,
|
||||||
ServerOptions,
|
ServerOptions,
|
||||||
TransportKind
|
TransportKind
|
||||||
} from 'vscode-languageclient/node';
|
} from 'vscode-languageclient/node';
|
||||||
import { existsSync } from 'fs';
|
|
||||||
import { stat } from 'node:fs/promises';
|
|
||||||
import * as which from 'which';
|
import * as which from 'which';
|
||||||
|
import { getConfigLogLevel, Logger } from './logging';
|
||||||
|
|
||||||
|
|
||||||
export const SERVER_ID = 'cmakeIntelliSence';
|
export const SERVER_ID = 'cmakeIntelliSence';
|
||||||
|
@ -17,7 +16,7 @@ export const SERVER_NAME = 'CMake Language Server';
|
||||||
|
|
||||||
let client: LanguageClient;
|
let client: LanguageClient;
|
||||||
|
|
||||||
async function checkCMakeExecutable(cmakePath: string) : Promise<boolean> {
|
async function checkCMakeExecutable(cmakePath: string): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
await stat(cmakePath);
|
await stat(cmakePath);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -37,7 +36,7 @@ export async function activate(context: ExtensionContext) {
|
||||||
|
|
||||||
const serverModule = context.asAbsolutePath(
|
const serverModule = context.asAbsolutePath(
|
||||||
path.join('dist', 'server.js')
|
path.join('dist', 'server.js')
|
||||||
);
|
);
|
||||||
|
|
||||||
async function checkAndStart(cmakePath: string) {
|
async function checkAndStart(cmakePath: string) {
|
||||||
if (await checkCMakeExecutable(cmakePath)) {
|
if (await checkCMakeExecutable(cmakePath)) {
|
||||||
|
@ -60,7 +59,7 @@ export async function activate(context: ExtensionContext) {
|
||||||
|
|
||||||
if (e.affectsConfiguration(`${SERVER_ID}.cmakePath`)) {
|
if (e.affectsConfiguration(`${SERVER_ID}.cmakePath`)) {
|
||||||
const cmakePath = workspace.getConfiguration(SERVER_ID).get<string>('cmakePath');
|
const cmakePath = workspace.getConfiguration(SERVER_ID).get<string>('cmakePath');
|
||||||
if (! client?.isRunning()) {
|
if (!client?.isRunning()) {
|
||||||
checkAndStart(cmakePath);
|
checkAndStart(cmakePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue