pull/1226/head
Alex Dima 2018-11-13 19:39:07 +01:00
parent 6e721355cc
commit cf85c0785a
2 changed files with 8 additions and 8 deletions

View File

@ -67,10 +67,10 @@ monaco.languages.registerCompletionItemProvider('json', {
// find out if we are completing a property in the 'dependencies' object. // 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 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*)*("[^"]*)?$/);
if (match) { var suggestions = match ? createDependencyProposals() : [];
return createDependencyProposals(); return {
} suggestions: suggestions
return []; };
} }
}); });

View File

@ -29,10 +29,10 @@ monaco.languages.registerCompletionItemProvider('json', {
// find out if we are completing a property in the 'dependencies' object. // 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 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*)*("[^"]*)?$/);
if (match) { var suggestions = match ? createDependencyProposals() : [];
return createDependencyProposals(); return {
} suggestions: suggestions
return []; };
} }
}); });