mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
onInitialize() should check if params.initializationOptions is null fiixes #12259
This commit is contained in:
parent
cc732bcb2b
commit
a31bf208c8
|
@ -56,7 +56,9 @@ const filesAssociationContribution = new FileAssociationContribution();
|
||||||
let workspaceRoot: URI;
|
let workspaceRoot: URI;
|
||||||
connection.onInitialize((params: InitializeParams): InitializeResult => {
|
connection.onInitialize((params: InitializeParams): InitializeResult => {
|
||||||
workspaceRoot = URI.parse(params.rootPath);
|
workspaceRoot = URI.parse(params.rootPath);
|
||||||
filesAssociationContribution.setLanguageIds(params.initializationOptions.languageIds);
|
if (params.initializationOptions) {
|
||||||
|
filesAssociationContribution.setLanguageIds(params.initializationOptions.languageIds);
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
capabilities: {
|
capabilities: {
|
||||||
// Tell the client that the server works in FULL text document sync mode
|
// Tell the client that the server works in FULL text document sync mode
|
||||||
|
@ -64,7 +66,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
|
||||||
completionProvider: { resolveProvider: true, triggerCharacters: ['"', ':'] },
|
completionProvider: { resolveProvider: true, triggerCharacters: ['"', ':'] },
|
||||||
hoverProvider: true,
|
hoverProvider: true,
|
||||||
documentSymbolProvider: true,
|
documentSymbolProvider: true,
|
||||||
documentRangeFormattingProvider: params.initializationOptions['format.enable']
|
documentRangeFormattingProvider: !params.initializationOptions || params.initializationOptions['format.enable']
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue