Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 518623 - [lsp] Content assist assumes ServerCapabilities.Completi…
…onOptions.triggerCharacters is defined

The LSP defines the triggerCharacters property on a
ServerCapabilities' CompletionOptions as optional. So, Orion should
not try to read and consume that value without first checking that it
exists as a language server is not obligated to define a value for
that property.
  • Loading branch information
rcjsuen committed Jun 22, 2017
1 parent 7b70330 commit 40cd394
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -747,9 +747,12 @@ define("orion/editor/contentAssist", [ //$NON-NLS-0$

// build up the regex for triggerCharacters
var triggers = "[";
completionOptions.triggerCharacters.forEach(function(character) {
triggers += character;
});
// don't assume that the language server supports trigger characters
if (completionOptions.triggerCharacters) {
completionOptions.triggerCharacters.forEach(function(character) {
triggers += character;
});
}
triggers += "]";
info.charTriggers = new RegExp(triggers);
}
Expand Down

0 comments on commit 40cd394

Please sign in to comment.