diff --git a/docs/tools.md b/docs/tools.md index 4bcc3760e5..95465d3263 100644 --- a/docs/tools.md +++ b/docs/tools.md @@ -46,7 +46,7 @@ This tool provides the information needed to compute the various test code lense This tool provides support for the [`Go: Run on Go Playground`](features.md#go-playground) command. -### [`gomodifytags`](https://pkg.go.dev/github.com/fatih/gomodifytags?tab=overview) +### [`gopmodifytags`](https://pkg.go.dev/github.com/goplus/gopmodifytags?tab=overview) This tool provides support for the [`Go: Add Tags to Struct Fields`](features.md#add-or-remove-struct-tags) and [`Go: Remove Tags From Struct Fields`](features.md#add-or-remove-struct-tags) commands. diff --git a/package.json b/package.json index dda9d81785..e66aa194ea 100644 --- a/package.json +++ b/package.json @@ -442,12 +442,12 @@ { "command": "gop.add.tags", "title": "Go+: Add Tags To Struct Fields", - "description": "Add tags configured in go.addTags setting to selected struct using gomodifytags" + "description": "Add tags configured in go.addTags setting to selected struct using gopmodifytags" }, { "command": "gop.remove.tags", "title": "Go+: Remove Tags From Struct Fields", - "description": "Remove tags configured in go.removeTags setting from selected struct using gomodifytags" + "description": "Remove tags configured in go.removeTags setting from selected struct using gopmodifytags" }, { "command": "gop.fill.struct", diff --git a/src/goModifytags.ts b/src/goModifytags.ts index 5cd87ece75..e28739d777 100644 --- a/src/goModifytags.ts +++ b/src/goModifytags.ts @@ -92,7 +92,7 @@ function getCommonArgs(): string[] { vscode.window.showInformationMessage('No editor is active.'); return []; } - if (!editor.document.fileName.endsWith('.go')) { + if (!editor.document.fileName.endsWith('.go') && !editor.document.fileName.endsWith('.gop')) { vscode.window.showInformationMessage('Current file is not a Go file.'); return []; } @@ -162,7 +162,7 @@ function getTagsAndOptions(config: GoTagsConfig, commandArgs: GoTagsConfig): The } function runGomodifytags(args: string[]) { - const gomodifytags = getBinPath('gomodifytags'); + const gomodifytags = getBinPath('gopmodifytags'); const editor = vscode.window.activeTextEditor; if (!editor) { return; @@ -170,14 +170,14 @@ function runGomodifytags(args: string[]) { const input = getFileArchive(editor.document); const p = cp.execFile(gomodifytags, args, { env: toolExecutionEnvironment() }, (err, stdout, stderr) => { if (err && (err).code === 'ENOENT') { - promptForMissingTool('gomodifytags'); + promptForMissingTool('gopmodifytags'); return; } if (err && (err).code === 2 && args.indexOf('--template') > 0) { vscode.window.showInformationMessage( 'Cannot modify tags: you might be using a' + 'version that does not support --template' ); - promptForUpdatingTool('gomodifytags'); + promptForUpdatingTool('gopmodifytags'); return; } if (err) { diff --git a/src/goTools.ts b/src/goTools.ts index ddd82cd9d3..3c0ac9c94b 100644 --- a/src/goTools.ts +++ b/src/goTools.ts @@ -158,7 +158,7 @@ export function getConfiguredTools( 'guru', 'gorename', 'gotests', - 'gomodifytags', + 'gopmodifytags', 'impl', 'fillstruct', 'goplay', diff --git a/src/goToolsInformation.ts b/src/goToolsInformation.ts index 7487c44119..5d632e5b60 100644 --- a/src/goToolsInformation.ts +++ b/src/goToolsInformation.ts @@ -59,14 +59,14 @@ export const allToolsInformation: { [key: string]: Tool } = { isImportant: false, description: 'Rename symbols' }, - 'gomodifytags': { - name: 'gomodifytags', - importPath: 'github.com/fatih/gomodifytags', - modulePath: 'github.com/fatih/gomodifytags', + 'gopmodifytags': { + name: 'gopmodifytags', + importPath: 'github.com/goplus/gopmodifytags', + modulePath: 'github.com/goplus/gopmodifytags', replacedByGopls: false, isImportant: false, description: 'Modify tags on structs', - defaultVersion: 'v1.16.0' + defaultVersion: 'v1.0.0' }, 'goplay': { name: 'goplay', diff --git a/tools/allTools.ts.in b/tools/allTools.ts.in index 0e6fcb9ff7..615022e2ad 100644 --- a/tools/allTools.ts.in +++ b/tools/allTools.ts.in @@ -57,14 +57,14 @@ export const allToolsInformation: { [key: string]: Tool } = { isImportant: false, description: 'Rename symbols' }, - 'gomodifytags': { - name: 'gomodifytags', - importPath: 'github.com/fatih/gomodifytags', - modulePath: 'github.com/fatih/gomodifytags', + 'gopmodifytags': { + name: 'gopmodifytags', + importPath: 'github.com/goplus/gopmodifytags', + modulePath: 'github.com/goplus/gopmodifytags', replacedByGopls: false, isImportant: false, description: 'Modify tags on structs', - defaultVersion: 'v1.16.0' + defaultVersion: 'v1.0.0' }, 'goplay': { name: 'goplay',