Skip to content

Commit

Permalink
Refactor openWebsite
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyo930021 committed Feb 12, 2021
1 parent bad5284 commit 0879543
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions client/vueMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
3 changes: 2 additions & 1 deletion server/src/services/vls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 });
}

/**
Expand Down

0 comments on commit 0879543

Please # to comment.