Skip to content

Commit acc4e20

Browse files
committed
Update vscode API version
1 parent a42a175 commit acc4e20

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"@types/semver": "5.5.0",
9393
"@types/tmp": "0.0.33",
9494
"@types/unzipper": "^0.9.1",
95-
"@types/vscode": "1.57.0",
95+
"@types/vscode": "1.58.0",
9696
"@types/yauzl": "2.9.1",
9797
"archiver": "5.3.0",
9898
"chai": "4.3.4",
@@ -3729,4 +3729,4 @@
37293729
]
37303730
}
37313731
}
3732-
}
3732+
}

src/features/json/jsonContributions.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { configure as configureXHR, xhr } from 'request-light';
99

1010
import {
1111
CompletionItem, CompletionItemProvider, CompletionList, TextDocument, Position, Hover, HoverProvider,
12-
CancellationToken, Range, TextEdit, MarkedString, DocumentSelector, languages, workspace
12+
CancellationToken, Range, MarkedString, DocumentSelector, languages, workspace
1313
} from 'vscode';
1414
import CompositeDisposable from '../../CompositeDisposable';
1515

@@ -113,10 +113,11 @@ export class JSONCompletionItemProvider implements CompletionItemProvider {
113113
let proposed: { [key: string]: boolean } = {};
114114
let collector: ISuggestionsCollector = {
115115
add: (suggestion: CompletionItem) => {
116-
if (!proposed[suggestion.label]) {
117-
proposed[suggestion.label] = true;
116+
if (!proposed[<string>suggestion.label]) {
117+
proposed[<string>suggestion.label] = true;
118118
if (overwriteRange) {
119-
suggestion.textEdit = TextEdit.replace(overwriteRange, <string>suggestion.insertText);
119+
suggestion.insertText = suggestion.insertText;
120+
suggestion.range = overwriteRange;
120121
}
121122

122123
items.push(suggestion);
@@ -162,4 +163,4 @@ export class JSONCompletionItemProvider implements CompletionItemProvider {
162163
}
163164
return text.substring(i + 1, position.character);
164165
}
165-
}
166+
}

src/features/json/projectJSONContribution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export class ProjectJSONContribution implements IJSONContribution {
185185
public resolveSuggestion(item: CompletionItem): Thenable<CompletionItem> {
186186
if (item.kind === CompletionItemKind.Property) {
187187
let pack = item.label;
188-
return this.getInfo(pack).then(info => {
188+
return this.getInfo(<string>pack).then(info => {
189189
if (info.description) {
190190
item.documentation = info.description;
191191
}
@@ -244,4 +244,4 @@ export class ProjectJSONContribution implements IJSONContribution {
244244
}
245245
return null;
246246
}
247-
}
247+
}

0 commit comments

Comments
 (0)