Merge branch 'ben/hot-exit' into ben/preserve-mode

This commit is contained in:
Benjamin Pasero
2019-05-12 05:51:46 -07:00
73 changed files with 703 additions and 602 deletions

View File

@@ -369,7 +369,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
sortText: data.e,
filterText: data.f,
preselect: data.g,
insertText: data.h || data.a,
insertText: typeof data.h === 'undefined' ? data.a : data.h,
insertTextRules: data.i,
range: data.j || defaultRange,
commitCharacters: data.k,

View File

@@ -266,14 +266,18 @@ class CodeActionOnSaveParticipant implements ISaveParticipant {
const codeActionsOnSave = Object.keys(setting)
.filter(x => setting[x]).map(x => new CodeActionKind(x))
.sort((a, b) => {
if (a.value === CodeActionKind.SourceFixAll.value) {
return -1;
}
if (b.value === CodeActionKind.SourceFixAll.value) {
if (CodeActionKind.SourceFixAll.contains(a)) {
if (CodeActionKind.SourceFixAll.contains(b)) {
return 0;
}
return 1;
}
if (CodeActionKind.SourceFixAll.contains(b)) {
return -1;
}
return 0;
});
if (!codeActionsOnSave.length) {
return undefined;
}
@@ -289,11 +293,8 @@ class CodeActionOnSaveParticipant implements ISaveParticipant {
reject(localize('codeActionsOnSave.didTimeout', "Aborted codeActionsOnSave after {0}ms", timeout));
}, timeout)),
this.applyOnSaveActions(model, codeActionsOnSave, tokenSource.token)
]).then(() => {
]).finally(() => {
tokenSource.cancel();
}, (e) => {
tokenSource.cancel();
return Promise.reject(e);
});
}