Skip to content

Commit

Permalink
Merge pull request #1537 from zhanghongnian/issue#1180
Browse files Browse the repository at this point in the history
fix demo: completion provider example
  • Loading branch information
alexdima committed Sep 19, 2019
2 parents 9ac4ec8 + bf113cc commit e93745e
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -28,7 +28,7 @@ monaco.languages.registerCompletionItemProvider('json', {
provideCompletionItems: function(model, position) {
// find out if we are completing a property in the 'dependencies' object.
var textUntilPosition = model.getValueInRange({startLineNumber: 1, startColumn: 1, endLineNumber: position.lineNumber, endColumn: position.column});
var match = textUntilPosition.match(/"dependencies"\s*:\s*{\s*("[^"]*"\s*:\s*"[^"]*"\s*,\s*)*("[^"]*)?$/);
var match = textUntilPosition.match(/"dependencies"\s*:\s*\{\s*("[^"]*"\s*:\s*"[^"]*"\s*,\s*)*([^"]*)?$/);
var suggestions = match ? createDependencyProposals() : [];
return {
suggestions: suggestions
Expand Down

0 comments on commit e93745e

Please sign in to comment.