Skip to content

Commit

Permalink
Fix compatibility with atom-languageclient
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyo930021 committed Dec 12, 2020
1 parent c70f443 commit e9dc769
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/src/services/vls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ export class VLS {

async init(params: InitializeParams) {
const workspaceFolders =
!Array.isArray(params.workspaceFolders) && params.rootPath
Array.isArray(params.workspaceFolders) && params.capabilities.workspace?.workspaceFolders
? params.workspaceFolders.map(el => ({ name: el.name, fsPath: getFileFsPath(el.uri) }))
: params.rootPath
? [{ name: '', fsPath: normalizeFileNameToFsPath(params.rootPath) }]
: params.workspaceFolders?.map(el => ({ name: el.name, fsPath: getFileFsPath(el.uri) })) ?? [];
: [];

if (workspaceFolders.length === 0) {
console.error('No workspace path found. Vetur initialization failed.');
Expand Down

0 comments on commit e9dc769

Please sign in to comment.