From 6c9c523dcb7b8dc41a88fe4bc4f9674cb7982156 Mon Sep 17 00:00:00 2001 From: Daniel Santos Date: Thu, 2 Feb 2023 12:06:02 -0600 Subject: [PATCH 1/2] Print gorename command with go.logging.level >= verbose Fixes golang/vscode-go#2634, or at least it might. I don't know how to build this project, don't know typescript, etc. --- src/language/legacy/goRename.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/language/legacy/goRename.ts b/src/language/legacy/goRename.ts index 5a864c28ce..de574555c3 100644 --- a/src/language/legacy/goRename.ts +++ b/src/language/legacy/goRename.ts @@ -15,6 +15,7 @@ import { promptForMissingTool } from '../../goInstallTools'; import { outputChannel } from '../../goStatus'; import { byteOffsetAt, canonicalizeGOPATHPrefix, getBinPath } from '../../util'; import { killProcessTree } from '../../utils/processUtils'; +import { logVerbose } from '../../goLogging'; export class GoRenameProvider implements vscode.RenameProvider { public provideRenameEdits( @@ -57,6 +58,7 @@ export class GoRenameProvider implements vscode.RenameProvider { token.onCancellationRequested(() => killProcessTree(p)); } + logVerbose(`$ ${gorename} ${gorenameArgs} (cwd: ${opts.cwd})`); p = cp.execFile(gorename, gorenameArgs, { env }, (err, stdout, stderr) => { try { if (err && (err).code === 'ENOENT') { From 941132a31916c089e483c627e36ac7de9889c70b Mon Sep 17 00:00:00 2001 From: Daniel Santos Date: Thu, 2 Feb 2023 12:50:25 -0600 Subject: [PATCH 2/2] Add depreciation notice when gorename is used. --- src/language/legacy/goRename.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/language/legacy/goRename.ts b/src/language/legacy/goRename.ts index de574555c3..c82a7337ce 100644 --- a/src/language/legacy/goRename.ts +++ b/src/language/legacy/goRename.ts @@ -16,6 +16,7 @@ import { outputChannel } from '../../goStatus'; import { byteOffsetAt, canonicalizeGOPATHPrefix, getBinPath } from '../../util'; import { killProcessTree } from '../../utils/processUtils'; import { logVerbose } from '../../goLogging'; +import { logWarn } from '../../goLogging'; export class GoRenameProvider implements vscode.RenameProvider { public provideRenameEdits( @@ -58,6 +59,7 @@ export class GoRenameProvider implements vscode.RenameProvider { token.onCancellationRequested(() => killProcessTree(p)); } + logWarn(`Support for ${gorename} is deprecated in favor of gopls and will be removed in a future version.`) logVerbose(`$ ${gorename} ${gorenameArgs} (cwd: ${opts.cwd})`); p = cp.execFile(gorename, gorenameArgs, { env }, (err, stdout, stderr) => { try {