mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 591842cc4b71958c81947b254924a215fe3edcbd (#4886)
This commit is contained in:
@@ -357,6 +357,7 @@ export class MainThreadCommentController {
|
||||
|
||||
return <ICommentInfo>{
|
||||
owner: this._uniqueId,
|
||||
label: this.label,
|
||||
threads: ret,
|
||||
commentingRanges: commentingRanges ?
|
||||
{
|
||||
|
||||
@@ -377,7 +377,6 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
|
||||
command: data.m,
|
||||
// not-standard
|
||||
_id: data.x,
|
||||
_pid: data.y
|
||||
};
|
||||
}
|
||||
|
||||
@@ -393,14 +392,14 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
|
||||
return {
|
||||
suggestions: result.b.map(d => MainThreadLanguageFeatures._inflateSuggestDto(result.a, d)),
|
||||
incomplete: result.c,
|
||||
dispose: () => this._proxy.$releaseCompletionItems(handle, result.x)
|
||||
dispose: () => typeof result.x === 'number' && this._proxy.$releaseCompletionItems(handle, result.x)
|
||||
};
|
||||
});
|
||||
}
|
||||
};
|
||||
if (supportsResolveDetails) {
|
||||
provider.resolveCompletionItem = (model, position, suggestion, token) => {
|
||||
return this._proxy.$resolveCompletionItem(handle, model.uri, position, suggestion._id, suggestion._pid, token).then(result => {
|
||||
return this._proxy.$resolveCompletionItem(handle, model.uri, position, suggestion._id, token).then(result => {
|
||||
if (!result) {
|
||||
return suggestion;
|
||||
}
|
||||
@@ -428,29 +427,36 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
|
||||
|
||||
// --- links
|
||||
|
||||
$registerDocumentLinkProvider(handle: number, selector: ISerializedDocumentFilter[]): void {
|
||||
this._registrations[handle] = modes.LinkProviderRegistry.register(selector, <modes.LinkProvider>{
|
||||
$registerDocumentLinkProvider(handle: number, selector: ISerializedDocumentFilter[], supportsResolve: boolean): void {
|
||||
const provider: modes.LinkProvider = {
|
||||
provideLinks: (model, token) => {
|
||||
return this._proxy.$provideDocumentLinks(handle, model.uri, token).then(dto => {
|
||||
if (dto) {
|
||||
dto.forEach(obj => {
|
||||
MainThreadLanguageFeatures._reviveLinkDTO(obj);
|
||||
this._heapService.trackObject(obj);
|
||||
});
|
||||
if (!dto) {
|
||||
return undefined;
|
||||
}
|
||||
return dto;
|
||||
});
|
||||
},
|
||||
resolveLink: (link, token) => {
|
||||
return this._proxy.$resolveDocumentLink(handle, link, token).then(obj => {
|
||||
if (obj) {
|
||||
MainThreadLanguageFeatures._reviveLinkDTO(obj);
|
||||
this._heapService.trackObject(obj);
|
||||
}
|
||||
return obj;
|
||||
return {
|
||||
links: dto.links.map(MainThreadLanguageFeatures._reviveLinkDTO),
|
||||
dispose: () => {
|
||||
if (typeof dto.id === 'number') {
|
||||
this._proxy.$releaseDocumentLinks(handle, dto.id);
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
if (supportsResolve) {
|
||||
provider.resolveLink = (link, token) => {
|
||||
const dto: LinkDto = link;
|
||||
if (!dto.cacheId) {
|
||||
return link;
|
||||
}
|
||||
return this._proxy.$resolveDocumentLink(handle, dto.cacheId, token).then(obj => {
|
||||
return obj && MainThreadLanguageFeatures._reviveLinkDTO(obj);
|
||||
});
|
||||
};
|
||||
}
|
||||
this._registrations[handle] = modes.LinkProviderRegistry.register(selector, provider);
|
||||
}
|
||||
|
||||
// --- colors
|
||||
|
||||
@@ -335,7 +335,7 @@ class CodeActionOnSaveParticipant implements ISaveParticipant {
|
||||
}
|
||||
}
|
||||
|
||||
private async applyCodeActions(actionsToRun: ReadonlyArray<CodeAction>) {
|
||||
private async applyCodeActions(actionsToRun: readonly CodeAction[]) {
|
||||
for (const action of actionsToRun) {
|
||||
await applyCodeAction(action, this._bulkEditService, this._commandService);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user