Skip to content

Commit

Permalink
Avoid setting completion items as undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Feb 27, 2018
1 parent fd2ea5f commit f10b71e
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion extensions/css/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"vscode-css-languageservice": "^3.0.6",
"vscode-emmet-helper": "^1.1.37",
"vscode-emmet-helper": "^1.1.38",
"vscode-languageserver": "4.0.0-next.4"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions extensions/css/server/src/cssServerMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ connection.onCompletion(textDocumentPosition => {

cachedCompletionList = null;
let emmetCompletionList: CompletionList = {
isIncomplete: true,
items: undefined
isIncomplete: false,
items: []
};
const emmetCompletionParticipant: ICompletionParticipant = getEmmetCompletionParticipants(document, textDocumentPosition.position, document.languageId, emmetSettings, emmetCompletionList);
getLanguageService(document).setCompletionParticipants([emmetCompletionParticipant]);
Expand All @@ -227,7 +227,7 @@ connection.onCompletion(textDocumentPosition => {
if (emmetCompletionList.items.length && hexColorRegex.test(emmetCompletionList.items[0].label) && result.items.some(x => x.label === emmetCompletionList.items[0].label)) {
emmetCompletionList.items.shift();
}
return { isIncomplete: true, items: [...emmetCompletionList.items, ...result.items] };
return { isIncomplete: emmetCompletionList.isIncomplete || result.isIncomplete, items: [...emmetCompletionList.items, ...result.items] };
}
return result;
}, null, `Error while computing completions for ${textDocumentPosition.textDocument.uri}`);
Expand Down
6 changes: 3 additions & 3 deletions extensions/css/server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ vscode-css-languageservice@^3.0.6:
vscode-languageserver-types "^3.6.0-next.1"
vscode-nls "^2.0.1"

vscode-emmet-helper@^1.1.37:
version "1.1.37"
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.1.37.tgz#239636ec559d98b23994394028dd1535f49e8a53"
vscode-emmet-helper@^1.1.38:
version "1.1.38"
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.1.38.tgz#6b7de1abe39f8b41d4713c4e85ace4a7261ef0d8"
dependencies:
"@emmetio/extract-abbreviation" "0.1.6"
jsonc-parser "^1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion extensions/emmet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
"@emmetio/html-matcher": "^0.3.3",
"@emmetio/css-parser": "ramya-rao-a/css-parser#vscode",
"@emmetio/math-expression": "^0.1.1",
"vscode-emmet-helper": "^1.1.37",
"vscode-emmet-helper": "^1.1.38",
"vscode-languageserver-types": "^3.5.0",
"image-size": "^0.5.2",
"vscode-nls": "3.2.1"
Expand Down
6 changes: 3 additions & 3 deletions extensions/emmet/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2052,9 +2052,9 @@ vinyl@~2.0.1:
remove-trailing-separator "^1.0.1"
replace-ext "^1.0.0"

vscode-emmet-helper@^1.1.37:
version "1.1.37"
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.1.37.tgz#239636ec559d98b23994394028dd1535f49e8a53"
vscode-emmet-helper@^1.1.38:
version "1.1.38"
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.1.38.tgz#6b7de1abe39f8b41d4713c4e85ace4a7261ef0d8"
dependencies:
"@emmetio/extract-abbreviation" "0.1.6"
jsonc-parser "^1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion extensions/html/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"vscode-css-languageservice": "^3.0.6",
"vscode-emmet-helper": "^1.1.37",
"vscode-emmet-helper": "1.1.38",
"vscode-html-languageservice": "^2.0.17-next.3",
"vscode-languageserver": "4.0.0-next.4",
"vscode-languageserver-types": "^3.6.0-next.1",
Expand Down
6 changes: 3 additions & 3 deletions extensions/html/server/src/htmlServerMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ connection.onCompletion(async textDocumentPosition => {

cachedCompletionList = null;
let emmetCompletionList: CompletionList = {
isIncomplete: true,
items: undefined
isIncomplete: false,
items: []
};
let pathCompletionList: CompletionList = {
isIncomplete: false,
Expand Down Expand Up @@ -305,7 +305,7 @@ connection.onCompletion(async textDocumentPosition => {
if (emmetCompletionList.items.length && hexColorRegex.test(emmetCompletionList.items[0].label) && result.items.some(x => x.label === emmetCompletionList.items[0].label)) {
emmetCompletionList.items.shift();
}
return { isIncomplete: true, items: [...emmetCompletionList.items, ...result.items] };
return { isIncomplete: emmetCompletionList.isIncomplete || result.isIncomplete, items: [...emmetCompletionList.items, ...result.items] };
}
return result;

Expand Down
6 changes: 3 additions & 3 deletions extensions/html/server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ vscode-css-languageservice@^3.0.6:
vscode-languageserver-types "^3.6.0-next.1"
vscode-nls "^2.0.1"

vscode-emmet-helper@^1.1.37:
version "1.1.37"
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.1.37.tgz#239636ec559d98b23994394028dd1535f49e8a53"
vscode-emmet-helper@1.1.38:
version "1.1.38"
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.1.38.tgz#6b7de1abe39f8b41d4713c4e85ace4a7261ef0d8"
dependencies:
"@emmetio/extract-abbreviation" "0.1.6"
jsonc-parser "^1.0.0"
Expand Down

0 comments on commit f10b71e

Please sign in to comment.