Run formatter
diff --git a/src/debugAdapter/goDebug.ts b/src/debugAdapter/goDebug.ts
index 0e02e2b..fc3f263 100644
--- a/src/debugAdapter/goDebug.ts
+++ b/src/debugAdapter/goDebug.ts
@@ -841,8 +841,7 @@
// So, update it to use the same separator as the remote path to ease
// in replacing the local path in it with remote path
filePath = filePath.replace(/\/|\\/g, this.remotePathSeparator);
- return filePath
- .replace(this.delve.program.replace(/\/|\\/g, this.remotePathSeparator), this.delve.remotePath);
+ return filePath.replace(this.delve.program.replace(/\/|\\/g, this.remotePathSeparator), this.delve.remotePath);
}
protected toLocalPath(pathToConvert: string): string {
@@ -1852,7 +1851,8 @@
// https://github.com/go-delve/delve/issues/852
// This affects macOS only although we're agnostic of the OS at this stage, only handle the error
if (errorMessage === 'bad access') {
- errorMessage = 'unpropagated fatalpanic: signal SIGSEGV (EXC_BAD_ACCESS). This fatalpanic is not traceable on macOS, see https://github.com/go-delve/delve/issues/852';
+ errorMessage =
+ 'unpropagated fatalpanic: signal SIGSEGV (EXC_BAD_ACCESS). This fatalpanic is not traceable on macOS, see https://github.com/go-delve/delve/issues/852';
}
logError(message + ' - ' + errorMessage);
@@ -1887,39 +1887,40 @@
Object.assign(stackTraceIn, { full: false, cfg: this.delve.loadConfig });
}
this.delve.call<DebugLocation[] | StacktraceOut>(
- this.delve.isApiV1 ?
- 'StacktraceGoroutine' : 'Stacktrace', [stackTraceIn], (err, out) => {
- if (err) {
- logError('dumpStacktrace: Failed to produce stack trace' + err);
- return;
- }
- const locations = this.delve.isApiV1 ? <DebugLocation[]>out : (<StacktraceOut>out).Locations;
- log('locations', locations);
- const stackFrames = locations.map((location, frameId) => {
- const uniqueStackFrameId = this.stackFrameHandles.create([goroutineId, frameId]);
- return new StackFrame(
- uniqueStackFrameId,
- location.function ? location.function.name : '<unknown>',
- location.file === '<autogenerated>' ? null : new Source(
- path.basename(location.file),
- this.toLocalPath(location.file)
- ),
- location.line,
- 0
- );
- });
-
- // Dump stacktrace into error logger
- logError(`Last known immediate stacktrace (goroutine id ${goroutineId}):`);
- let output = '';
- stackFrames.forEach((stackFrame) => {
- output = output.concat(`\t${stackFrame.source.path}:${stackFrame.line}\n`);
- if (stackFrame.name) {
- output = output.concat(`\t\t${stackFrame.name}\n`);
- }
- });
- logError(output);
+ this.delve.isApiV1 ? 'StacktraceGoroutine' : 'Stacktrace',
+ [stackTraceIn],
+ (err, out) => {
+ if (err) {
+ logError('dumpStacktrace: Failed to produce stack trace' + err);
+ return;
+ }
+ const locations = this.delve.isApiV1 ? <DebugLocation[]>out : (<StacktraceOut>out).Locations;
+ log('locations', locations);
+ const stackFrames = locations.map((location, frameId) => {
+ const uniqueStackFrameId = this.stackFrameHandles.create([goroutineId, frameId]);
+ return new StackFrame(
+ uniqueStackFrameId,
+ location.function ? location.function.name : '<unknown>',
+ location.file === '<autogenerated>'
+ ? null
+ : new Source(path.basename(location.file), this.toLocalPath(location.file)),
+ location.line,
+ 0
+ );
});
+
+ // Dump stacktrace into error logger
+ logError(`Last known immediate stacktrace (goroutine id ${goroutineId}):`);
+ let output = '';
+ stackFrames.forEach((stackFrame) => {
+ output = output.concat(`\t${stackFrame.source.path}:${stackFrame.line}\n`);
+ if (stackFrame.name) {
+ output = output.concat(`\t\t${stackFrame.name}\n`);
+ }
+ });
+ logError(output);
+ }
+ );
}
}
diff --git a/src/goInstallTools.ts b/src/goInstallTools.ts
index 9c90714..a483e35 100644
--- a/src/goInstallTools.ts
+++ b/src/goInstallTools.ts
@@ -363,7 +363,7 @@
const updateMsg = `Your version of ${tool.name} appears to be out of date. Please update for an improved experience.`;
const choices: string[] = ['Update'];
if (toolName === `gopls`) {
- choices.push('Release Notes'); // TODO(hyangah): pass more info such as version, release note location.
+ choices.push('Release Notes'); // TODO(hyangah): pass more info such as version, release note location.
}
vscode.window.showInformationMessage(updateMsg, ...choices).then((selected) => {
switch (selected) {
@@ -371,7 +371,10 @@
installTools([tool], goVersion);
break;
case 'Release Notes':
- vscode.commands.executeCommand('vscode.open', vscode.Uri.parse('https://github.com/golang/go/issues/33030#issuecomment-510151934'));
+ vscode.commands.executeCommand(
+ 'vscode.open',
+ vscode.Uri.parse('https://github.com/golang/go/issues/33030#issuecomment-510151934')
+ );
break;
default:
declinedUpdates.push(tool);
diff --git a/src/goLanguageServer.ts b/src/goLanguageServer.ts
index d6ebd73..1b3604c 100644
--- a/src/goLanguageServer.ts
+++ b/src/goLanguageServer.ts
@@ -160,9 +160,12 @@
// { languageId: 'go', uri: document.uri });
const editorParamHintsEnabled = vscode.workspace.getConfiguration(
- 'editor.parameterHints', document.uri)['enabled'];
- const goParamHintsEnabled = vscode.workspace.getConfiguration(
- '[go]', document.uri)['editor.parameterHints.enabled'];
+ 'editor.parameterHints',
+ document.uri
+ )['enabled'];
+ const goParamHintsEnabled = vscode.workspace.getConfiguration('[go]', document.uri)[
+ 'editor.parameterHints.enabled'
+ ];
let paramHintsEnabled: boolean = false;
if (typeof goParamHintsEnabled === 'undefined') {
@@ -176,8 +179,8 @@
}
function configureCommands(
- r: vscode.CompletionItem[] | vscode.CompletionList | null | undefined):
- vscode.CompletionItem[] | vscode.CompletionList | null | undefined {
+ r: vscode.CompletionItem[] | vscode.CompletionList | null | undefined
+ ): vscode.CompletionItem[] | vscode.CompletionList | null | undefined {
if (r) {
(Array.isArray(r) ? r : r.items).forEach((i: vscode.CompletionItem) => {
i.command = cmd;
@@ -187,12 +190,12 @@
}
const ret = next(document, position, context, token);
- const isThenable = <T>(obj: vscode.ProviderResult<T>): obj is Thenable<T> => obj && (<any>obj)['then'];
+ const isThenable = <T>(obj: vscode.ProviderResult<T>): obj is Thenable<T> =>
+ obj && (<any>obj)['then'];
if (isThenable<vscode.CompletionItem[] | vscode.CompletionList | null | undefined>(ret)) {
return ret.then(configureCommands);
}
return configureCommands(ret);
-
}
}
}
diff --git a/src/telemetry.ts b/src/telemetry.ts
index b06ae39..c417c44 100644
--- a/src/telemetry.ts
+++ b/src/telemetry.ts
@@ -184,7 +184,7 @@
measures?: { [key: string]: number }
): void {
if (!aiKey) {
- return; // cannot enable telemetry
+ return; // cannot enable telemetry
}
telemtryReporter = telemtryReporter
? telemtryReporter