mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 13:55:41 +01:00
Fixes #1180
This commit is contained in:
parent
6e721355cc
commit
cf85c0785a
2 changed files with 8 additions and 8 deletions
|
|
@ -67,10 +67,10 @@ monaco.languages.registerCompletionItemProvider('json', {
|
|||
// 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*)*("[^"]*)?$/);
|
||||
if (match) {
|
||||
return createDependencyProposals();
|
||||
}
|
||||
return [];
|
||||
var suggestions = match ? createDependencyProposals() : [];
|
||||
return {
|
||||
suggestions: suggestions
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ monaco.languages.registerCompletionItemProvider('json', {
|
|||
// 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*)*("[^"]*)?$/);
|
||||
if (match) {
|
||||
return createDependencyProposals();
|
||||
}
|
||||
return [];
|
||||
var suggestions = match ? createDependencyProposals() : [];
|
||||
return {
|
||||
suggestions: suggestions
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue