Skip to content

Commit

Permalink
Fix #1341 - Make sure initializationOptions is at least empty object
Browse files Browse the repository at this point in the history
  • Loading branch information
zulus committed May 10, 2020
1 parent eddf3c7 commit 93b7f7f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 14 additions & 2 deletions server/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export interface VLSFullConfig extends VLSConfig {
stylusSupremacy?: any;
}

export function getDefaultVLSConfig(): VLSConfig {
export function getDefaultVLSConfig(): VLSFullConfig {
return {
vetur: {
useWorkspaceDependencies: false,
Expand Down Expand Up @@ -118,6 +118,18 @@ export function getDefaultVLSConfig(): VLSConfig {
experimental: {
templateInterpolationService: false
}
}
},
css: {},
html: {
suggest: {}
},
javascript: {
format: {}
},
typescript: {
format: {}
},
emmet: {},
stylusSupremacy: {}
};
}
1 change: 1 addition & 0 deletions server/src/services/vls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export class VLS {
}

async init(params: InitializeParams) {
params.initializationOptions = params.initializationOptions || {};
const config: VLSFullConfig = params.initializationOptions.config
? _.merge(getDefaultVLSConfig(), params.initializationOptions.config)
: getDefaultVLSConfig();
Expand Down

0 comments on commit 93b7f7f

Please sign in to comment.