From 0879543b0abf7f557a136f11c397e2d3257f8884 Mon Sep 17 00:00:00 2001 From: yoyo930021 Date: Fri, 12 Feb 2021 21:47:22 +0800 Subject: [PATCH] Refactor openWebsite --- client/vueMain.ts | 3 --- server/src/services/vls.ts | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/vueMain.ts b/client/vueMain.ts index b8141f68c5..9207b50a2a 100644 --- a/client/vueMain.ts +++ b/client/vueMain.ts @@ -88,9 +88,6 @@ function registerRestartVLSCommand(context: vscode.ExtensionContext, client: Lan } function registerCustomClientNotificationHandlers(client: LanguageClient) { - client.onNotification('$/openWebsite', (url: string) => { - vscode.env.openExternal(vscode.Uri.parse(url)); - }); client.onNotification('$/showVirtualFile', (virtualFileSource: string, prettySourceMap: string) => { setVirtualContents(virtualFileSource, prettySourceMap); }); diff --git a/server/src/services/vls.ts b/server/src/services/vls.ts index d933b6a9dd..65ce06856f 100644 --- a/server/src/services/vls.ts +++ b/server/src/services/vls.ts @@ -61,6 +61,7 @@ import { createEnvironmentService } from './EnvironmentService'; import { getVueVersionKey } from '../utils/vueVersion'; import { accessSync, constants, existsSync } from 'fs'; import { sleep } from '../utils/sleep'; +import { URI } from 'vscode-uri'; interface ProjectConfig { vlsFullConfig: VLSFullConfig; @@ -474,7 +475,7 @@ export class VLS { * Custom Notifications */ openWebsite(url: string): void { - this.lspConnection.sendNotification('$/openWebsite', url); + this.lspConnection.window.showDocument({ uri: URI.parse(url).toString(), external: true }); } /**