Skip to content

Commit f431636

Browse files
committed
Cleanup
1 parent 72e51d2 commit f431636

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
lines changed

src/lsptoolshost/optionChanges.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ function handleLanguageServerOptionChanges(changedOptions: OptionChanges): void
4040
};
4141
if (changedOptions.changedCommonOptions.find((key) => key === 'useOmnisharpServer')) {
4242
// If the user has changed the useOmnisharpServer flag we need to reload the window.
43-
// Intentionally not awaiting this promise - we don't want to block handling changes on showing the notification prompt.
4443
showInformationMessage(
4544
vscode,
4645
vscode.l10n.t(
@@ -56,6 +55,5 @@ function handleLanguageServerOptionChanges(changedOptions: OptionChanges): void
5655
const message = vscode.l10n.t(
5756
'C# configuration has changed. Would you like to reload the window to apply your changes?'
5857
);
59-
// Intentionally not awaiting this promise - we don't want to block handling changes on showing the notification prompt.
6058
showInformationMessage(vscode, message, reloadTitle);
6159
}

src/lsptoolshost/restore.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export async function restore(
8080
showOutput: boolean
8181
): Promise<void> {
8282
if (_restoreInProgress) {
83-
// Show error message but don't await the dismissal of it.
8483
showErrorMessage(vscode, vscode.l10n.t('Restore already in progress'));
8584
return;
8685
}

src/shared/configurationProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export class BaseVsDbgConfigurationProvider implements vscode.DebugConfiguration
245245
action: async () => {
246246
const returnData = await createSelfSignedCert(dotnetPath);
247247
if (returnData.error === null) {
248-
//if the prcess returns 0, returnData.error is null, otherwise the return code can be acessed in returnData.error.code
248+
// if the process returns 0, returnData.error is null, otherwise the return code can be accessed in returnData.error.code
249249
const message =
250250
errorCode === CertToolStatusCodes.CertificateNotTrusted ? 'trusted' : 'created';
251251
showInformationMessage(

src/shared/observers/utils/showMessage.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,15 @@ function showMessage(
8181
delegateFunc(message, messageOptions, ...items).then(
8282
async (selectedItem) => {
8383
if (selectedItem) {
84-
const item = items.find((i) => i);
85-
if (item === undefined) {
86-
// This should never happen - we got an item back that we didn't provide
87-
throw new Error(
88-
`Could not find item with message: ${selectedItem}; items:${JSON.stringify(items)}`
89-
);
90-
}
91-
if (typeof item === 'string') {
84+
if (typeof selectedItem === 'string') {
9285
return;
93-
} else if ('action' in item && item.action) {
94-
await item.action();
95-
} else if ('command' in item && item.command) {
96-
if (item.arguments) {
97-
await vscode.commands.executeCommand(item.command, ...item.arguments);
86+
} else if ('action' in selectedItem && selectedItem.action) {
87+
await selectedItem.action();
88+
} else if ('command' in selectedItem && selectedItem.command) {
89+
if (selectedItem.arguments) {
90+
await vscode.commands.executeCommand(selectedItem.command, ...selectedItem.arguments);
9891
} else {
99-
await vscode.commands.executeCommand(item.command);
92+
await vscode.commands.executeCommand(selectedItem.command);
10093
}
10194
}
10295
}

0 commit comments

Comments
 (0)