From b4f3b174e46852b1f70ea2156dbce56ea94ad7c9 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Fri, 13 Oct 2023 16:17:37 +0800 Subject: [PATCH 01/10] vscode-gop 0.1.0-dev --- media/goplus-logo-black.svg | 20 +++ media/goplus-logo-white.svg | 24 +++ package.json | 56 +++++-- snippets/gop.json | 274 +++++++++++++++++++++++++++++++ src/const.ts | 2 +- src/goToolsInformation.ts | 16 +- src/language/goLanguageServer.ts | 5 + src/welcome.ts | 24 ++- 8 files changed, 389 insertions(+), 32 deletions(-) create mode 100644 media/goplus-logo-black.svg create mode 100644 media/goplus-logo-white.svg create mode 100644 snippets/gop.json diff --git a/media/goplus-logo-black.svg b/media/goplus-logo-black.svg new file mode 100644 index 0000000000..0d34eab706 --- /dev/null +++ b/media/goplus-logo-black.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + diff --git a/media/goplus-logo-white.svg b/media/goplus-logo-white.svg new file mode 100644 index 0000000000..7ed271d1de --- /dev/null +++ b/media/goplus-logo-white.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + diff --git a/package.json b/package.json index fcd7d0b569..b1a0ba5150 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "go", - "displayName": "Go", - "version": "0.40.0-dev", + "name": "gop", + "displayName": "Go+", + "version": "0.1.0-dev", "preview": true, - "publisher": "golang", - "description": "Rich Go language support for Visual Studio Code", + "publisher": "goplus", + "description": "Rich Go/Go+ language support for Visual Studio Code", "author": { - "name": "Go Team at Google" + "name": "GoPlus Team" }, "license": "MIT", "icon": "media/go-logo-blue.png", @@ -25,15 +25,15 @@ "private": true, "repository": { "type": "git", - "url": "https://github.com/golang/vscode-go" + "url": "https://github.com/goplus/vscode-gop" }, "bugs": { - "url": "https://github.com/golang/vscode-go/issues" + "url": "https://github.com/goplus/vscode-gop/issues" }, "keywords": [ "multi-root ready", - "golang", - "gopls" + "goplus", + "goxls" ], "scripts": { "clean": "rm -rf ./dist/* && rm *.vsix", @@ -95,9 +95,13 @@ }, "activationEvents": [ "onLanguage:go", + "onLanguage:gop", "workspaceContains:*.go", "workspaceContains:*/*.go", "workspaceContains:*/*/*.go", + "workspaceContains:**/*.gop", + "workspaceContains:**/*.spx", + "workspaceContains:**/*.rdx", "onCommand:go.gopath", "onCommand:go.goroot", "onCommand:go.tools.install", @@ -136,6 +140,19 @@ "Go" ] }, + { + "id": "gop", + "extensions": [ + ".gop", + ".spx", + ".rdx", + ".gmx", + ".gox" + ], + "aliases": [ + "Goplus" + ] + }, { "id": "go.mod", "filenames": [ @@ -147,6 +164,16 @@ ], "configuration": "./languages/go.mod.language-configuration.json" }, + { + "id": "gop.mod", + "filenames": [ + "gop.mod" + ], + "aliases": [ + "Go+ Module File" + ], + "configuration": "./languages/go.mod.language-configuration.json" + }, { "id": "go.work", "filenames": [ @@ -189,6 +216,11 @@ "scopeName": "go.mod", "path": "./syntaxes/go.mod.tmGrammar.json" }, + { + "language": "gop.mod", + "scopeName": "gop.mod", + "path": "./syntaxes/go.mod.tmGrammar.json" + }, { "language": "go.work", "scopeName": "go.mod", @@ -209,6 +241,10 @@ { "language": "go", "path": "./snippets/go.json" + }, + { + "language": "gop", + "path": "./snippets/gop.json" } ], "configurationDefaults": { diff --git a/snippets/gop.json b/snippets/gop.json new file mode 100644 index 0000000000..83890d58a5 --- /dev/null +++ b/snippets/gop.json @@ -0,0 +1,274 @@ +{ + ".source.go": { + "single import": { + "prefix": "im", + "body": "import \"${1:package}\"", + "description": "Snippet for import statement" + }, + "multiple imports": { + "prefix": "ims", + "body": "import (\n\t\"${1:package}\"\n)", + "description": "Snippet for a import block" + }, + "single constant": { + "prefix": "co", + "body": "const ${1:name} = ${2:value}", + "description": "Snippet for a constant" + }, + "multiple constants": { + "prefix": "cos", + "body": "const (\n\t${1:name} = ${2:value}\n)", + "description": "Snippet for a constant block" + }, + "type function declaration": { + "prefix": "tyf", + "body": "type ${1:name} func($3) $4", + "description": "Snippet for a type function declaration" + }, + "type interface declaration": { + "prefix": "tyi", + "body": "type ${1:name} interface {\n\t$0\n}", + "description": "Snippet for a type interface" + }, + "type struct declaration": { + "prefix": "tys", + "body": "type ${1:name} struct {\n\t$0\n}", + "description": "Snippet for a struct declaration" + }, + "package main and main function": { + "prefix": "pkgm", + "body": "package main\n\nfunc main() {\n\t$0\n}", + "description": "Snippet for main package & function" + }, + "function declaration": { + "prefix": "func", + "body": "func $1($2) $3 {\n\t$0\n}", + "description": "Snippet for function declaration" + }, + "single variable": { + "prefix": "var", + "body": "var ${1:name} ${2:type}", + "description": "Snippet for a variable" + }, + "multiple variables": { + "prefix": "vars", + "body": "var (\n\t${1:name} ${2:type}\n)", + "description": "Snippet for variable block" + }, + "switch statement": { + "prefix": "switch", + "body": "switch ${1:expression} {\ncase ${2:condition}:\n\t$0\n}", + "description": "Snippet for switch statement" + }, + "select statement": { + "prefix": "sel", + "body": "select {\ncase ${1:condition}:\n\t$0\n}", + "description": "Snippet for select statement" + }, + "case clause": { + "prefix": "cs", + "body": "case ${1:condition}:$0", + "description": "Snippet for case clause" + }, + "for statement": { + "prefix": "for", + "body": "for ${1:i} := ${2:0}; $1 < ${3:count}; $1${4:++} {\n\t$0\n}", + "description": "Snippet for a for loop" + }, + "for range statement": { + "prefix": "forr", + "body": "for ${1:_, }${2:v} := range ${3:v} {\n\t$0\n}", + "description": "Snippet for a for range loop" + }, + "channel declaration": { + "prefix": "ch", + "body": "chan ${1:type}", + "description": "Snippet for a channel" + }, + "map declaration": { + "prefix": "map", + "body": "map[${1:type}]${2:type}", + "description": "Snippet for a map" + }, + "empty interface": { + "prefix": "in", + "body": "interface{}", + "description": "Snippet for empty interface" + }, + "if statement": { + "prefix": "if", + "body": "if ${1:condition} {\n\t$0\n}", + "description": "Snippet for if statement" + }, + "else branch": { + "prefix": "el", + "body": "else {\n\t$0\n}", + "description": "Snippet for else branch" + }, + "if else statement": { + "prefix": "ie", + "body": "if ${1:condition} {\n\t$2\n} else {\n\t$0\n}", + "description": "Snippet for if else" + }, + "if err != nil": { + "prefix": "iferr", + "body": "if err != nil {\n\t${1:return ${2:nil, }${3:err}}\n}", + "description": "Snippet for if err != nil" + }, + "fmt.Println": { + "prefix": "fp", + "body": "fmt.Println(\"$1\")", + "description": "Snippet for fmt.Println()" + }, + "fmt.Printf": { + "prefix": "ff", + "body": "fmt.Printf(\"$1\", ${2:var})", + "description": "Snippet for fmt.Printf()" + }, + "log.Println": { + "prefix": "lp", + "body": "log.Println(\"$1\")", + "description": "Snippet for log.Println()" + }, + "log.Printf": { + "prefix": "lf", + "body": "log.Printf(\"$1\", ${2:var})", + "description": "Snippet for log.Printf()" + }, + "log variable content": { + "prefix": "lv", + "body": "log.Printf(\"${1:var}: %#+v\\\\n\", ${1:var})", + "description": "Snippet for log.Printf() with variable content" + }, + "t.Log": { + "prefix": "tl", + "body": "t.Log(\"$1\")", + "description": "Snippet for t.Log()" + }, + "t.Logf": { + "prefix": "tlf", + "body": "t.Logf(\"$1\", ${2:var})", + "description": "Snippet for t.Logf()" + }, + "t.Logf variable content": { + "prefix": "tlv", + "body": "t.Logf(\"${1:var}: %#+v\\\\n\", ${1:var})", + "description": "Snippet for t.Logf() with variable content" + }, + "make(...)": { + "prefix": "make", + "body": "make(${1:type}, ${2:0})", + "description": "Snippet for make statement" + }, + "new(...)": { + "prefix": "new", + "body": "new(${1:type})", + "description": "Snippet for new statement" + }, + "panic(...)": { + "prefix": "pn", + "body": "panic(\"$0\")", + "description": "Snippet for panic" + }, + "http ResponseWriter *Request": { + "prefix": "wr", + "body": "${1:w} http.ResponseWriter, ${2:r} *http.Request", + "description": "Snippet for http Response" + }, + "http.HandleFunc": { + "prefix": "hf", + "body": "${1:http}.HandleFunc(\"${2:/}\", ${3:handler})", + "description": "Snippet for http.HandleFunc()" + }, + "http handler declaration": { + "prefix": "hand", + "body": "func $1(${2:w} http.ResponseWriter, ${3:r} *http.Request) {\n\t$0\n}", + "description": "Snippet for http handler declaration" + }, + "http.Redirect": { + "prefix": "rd", + "body": "http.Redirect(${1:w}, ${2:r}, \"${3:/}\", ${4:http.StatusFound})", + "description": "Snippet for http.Redirect()" + }, + "http.Error": { + "prefix": "herr", + "body": "http.Error(${1:w}, ${2:err}.Error(), ${3:http.StatusInternalServerError})", + "description": "Snippet for http.Error()" + }, + "http.ListenAndServe": { + "prefix": "las", + "body": "http.ListenAndServe(\"${1::8080}\", ${2:nil})", + "description": "Snippet for http.ListenAndServe" + }, + "http.Serve": { + "prefix": "sv", + "body": "http.Serve(\"${1::8080}\", ${2:nil})", + "description": "Snippet for http.Serve" + }, + "goroutine anonymous function": { + "prefix": "go", + "body": "go func($1) {\n\t$0\n}($2)", + "description": "Snippet for anonymous goroutine declaration" + }, + "goroutine function": { + "prefix": "gf", + "body": "go ${1:func}($0)", + "description": "Snippet for goroutine declaration" + }, + "defer statement": { + "prefix": "df", + "body": "defer ${1:func}($0)", + "description": "Snippet for defer statement" + }, + "test function": { + "prefix": "tf", + "body": "func Test$1(t *testing.T) {\n\t$0\n}", + "description": "Snippet for Test function" + }, + "test main": { + "prefix": "tm", + "body": "func TestMain(m *testing.M) {\n\t$1\n\n\tos.Exit(m.Run())\n}", + "description": "Snippet for TestMain function" + }, + "benchmark function": { + "prefix": "bf", + "body": "func Benchmark$1(b *testing.B) {\n\tfor ${2:i} := 0; ${2:i} < b.N; ${2:i}++ {\n\t\t$0\n\t}\n}", + "description": "Snippet for Benchmark function" + }, + "example function": { + "prefix": "ef", + "body": "func Example$1() {\n\t$2\n\t//Output:\n\t$3\n}", + "description": "Snippet for Example function" + }, + "table driven test": { + "prefix": "tdt", + "body": "func Test$1(t *testing.T) {\n\ttestCases := []struct {\n\t\tdesc\tstring\n\t\t$2\n\t}{\n\t\t{\n\t\t\tdesc: \"$3\",\n\t\t\t$4\n\t\t},\n\t}\n\tfor _, tC := range testCases {\n\t\tt.Run(tC.desc, func(t *testing.T) {\n\t\t\t$0\n\t\t})\n\t}\n}", + "description": "Snippet for table driven test" + }, + "init function": { + "prefix": "finit", + "body": "func init() {\n\t$1\n}", + "description": "Snippet for init function" + }, + "main function": { + "prefix": "fmain", + "body": "func main() {\n\t$1\n}", + "description": "Snippet for main function" + }, + "method declaration": { + "prefix": "meth", + "body": "func (${1:receiver} ${2:type}) ${3:method}($4) $5 {\n\t$0\n}", + "description": "Snippet for method declaration" + }, + "hello world web app": { + "prefix": "helloweb", + "body": "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"time\"\n)\n\nfunc greet(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"Hello World! %s\", time.Now())\n}\n\nfunc main() {\n\thttp.HandleFunc(\"/\", greet)\n\thttp.ListenAndServe(\":8080\", nil)\n}", + "description": "Snippet for sample hello world webapp" + }, + "sort implementation": { + "prefix": "sort", + "body": "type ${1:SortBy} []${2:Type}\n\nfunc (a $1) Len() int { return len(a) }\nfunc (a $1) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a $1) Less(i, j int) bool { ${3:return a[i] < a[j]} }", + "description": "Snippet for a custom sort.Sort interface implementation, for a given slice type." + } + } +} diff --git a/src/const.ts b/src/const.ts index b1d276f55b..2c7d2f1338 100644 --- a/src/const.ts +++ b/src/const.ts @@ -9,4 +9,4 @@ // For example, we replace this file with the version in the build/nightly. // Make sure to reflect any changes in this file to build/nightly/const.ts. -export const extensionId = 'golang.go'; +export const extensionId = 'goplus.gop'; // goxls: Go+ diff --git a/src/goToolsInformation.ts b/src/goToolsInformation.ts index 1ad44e15f1..7487c44119 100644 --- a/src/goToolsInformation.ts +++ b/src/goToolsInformation.ts @@ -203,17 +203,17 @@ export const allToolsInformation: { [key: string]: Tool } = { }, 'gopls': { name: 'gopls', - importPath: 'golang.org/x/tools/gopls', - modulePath: 'golang.org/x/tools/gopls', + importPath: 'github.com/goplus/tools/goxls', // goxls: Go+ + modulePath: 'github.com/goplus/tools/goxls', replacedByGopls: false, // lol isImportant: true, - description: 'Language Server from Google', + description: 'Go+ Language Server', usePrereleaseInPreviewMode: true, - minimumGoVersion: semver.coerce('1.13'), - latestVersion: semver.parse('v0.12.2'), - latestVersionTimestamp: moment('2023-06-01', 'YYYY-MM-DD'), - latestPrereleaseVersion: semver.parse('v0.12.2'), - latestPrereleaseVersionTimestamp: moment('2023-06-01', 'YYYY-MM-DD') + minimumGoVersion: semver.coerce('1.18'), + latestVersion: semver.parse('v0.1.0'), + latestVersionTimestamp: moment('2023-10-11', 'YYYY-MM-DD'), + latestPrereleaseVersion: semver.parse('v0.1.0'), + latestPrereleaseVersionTimestamp: moment('2023-10-11', 'YYYY-MM-DD') }, 'dlv': { name: 'dlv', diff --git a/src/language/goLanguageServer.ts b/src/language/goLanguageServer.ts index a3f9f9ddfe..c7fc9041f6 100644 --- a/src/language/goLanguageServer.ts +++ b/src/language/goLanguageServer.ts @@ -164,6 +164,9 @@ export function scheduleGoplsSuggestions(goCtx: GoExtensionContext) { const usingGo = (): boolean => { return vscode.workspace.textDocuments.some((doc) => doc.languageId === 'go'); }; + const usingGop = (): boolean => { // goxls: Go+ + return vscode.workspace.textDocuments.some((doc) => doc.languageId === 'gop'); + }; const installGopls = async (cfg: LanguageServerConfig) => { const tool = getTool('gopls'); const versionToUpdate = await shouldUpdateLanguageServer(tool, cfg); @@ -423,6 +426,8 @@ export async function buildLanguageClient( const documentSelector = [ // gopls handles only file URIs. { language: 'go', scheme: 'file' }, + { language: 'gop', scheme: 'file' }, // goxls: Go+ + { language: 'gop.mod', scheme: 'file' }, // goxls: Go+ { language: 'go.mod', scheme: 'file' }, { language: 'go.sum', scheme: 'file' }, { language: 'go.work', scheme: 'file' }, diff --git a/src/welcome.ts b/src/welcome.ts index 98717b923b..255d27feac 100644 --- a/src/welcome.ts +++ b/src/welcome.ts @@ -54,7 +54,7 @@ export class WelcomePanel { // Otherwise, create a new panel. const panel = vscode.window.createWebviewPanel( WelcomePanel.viewType, - 'Go for VS Code', + 'Go+ for VS Code', column || vscode.ViewColumn.One, { // Enable javascript in the webview @@ -64,7 +64,7 @@ export class WelcomePanel { localResourceRoots: [joinPath(extensionUri)] } ); - panel.iconPath = joinPath(extensionUri, 'media', 'go-logo-blue.png'); + panel.iconPath = joinPath(extensionUri, 'media', 'goplus-logo-white.svg'); WelcomePanel.currentPanel = new WelcomePanel(panel, extensionUri); }; @@ -137,7 +137,7 @@ export class WelcomePanel { const scriptPathOnDisk = joinPath(this.dataroot, 'welcome.js'); const stylePath = joinPath(this.dataroot, 'welcome.css'); const announcePath = vscode.Uri.joinPath(this.dataroot, 'announce.png'); - const gopherPath = joinPath(this.dataroot, 'go-logo-blue.png'); + const gopherPath = joinPath(this.dataroot, 'goplus-logo-white.svg'); const goExtension = vscode.extensions.getExtension(extensionId)!; const goExtensionVersion = goExtension.packageJSON.version; @@ -161,24 +161,22 @@ export class WelcomePanel { - Go for VS Code + Go+ for VS Code
-

Go for VS Code v${goExtensionVersion}

-

The official Go extension for Visual Studio Code, providing rich language support for Go projects.

+

Go+ for VS Code v${goExtensionVersion}

+

The official Go+ extension for Visual Studio Code, providing rich language support for Go projects.

@@ -188,7 +186,7 @@ export class WelcomePanel {

New! We are excited to announce a new - code analysis feature + code analysis feature that surfaces known vulnerabilities in your dependencies.
This vulncheck analyzer is backed by @@ -199,7 +197,7 @@ export class WelcomePanel { Please share your feedback at go.dev/s/vsc-vulncheck-feedback, and report a bug in - our issue tracker. + our issue tracker.

@@ -208,7 +206,7 @@ export class WelcomePanel {

Getting started

Learn about the Go extension in our - README. + README.

@@ -226,7 +224,7 @@ export class WelcomePanel {

Troubleshooting

Experiencing problems? Start with our - troubleshooting guide.

+ troubleshooting guide.

From ace9407a4cee1b49fc1a0b3bf0bbe9261c6e6337 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Fri, 13 Oct 2023 22:49:56 +0800 Subject: [PATCH 02/10] conflict fix: registerTreeDataProvider & registerCommand --- .gitignore | 3 +- package.json | 372 +++++++++++++++++------------------- src/goDebugConfiguration.ts | 5 +- src/goEnvironmentStatus.ts | 3 +- src/goExplorer.ts | 13 +- src/goInstallTools.ts | 3 +- src/goMain.ts | 133 +++++++------ src/goTest/explore.ts | 18 +- src/welcome.ts | 3 +- 9 files changed, 281 insertions(+), 272 deletions(-) diff --git a/.gitignore b/.gitignore index e512f321a6..618ad5a647 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ out/ dist/ node_modules/ .vscode-test/ +.user-data-dir-test/ .DS_Store -.user-data-dir-test/ \ No newline at end of file +*.vsix diff --git a/package.json b/package.json index b1a0ba5150..a07db4c038 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "gop", + "name": "goplus", "displayName": "Go+", "version": "0.1.0-dev", "preview": true, @@ -102,16 +102,9 @@ "workspaceContains:**/*.gop", "workspaceContains:**/*.spx", "workspaceContains:**/*.rdx", - "onCommand:go.gopath", - "onCommand:go.goroot", - "onCommand:go.tools.install", - "onCommand:go.locate.tools", - "onCommand:go.show.commands", - "onCommand:go.run.modinit", "onDebugInitialConfigurations", "onDebugResolve:go", - "onWebviewPanel:welcomeGo", - "onView:go.test.profile" + "onWebviewPanel:welcomeGo" ], "main": "./dist/goMain.js", "capabilities": { @@ -258,336 +251,331 @@ }, "commands": [ { - "command": "go.gopath", - "title": "Go: Current GOPATH", - "description": "See the currently set GOPATH." + "command": "gop.goproot", + "title": "Go+: Current GOPROOT", + "description": "See the currently set GOPROOT." }, { - "command": "go.goroot", - "title": "Go: Current GOROOT", - "description": "See the currently set GOROOT." + "command": "gop.locate.tools", + "title": "Go+: Locate Configured Go Tools", + "description": "List all the Go+ tools being used by this extension along with their locations." }, { - "command": "go.locate.tools", - "title": "Go: Locate Configured Go Tools", - "description": "List all the Go tools being used by this extension along with their locations." - }, - { - "command": "go.test.cursor", - "title": "Go: Test Function At Cursor", + "command": "gop.test.cursor", + "title": "Go+: Test Function At Cursor", "description": "Runs a unit test at the cursor." }, { - "command": "go.test.cursorOrPrevious", - "title": "Go: Test Function At Cursor or Test Previous", + "command": "gop.test.cursorOrPrevious", + "title": "Go+: Test Function At Cursor or Test Previous", "description": "Runs a unit test at the cursor if one is found, otherwise re-runs the last executed test." }, { - "command": "go.subtest.cursor", - "title": "Go: Subtest At Cursor", + "command": "gop.subtest.cursor", + "title": "Go+: Subtest At Cursor", "description": "Runs a sub test at the cursor." }, { - "command": "go.debug.subtest.cursor", - "title": "Go: Debug Subtest At Cursor", + "command": "gop.debug.subtest.cursor", + "title": "Go+: Debug Subtest At Cursor", "description": "Debug a sub test at the cursor." }, { - "command": "go.benchmark.cursor", - "title": "Go: Benchmark Function At Cursor", + "command": "gop.benchmark.cursor", + "title": "Go+: Benchmark Function At Cursor", "description": "Runs a benchmark at the cursor." }, { - "command": "go.debug.cursor", - "title": "Go: Debug Test At Cursor", + "command": "gop.debug.cursor", + "title": "Go+: Debug Test At Cursor", "description": "Debug test at the cursor." }, { - "command": "go.test.file", - "title": "Go: Test File", + "command": "gop.test.file", + "title": "Go+: Test File", "description": "Runs all unit tests in the current file." }, { - "command": "go.test.package", - "title": "Go: Test Package", + "command": "gop.test.package", + "title": "Go+: Test Package", "description": "Runs all unit tests in the package of the current file." }, { - "command": "go.test.refresh", - "title": "Go Test: Refresh", + "command": "gop.test.refresh", + "title": "Go+ Test: Refresh", "description": "Refresh a test in the test explorer. Only available as a context menu option in the test explorer.", "category": "Test", "icon": "$(refresh)" }, { - "command": "go.test.showProfiles", - "title": "Go Test: Show Last Profile", + "command": "gop.test.showProfiles", + "title": "Go+ Test: Show Last Profile", "description": "Show last captured profile", "category": "Test" }, { - "command": "go.test.captureProfile", - "title": "Go Test: Profile", + "command": "gop.test.captureProfile", + "title": "Go+ Test: Profile", "description": "Run a test and capture a profile", "category": "Test" }, { - "command": "go.test.deleteProfile", - "title": "Go Test: Delete Profile", + "command": "gop.test.deleteProfile", + "title": "Go+ Test: Delete Profile", "shortTitle": "Delete", "description": "Delete selected profile", "category": "Test" }, { - "command": "go.test.showProfileFile", - "title": "Go: Show pprof file", + "command": "gop.test.showProfileFile", + "title": "Go+: Show pprof file", "description": "Internal use. Open a pprof profile file." }, { - "command": "go.benchmark.package", - "title": "Go: Benchmark Package", + "command": "gop.benchmark.package", + "title": "Go+: Benchmark Package", "description": "Runs all benchmarks in the package of the current file." }, { - "command": "go.benchmark.file", - "title": "Go: Benchmark File", + "command": "gop.benchmark.file", + "title": "Go+: Benchmark File", "description": "Runs all benchmarks in the current file." }, { - "command": "go.test.workspace", - "title": "Go: Test All Packages In Workspace", + "command": "gop.test.workspace", + "title": "Go+: Test All Packages In Workspace", "description": "Runs all unit tests from all packages in the current workspace." }, { - "command": "go.test.previous", - "title": "Go: Test Previous", + "command": "gop.test.previous", + "title": "Go+: Test Previous", "description": "Re-runs the last executed test." }, { - "command": "go.debug.previous", - "title": "Go: Debug Previous", + "command": "gop.debug.previous", + "title": "Go+: Debug Previous", "description": "Re-runs the last debugged test run through a codelens or \"Go: Debug Test at Cursor\" command." }, { - "command": "go.test.coverage", - "title": "Go: Toggle Test Coverage In Current Package", + "command": "gop.test.coverage", + "title": "Go+: Toggle Test Coverage In Current Package", "description": "Displays test coverage in the current package." }, { - "command": "go.test.generate.package", - "title": "Go: Generate Unit Tests For Package", + "command": "gop.test.generate.package", + "title": "Go+: Generate Unit Tests For Package", "description": "Generates unit tests for the current package" }, { - "command": "go.test.generate.file", - "title": "Go: Generate Unit Tests For File", + "command": "gop.test.generate.file", + "title": "Go+: Generate Unit Tests For File", "description": "Generates unit tests for the current file" }, { - "command": "go.test.generate.function", - "title": "Go: Generate Unit Tests For Function", + "command": "gop.test.generate.function", + "title": "Go+: Generate Unit Tests For Function", "description": "Generates unit tests for the selected function in the current file" }, { - "command": "go.impl.cursor", - "title": "Go: Generate Interface Stubs", + "command": "gop.impl.cursor", + "title": "Go+: Generate Interface Stubs", "description": "Generates method stub for implementing the provided interface and inserts at the cursor." }, { - "command": "go.extractServerChannel", - "title": "Go: Extract Language Server Logs To Editor", + "command": "gop.extractServerChannel", + "title": "Go+: Extract Language Server Logs To Editor", "description": "Extract logs in the `gopls (server)` output channel to the editor." }, { - "command": "go.welcome", - "title": "Go: Welcome", + "command": "gop.welcome", + "title": "Go+: Welcome", "description": "Open the welcome page for the Go extension." }, { - "command": "go.toggle.gc_details", - "title": "Go: Toggle gc details", + "command": "gop.toggle.gc_details", + "title": "Go+: Toggle gc details", "description": "Toggle the display of compiler optimization choices" }, { - "command": "go.import.add", - "title": "Go: Add Import", + "command": "gop.import.add", + "title": "Go+: Add Import", "description": "Add an import declaration" }, { - "command": "go.add.package.workspace", - "title": "Go: Add Package to Workspace", + "command": "gop.add.package.workspace", + "title": "Go+: Add Package to Workspace", "description": "Add a package from the imports list to the workspace." }, { - "command": "go.tools.install", - "title": "Go: Install/Update Tools", + "command": "gop.tools.install", + "title": "Go+: Install/Update Tools", "description": "install/update the required go packages" }, { - "command": "go.toggle.test.file", - "title": "Go: Toggle Test File", + "command": "gop.toggle.test.file", + "title": "Go+: Toggle Test File", "description": "Toggles between file in current active editor and the corresponding test file." }, { - "command": "go.vulncheck.toggle", - "title": "Go: Toggle Vulncheck", + "command": "gop.vulncheck.toggle", + "title": "Go+: Toggle Vulncheck", "description": "Toggle the display of vulnerability analysis in dependencies." }, { - "command": "go.languageserver.maintain", - "title": "Go: Start language server's maintainer interface", + "command": "gop.languageserver.maintain", + "title": "Go+: Start language server's maintainer interface", "description": "Start the Go language server's maintainer interface (a web server)." }, { - "command": "go.add.tags", - "title": "Go: Add Tags To Struct Fields", + "command": "gop.add.tags", + "title": "Go+: Add Tags To Struct Fields", "description": "Add tags configured in go.addTags setting to selected struct using gomodifytags" }, { - "command": "go.remove.tags", - "title": "Go: Remove Tags From Struct Fields", + "command": "gop.remove.tags", + "title": "Go+: Remove Tags From Struct Fields", "description": "Remove tags configured in go.removeTags setting from selected struct using gomodifytags" }, { - "command": "go.fill.struct", - "title": "Go: Fill struct", + "command": "gop.fill.struct", + "title": "Go+: Fill struct", "description": "Fill a struct literal with default values" }, { - "command": "go.show.commands", - "title": "Go: Show All Commands...", + "command": "gop.show.commands", + "title": "Go+: Show All Commands...", "description": "Shows all commands from the Go extension in the quick pick" }, { - "command": "go.browse.packages", - "title": "Go: Browse Packages", + "command": "gop.browse.packages", + "title": "Go+: Browse Packages", "description": "Browse packages and Go files inside the packages." }, { - "command": "go.get.package", - "title": "Go: Get Package", - "description": "Run `go get -v` on the package on the current line." + "command": "gop.get.package", + "title": "Go+: Get Package", + "description": "Run `gop get -v` on the package on the current line." }, { - "command": "go.playground", - "title": "Go: Run on Go Playground", - "description": "Upload the current selection or file to the Go Playground" + "command": "gop.playground", + "title": "Go+: Run on Go Playground", + "description": "Upload the current selection or file to the Go+ Playground" }, { - "command": "go.lint.package", - "title": "Go: Lint Current Package", + "command": "gop.lint.package", + "title": "Go+: Lint Current Package", "description": "Run linter in the package of the current file." }, { - "command": "go.lint.workspace", - "title": "Go: Lint Workspace", + "command": "gop.lint.workspace", + "title": "Go+: Lint Workspace", "description": "Run linter in the current workspace." }, { - "command": "go.vet.package", - "title": "Go: Vet Current Package", - "description": "Run go vet in the package of the current file." + "command": "gop.vet.package", + "title": "Go+: Vet Current Package", + "description": "Run gop vet in the package of the current file." }, { - "command": "go.vet.workspace", - "title": "Go: Vet Workspace", + "command": "gop.vet.workspace", + "title": "Go+: Vet Workspace", "description": "Run go vet in the current workspace." }, { - "command": "go.build.package", - "title": "Go: Build Current Package", + "command": "gop.build.package", + "title": "Go+: Build Current Package", "description": "Build the package of the current file." }, { - "command": "go.build.workspace", - "title": "Go: Build Workspace", + "command": "gop.build.workspace", + "title": "Go+: Build Workspace", "description": "Build the current workspace." }, { - "command": "go.install.package", - "title": "Go: Install Current Package", + "command": "gop.install.package", + "title": "Go+: Install Current Package", "description": "Install the current package." }, { - "command": "go.run.modinit", - "title": "Go: Initialize go.mod", - "description": "Run `go mod init` in the workspace folder." + "command": "gop.run.modinit", + "title": "Go+: Initialize gop.mod", + "description": "Run `gop mod init` in the workspace folder." }, { - "command": "go.test.cancel", - "title": "Go: Cancel Running Tests", + "command": "gop.test.cancel", + "title": "Go+: Cancel Running Tests", "description": "Cancels running tests." }, { - "command": "go.apply.coverprofile", - "title": "Go: Apply Cover Profile", + "command": "gop.apply.coverprofile", + "title": "Go+: Apply Cover Profile", "description": "Applies existing cover profile." }, { - "command": "go.godoctor.extract", - "title": "Go: Extract to function", + "command": "gop.godoctor.extract", + "title": "Go+: Extract to function", "description": "Extract to function using godoctor." }, { - "command": "go.godoctor.var", - "title": "Go: Extract to variable", + "command": "gop.godoctor.var", + "title": "Go+: Extract to variable", "description": "Extract to variable using godoctor." }, { - "command": "go.languageserver.restart", - "title": "Go: Restart Language Server", + "command": "gop.languageserver.restart", + "title": "Go+: Restart Language Server", "description": "Restart the running instance of the language server" }, { - "command": "go.environment.choose", - "title": "Go: Choose Go Environment", - "description": "Choose a different Go version or binary for this project. (WIP)" + "command": "gop.environment.choose", + "title": "Go+: Choose Go+ Environment", + "description": "Choose a different Go+ version or binary for this project. (WIP)" }, { - "command": "go.survey.showConfig", - "title": "Go: Show Survey Configuration", - "description": "Show the current Go survey configuration" + "command": "gop.survey.showConfig", + "title": "Go+: Show Survey Configuration", + "description": "Show the current Go+ survey configuration" }, { - "command": "go.survey.resetConfig", - "title": "Go: Reset Survey Configuration", - "description": "Reset the current Go survey configuration history" + "command": "gop.survey.resetConfig", + "title": "Go+: Reset Survey Configuration", + "description": "Reset the current Go+ survey configuration history" }, { - "command": "go.workspace.resetState", - "title": "Go: Reset Workspace State", + "command": "gop.workspace.resetState", + "title": "Go+: Reset Workspace State", "description": "Reset keys in workspace state to undefined." }, { - "command": "go.global.resetState", - "title": "Go: Reset Global State", + "command": "gop.global.resetState", + "title": "Go+: Reset Global State", "description": "Reset keys in global state to undefined." }, { - "command": "go.explorer.refresh", - "title": "Go Explorer: Refresh", - "description": "Refresh the Go explorer. Only available as a menu item in the explorer.", + "command": "gop.explorer.refresh", + "title": "Go+ Explorer: Refresh", + "description": "Refresh the Go+ explorer. Only available as a menu item in the explorer.", "category": "Explorer", "icon": "$(refresh)" }, { - "command": "go.explorer.open", - "title": "Go Explorer: Open File", - "description": "Open a file from the Go explorer. Only available as a menu item in the explorer.", + "command": "gop.explorer.open", + "title": "Go+ Explorer: Open File", + "description": "Open a file from the Go+ explorer. Only available as a menu item in the explorer.", "category": "Explorer", "icon": "$(go-to-file)" }, { - "command": "go.workspace.editEnv", - "title": "Go: Edit Workspace Env", + "command": "gop.workspace.editEnv", + "title": "Go+: Edit Workspace Env", "description": "Edit the Go Env for the active workspace.", "icon": "$(settings-edit)", "enablement": "workspaceFolderCount > 0" }, { - "command": "go.workspace.resetEnv", - "title": "Go: Reset Workspace Env", - "description": "Reset the Go Env for the active workspace.", + "command": "gop.workspace.resetEnv", + "title": "Go+: Reset Workspace Env", + "description": "Reset the Go+ Env for the active workspace.", "icon": "$(settings-remove)", "enablement": "workspaceFolderCount > 0" } @@ -1151,7 +1139,7 @@ ], "configuration": { "type": "object", - "title": "Go", + "title": "Go+", "properties": { "go.showWelcome": { "type": "boolean", @@ -2775,157 +2763,157 @@ "menus": { "commandPalette": [ { - "command": "go.test.refresh", + "command": "gop.test.refresh", "when": "false" }, { - "command": "go.test.showProfiles", + "command": "gop.test.showProfiles", "when": "false" }, { - "command": "go.test.captureProfile", + "command": "gop.test.captureProfile", "when": "false" }, { - "command": "go.test.deleteProfile", + "command": "gop.test.deleteProfile", "when": "false" }, { - "command": "go.test.showProfileFile", + "command": "gop.test.showProfileFile", "when": "false" }, { - "command": "go.explorer.refresh", + "command": "gop.explorer.refresh", "when": "false" }, { - "command": "go.explorer.open", + "command": "gop.explorer.open", "when": "false" } ], "editor/context": [ { "when": "editorTextFocus && config.go.editorContextMenuCommands.toggleTestFile && resourceLangId == go", - "command": "go.toggle.test.file", + "command": "gop.toggle.test.file", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.addTags && resourceLangId == go", - "command": "go.add.tags", + "command": "gop.add.tags", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.removeTags && resourceLangId == go", - "command": "go.remove.tags", + "command": "gop.remove.tags", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.fillStruct && resourceLangId == go", - "command": "go.fill.struct", + "command": "gop.fill.struct", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.testAtCursor && resourceLangId == go", - "command": "go.test.cursor", + "command": "gop.test.cursor", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.benchmarkAtCursor && resourceLangId == go", - "command": "go.benchmark.cursor", + "command": "gop.benchmark.cursor", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.debugTestAtCursor && resourceLangId == go", - "command": "go.debug.cursor", + "command": "gop.debug.cursor", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.testFile && resourceLangId == go", - "command": "go.test.file", + "command": "gop.test.file", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.testPackage && resourceLangId == go", - "command": "go.test.package", + "command": "gop.test.package", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.generateTestForFunction && resourceLangId == go", - "command": "go.test.generate.function", + "command": "gop.test.generate.function", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.generateTestForFile && resourceLangId == go", - "command": "go.test.generate.file", + "command": "gop.test.generate.file", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.generateTestForPackage && resourceLangId == go", - "command": "go.test.generate.package", + "command": "gop.test.generate.package", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.addImport && resourceLangId == go", - "command": "go.import.add", + "command": "gop.import.add", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.testCoverage && resourceLangId == go", - "command": "go.test.coverage", + "command": "gop.test.coverage", "group": "Go group 1" }, { "when": "editorTextFocus && config.go.editorContextMenuCommands.playground && resourceLangId == go", - "command": "go.playground", + "command": "gop.playground", "group": "Go group 1" }, { "when": "editorTextFocus && resourceLangId == go", - "command": "go.show.commands", + "command": "gop.show.commands", "group": "Go group 2" } ], "testing/item/context": [ { - "command": "go.test.refresh", + "command": "gop.test.refresh", "when": "testId in go.tests", "group": "inline" }, { - "command": "go.test.showProfiles", + "command": "gop.test.showProfiles", "when": "testId in go.profiledTests", "group": "profile" }, { - "command": "go.test.captureProfile", + "command": "gop.test.captureProfile", "when": "testId in go.tests && testId =~ /\\?(test|benchmark)/", "group": "profile" } ], "view/title": [ { - "command": "go.explorer.refresh", - "when": "view == go.explorer", + "command": "gop.explorer.refresh", + "when": "view == gop.explorer", "group": "navigation" } ], "view/item/context": [ { - "command": "go.test.deleteProfile", + "command": "gop.test.deleteProfile", "when": "viewItem == go:test:file" }, { - "command": "go.explorer.open", + "command": "gop.explorer.open", "when": "viewItem == go:explorer:envfile", "group": "inline" }, { - "command": "go.workspace.editEnv", + "command": "gop.workspace.editEnv", "when": "viewItem =~ /(go:explorer:envtree|go:explorer:envitem)/ && workspaceFolderCount > 0", "group": "inline" }, { - "command": "go.workspace.resetEnv", + "command": "gop.workspace.resetEnv", "when": "viewItem =~ /go:explorer:env/ && workspaceFolderCount > 0" } ] @@ -2933,19 +2921,19 @@ "views": { "explorer": [ { - "id": "go.explorer", - "name": "go", - "icon": "media/go-logo-white.svg", - "when": "go.showExplorer" + "id": "gop.explorer", + "name": "gop", + "icon": "media/goplus-logo-white.svg", + "when": "gop.showExplorer" } ], "test": [ { - "id": "go.test.profile", + "id": "gop.test.profile", "name": "Profiles", - "contextualTitle": "Go", + "contextualTitle": "Go+", "icon": "$(graph)", - "when": "go.hasProfiles" + "when": "gop.hasProfiles" } ] }, diff --git a/src/goDebugConfiguration.ts b/src/goDebugConfiguration.ts index 4c29fbb6f7..8e2f0aac8c 100644 --- a/src/goDebugConfiguration.ts +++ b/src/goDebugConfiguration.ts @@ -40,8 +40,9 @@ export class GoDebugConfigurationProvider implements vscode.DebugConfigurationPr vscode.debug.registerDebugConfigurationProvider('go', new GoDebugConfigurationProvider('go')) ); const registerCommand = createRegisterCommand(ctx, goCtx); - registerCommand('go.debug.pickProcess', () => pickProcess); - registerCommand('go.debug.pickGoProcess', () => pickGoProcess); + // goxls: conflicts fix + registerCommand('gop.debug.pickProcess', () => pickProcess); + registerCommand('gop.debug.pickGoProcess', () => pickGoProcess); } constructor(private defaultDebugAdapterType: string = 'go') {} diff --git a/src/goEnvironmentStatus.ts b/src/goEnvironmentStatus.ts index bbeb5b1aa5..d0042dc801 100644 --- a/src/goEnvironmentStatus.ts +++ b/src/goEnvironmentStatus.ts @@ -561,7 +561,8 @@ export async function offerToInstallLatestGoVersion() { 'go.promptforgoinstall', 'A newer version of Go is available' ); - vscode.commands.registerCommand('go.promptforgoinstall', () => { + // goxls: conflicts fix + vscode.commands.registerCommand('gop.promptforgoinstall', () => { const download = { title: 'Download', async command() { diff --git a/src/goExplorer.ts b/src/goExplorer.ts index 52fdbc381d..eaabb530d5 100644 --- a/src/goExplorer.ts +++ b/src/goExplorer.ts @@ -29,13 +29,14 @@ export class GoExplorerProvider implements vscode.TreeDataProvider provider.update(true)), - registerCommand('go.explorer.open', (item) => provider.open(item)), - registerCommand('go.workspace.editEnv', (item) => provider.editEnv(item)), - registerCommand('go.workspace.resetEnv', (item) => provider.resetEnv(item)) + // goxls: conflicts fix (registerTreeDataProvider & registerCommand) + registerTreeDataProvider('gop.explorer', provider), + registerCommand('gop.explorer.refresh', () => provider.update(true)), + registerCommand('gop.explorer.open', (item) => provider.open(item)), + registerCommand('gop.workspace.editEnv', (item) => provider.editEnv(item)), + registerCommand('gop.workspace.resetEnv', (item) => provider.resetEnv(item)) ); - executeCommand('setContext', 'go.showExplorer', true); + executeCommand('setContext', 'gop.showExplorer', true); return provider; } diff --git a/src/goInstallTools.ts b/src/goInstallTools.ts index 1718068029..97b9743a1b 100644 --- a/src/goInstallTools.ts +++ b/src/goInstallTools.ts @@ -596,7 +596,8 @@ export async function offerToInstallTools() { 'go.promptforinstall', 'Not all Go tools are available on the GOPATH' ); - vscode.commands.registerCommand('go.promptforinstall', () => { + // goxls: conflicts fix + vscode.commands.registerCommand('gop.promptforinstall', () => { const installItem = { title: 'Install', async command() { diff --git a/src/goMain.ts b/src/goMain.ts index f1f91636b9..702a7f269c 100644 --- a/src/goMain.ts +++ b/src/goMain.ts @@ -102,14 +102,16 @@ export async function activate(ctx: vscode.ExtensionContext): Promise showTestOutput); - registerCommand('go.test.cancel', () => cancelRunningTests); - registerCommand('go.import.add', addImport); - registerCommand('go.add.package.workspace', addImportToWorkspace); - registerCommand('go.tools.install', commands.installTools); - registerCommand('go.browse.packages', browsePackages); + // goxls: conflicts fix + registerCommand('gop.gopath', commands.getCurrentGoPath); + registerCommand('gop.goroot', commands.getCurrentGoRoot); + registerCommand('gop.locate.tools', commands.getConfiguredGoTools); + registerCommand('gop.add.tags', commands.addTags); + registerCommand('gop.remove.tags', commands.removeTags); + registerCommand('gop.fill.struct', commands.runFillStruct); + registerCommand('gop.impl.cursor', commands.implCursor); + registerCommand('gop.godoctor.extract', commands.extractFunction); + registerCommand('gop.godoctor.var', commands.extractVariable); + registerCommand('gop.test.cursor', commands.testAtCursor('test')); + registerCommand('gop.test.cursorOrPrevious', commands.testAtCursorOrPrevious('test')); + registerCommand('gop.subtest.cursor', commands.subTestAtCursor('test')); + registerCommand('gop.debug.cursor', commands.testAtCursor('debug')); + registerCommand('gop.debug.subtest.cursor', commands.subTestAtCursor('debug')); + registerCommand('gop.benchmark.cursor', commands.testAtCursor('benchmark')); + registerCommand('gop.test.package', commands.testCurrentPackage(false)); + registerCommand('gop.benchmark.package', commands.testCurrentPackage(true)); + registerCommand('gop.test.file', commands.testCurrentFile(false)); + registerCommand('gop.benchmark.file', commands.testCurrentFile(true)); + registerCommand('gop.test.workspace', commands.testWorkspace); + registerCommand('gop.test.previous', commands.testPrevious); + registerCommand('gop.debug.previous', commands.debugPrevious); + + // goxls: conflicts fix + registerCommand('gop.test.coverage', toggleCoverageCurrentPackage); + registerCommand('gop.test.showOutput', () => showTestOutput); + registerCommand('gop.test.cancel', () => cancelRunningTests); + registerCommand('gop.import.add', addImport); + registerCommand('gop.add.package.workspace', addImportToWorkspace); + registerCommand('gop.tools.install', commands.installTools); + registerCommand('gop.browse.packages', browsePackages); if (isVscodeTestingAPIAvailable && cfg.get('testExplorer.enable')) { GoTestExplorer.setup(ctx, goCtx); @@ -171,35 +176,38 @@ export async function activate(ctx: vscode.ExtensionContext): Promise { + // goxls: conflicts fix + vscode.commands.registerCommand('gop.test.refresh', async (item) => { if (!item) { await vscode.window.showErrorMessage('No test selected'); return; @@ -69,7 +71,8 @@ export class GoTestExplorer { ); context.subscriptions.push( - vscode.commands.registerCommand('go.test.showProfiles', async (item) => { + // goxls: conflicts fix + vscode.commands.registerCommand('gop.test.showProfiles', async (item) => { if (!item) { await vscode.window.showErrorMessage('No test selected'); return; @@ -87,7 +90,8 @@ export class GoTestExplorer { ); context.subscriptions.push( - vscode.commands.registerCommand('go.test.captureProfile', async (item) => { + // goxls: conflicts fix + vscode.commands.registerCommand('gop.test.captureProfile', async (item) => { if (!item) { await vscode.window.showErrorMessage('No test selected'); return; @@ -111,7 +115,8 @@ export class GoTestExplorer { ); context.subscriptions.push( - vscode.commands.registerCommand('go.test.deleteProfile', async (file) => { + // goxls: conflicts fix + vscode.commands.registerCommand('gop.test.deleteProfile', async (file) => { if (!file) { await vscode.window.showErrorMessage('No profile selected'); return; @@ -130,7 +135,8 @@ export class GoTestExplorer { ); context.subscriptions.push( - vscode.commands.registerCommand('go.test.showProfileFile', async (file: Uri) => { + // goxls: conflicts fix + vscode.commands.registerCommand('gop.test.showProfileFile', async (file: Uri) => { return inst.profiler.showFile(file.fsPath); }) ); diff --git a/src/welcome.ts b/src/welcome.ts index 255d27feac..261ff4ea5d 100644 --- a/src/welcome.ts +++ b/src/welcome.ts @@ -19,7 +19,8 @@ import { createRegisterCommand } from './commands'; export class WelcomePanel { public static activate(ctx: vscode.ExtensionContext, goCtx: GoExtensionContext) { const registerCommand = createRegisterCommand(ctx, goCtx); - registerCommand('go.welcome', WelcomePanel.createOrShow); + // goxls: conflicts fix + registerCommand('gop.welcome', WelcomePanel.createOrShow); if (vscode.window.registerWebviewPanelSerializer) { // Make sure we register a serializer in activation event From fa6b37a172ab127270bd294829147eaf2082e569 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Fri, 13 Oct 2023 22:57:46 +0800 Subject: [PATCH 03/10] disable tests --- test/integration/goDebug.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/integration/goDebug.test.ts b/test/integration/goDebug.test.ts index 03009d6a0f..a332da92ef 100644 --- a/test/integration/goDebug.test.ts +++ b/test/integration/goDebug.test.ts @@ -2303,6 +2303,7 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean, withConsole?: string) => } }; +/* goxls: disable tests suite('Go Debug Adapter Tests (legacy)', function () { if (affectedByIssue832()) { return; @@ -2320,6 +2321,7 @@ suite('Go Debug Adapter Tests (dlv-dap, console=integratedTerminal)', function ( this.timeout(60_000); testAll(this.ctx, true, 'integratedTerminal'); }); +*/ // DelveDAPDebugAdapterOnSocket runs a DelveDAPOutputAdapter // over a network socket. This allows tests to instantiate From 01a5d029d10ce99ad37d7592eb3dfdb71b79c0c4 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Fri, 13 Oct 2023 23:13:15 +0800 Subject: [PATCH 04/10] disable tests --- test/integration/goDebugConfiguration.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/integration/goDebugConfiguration.test.ts b/test/integration/goDebugConfiguration.test.ts index 8b9ab7f8b0..e36394c509 100644 --- a/test/integration/goDebugConfiguration.test.ts +++ b/test/integration/goDebugConfiguration.test.ts @@ -1,6 +1,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable no-prototype-builtins */ + +/* goxls: disable tests import assert = require('assert'); import fs = require('fs'); import os = require('os'); @@ -998,3 +1000,4 @@ suite('Debug Configuration Infers Default Mode Property', () => { assert.strictEqual(resolvedConfig['mode'], 'local'); }); }); +*/ From 22f1cc08b402fb9cf5d3bd4777ca71d8550e4c9e Mon Sep 17 00:00:00 2001 From: xushiwei Date: Fri, 13 Oct 2023 23:26:28 +0800 Subject: [PATCH 05/10] disable tests --- test/integration/goTest.run.test.ts | 2 ++ test/integration/install.test.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/integration/goTest.run.test.ts b/test/integration/goTest.run.test.ts index 355586c632..16ae8c1aeb 100644 --- a/test/integration/goTest.run.test.ts +++ b/test/integration/goTest.run.test.ts @@ -1,3 +1,4 @@ +/* goxls: disable tests import assert = require('assert'); import path = require('path'); import sinon = require('sinon'); @@ -259,3 +260,4 @@ suite('Go Test Runner', () => { }).timeout(10000); }); }); +*/ diff --git a/test/integration/install.test.ts b/test/integration/install.test.ts index faf806b226..0e0e1ba0ee 100644 --- a/test/integration/install.test.ts +++ b/test/integration/install.test.ts @@ -4,6 +4,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------*/ +/* goxls: disable tests import AdmZip = require('adm-zip'); import assert from 'assert'; import * as config from '../../src/config'; @@ -116,7 +117,7 @@ suite('Installation Tests', function () { const missingTools = testCases.map((tc) => getToolAtVersion(tc.name)); const goVersion = withGoVersion - ? /* we want a fake go version, but need the real 'go' binary to run `go install` */ + ? // we want a fake go version, but need the real 'go' binary to run `go install` new GoVersion(getBinPath('go'), `go version ${withGoVersion} amd64/linux`) : await getGoVersion(); @@ -393,3 +394,4 @@ suite('listOutdatedTools', () => { assert.deepStrictEqual(x, ['dlv']); }); }); +*/ From e9be0b84723eeba2a131641a60a07e8ab2534812 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Fri, 13 Oct 2023 23:36:57 +0800 Subject: [PATCH 06/10] disable tests --- test/integration/welcome.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/integration/welcome.test.ts b/test/integration/welcome.test.ts index 78afe716f2..82a1905b33 100644 --- a/test/integration/welcome.test.ts +++ b/test/integration/welcome.test.ts @@ -59,6 +59,7 @@ suite('WelcomePanel Tests', () => { }); }); +/* goxls: disable tests suite('joinPath Tests', () => { test('WelcomePanel dataroot is set as expected', () => { const uri = vscode.extensions.getExtension(extensionId)?.extensionUri; @@ -69,3 +70,4 @@ suite('joinPath Tests', () => { assert.strictEqual(got?.toString(), want.toString()); }); }); +*/ From c721eb5bd888def91240f3de59bb9d13f234bdb0 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Sat, 14 Oct 2023 00:02:22 +0800 Subject: [PATCH 07/10] conflicts fix (getConfig) --- package.json | 154 +++++++++++++++++++++++++------------------------- src/config.ts | 6 +- 2 files changed, 81 insertions(+), 79 deletions(-) diff --git a/package.json b/package.json index a07db4c038..9c9fa6c330 100644 --- a/package.json +++ b/package.json @@ -1141,12 +1141,12 @@ "type": "object", "title": "Go+", "properties": { - "go.showWelcome": { + "gop.showWelcome": { "type": "boolean", "default": true, "description": "Specifies whether to show the Welcome experience on first install" }, - "go.buildOnSave": { + "gop.buildOnSave": { "type": "string", "enum": [ "package", @@ -1158,7 +1158,7 @@ "scope": "resource", "markdownDeprecationMessage": "Enable the Go language server (`#go.useLanguageServer#`) to diagnose compile errors." }, - "go.buildFlags": { + "gop.buildFlags": { "type": "array", "items": { "type": "string" @@ -1167,13 +1167,13 @@ "description": "Flags to `go build`/`go test` used during build-on-save or running tests. (e.g. [\"-ldflags='-s'\"]) This is propagated to the language server if `gopls.build.buildFlags` is not specified.", "scope": "resource" }, - "go.buildTags": { + "gop.buildTags": { "type": "string", "default": "", "description": "The Go build tags to use for all commands, that support a `-tags '...'` argument. When running tests, go.testTags will be used instead if it was set. This is propagated to the language server if `gopls.build.buildFlags` is not specified.", "scope": "resource" }, - "go.testTags": { + "gop.testTags": { "type": [ "string", "null" @@ -1182,19 +1182,19 @@ "description": "The Go build tags to use for when running tests. If null, then buildTags will be used.", "scope": "resource" }, - "go.disableConcurrentTests": { + "gop.disableConcurrentTests": { "type": "boolean", "default": false, "description": "If true, tests will not run concurrently. When a new test run is started, the previous will be cancelled.", "scope": "resource" }, - "go.installDependenciesWhenBuilding": { + "gop.installDependenciesWhenBuilding": { "type": "boolean", "default": false, "description": "If true, then `-i` flag will be passed to `go build` everytime the code is compiled. Since Go 1.10, setting this may be unnecessary unless you are in GOPATH mode and do not use the language server.", "scope": "resource" }, - "go.lintOnSave": { + "gop.lintOnSave": { "type": "string", "enum": [ "file", @@ -1212,7 +1212,7 @@ "description": "Lints code on file save using the configured Lint tool. Options are 'file', 'package', 'workspace' or 'off'.", "scope": "resource" }, - "go.lintTool": { + "gop.lintTool": { "type": "string", "default": "staticcheck", "description": "Specifies Lint tool name.", @@ -1224,7 +1224,7 @@ "revive" ] }, - "go.lintFlags": { + "gop.lintFlags": { "type": "array", "items": { "type": "string" @@ -1233,7 +1233,7 @@ "description": "Flags to pass to Lint tool (e.g. [\"-min_confidence=.8\"])", "scope": "resource" }, - "go.vetOnSave": { + "gop.vetOnSave": { "type": "string", "enum": [ "package", @@ -1249,7 +1249,7 @@ "description": "Vets code on file save using 'go tool vet'. Not applicable when using the language server's diagnostics. See 'go.languageServerExperimentalFeatures.diagnostics' setting.", "scope": "resource" }, - "go.vetFlags": { + "gop.vetFlags": { "type": "array", "items": { "type": "string" @@ -1258,7 +1258,7 @@ "description": "Flags to pass to `go tool vet` (e.g. [\"-all\", \"-shadow\"])", "scope": "resource" }, - "go.formatTool": { + "gop.formatTool": { "type": "string", "default": "default", "markdownDescription": "When the language server is enabled and one of `default`/`gofmt`/`goimports`/`gofumpt` is chosen, the language server will handle formatting. If `custom` tool is selected, the extension will use the `customFormatter` tool in the `#go.alternateTools#` section.", @@ -1280,7 +1280,7 @@ "Formats using the custom tool specified as `customFormatter` in the `#go.alternateTools#` setting. The tool should take the input as STDIN and output the formatted code as STDOUT." ] }, - "go.formatFlags": { + "gop.formatFlags": { "type": "array", "items": { "type": "string" @@ -1289,13 +1289,13 @@ "description": "Flags to pass to format tool (e.g. [\"-s\"]). Not applicable when using the language server.", "scope": "resource" }, - "go.inferGopath": { + "gop.inferGopath": { "type": "boolean", "default": false, "description": "Infer GOPATH from the workspace root. This is ignored when using Go Modules.", "scope": "resource" }, - "go.gopath": { + "gop.gopath": { "type": [ "string", "null" @@ -1304,7 +1304,7 @@ "description": "Specify GOPATH here to override the one that is set as environment variable. The inferred GOPATH from workspace root overrides this, if go.inferGopath is set to true.", "scope": "machine-overridable" }, - "go.toolsGopath": { + "gop.toolsGopath": { "type": [ "string", "null" @@ -1313,7 +1313,7 @@ "description": "Location to install the Go tools that the extension depends on if you don't want them in your GOPATH.", "scope": "machine-overridable" }, - "go.goroot": { + "gop.goroot": { "type": [ "string", "null" @@ -1322,34 +1322,34 @@ "description": "Specifies the GOROOT to use when no environment variable is set.", "scope": "machine-overridable" }, - "go.testOnSave": { + "gop.testOnSave": { "type": "boolean", "default": false, "description": "Run 'go test' on save for current package. It is not advised to set this to `true` when you have Auto Save enabled.", "scope": "resource" }, - "go.coverOnSave": { + "gop.coverOnSave": { "type": "boolean", "default": false, "description": "If true, runs 'go test -coverprofile' on save and shows test coverage.", "scope": "resource" }, - "go.coverOnTestPackage": { + "gop.coverOnTestPackage": { "type": "boolean", "default": true, "description": "If true, shows test coverage when Go: Test Package command is run." }, - "go.coverOnSingleTest": { + "gop.coverOnSingleTest": { "type": "boolean", "default": false, "description": "If true, shows test coverage when Go: Test Function at cursor command is run." }, - "go.coverOnSingleTestFile": { + "gop.coverOnSingleTestFile": { "type": "boolean", "default": false, "description": "If true, shows test coverage when Go: Test Single File command is run." }, - "go.coverMode": { + "gop.coverMode": { "type": "string", "enum": [ "default", @@ -1361,13 +1361,13 @@ "description": "When generating code coverage, the value for -covermode. 'default' is the default value chosen by the 'go test' command.", "scope": "resource" }, - "go.coverShowCounts": { + "gop.coverShowCounts": { "type": "boolean", "default": false, "description": "When generating code coverage, should counts be shown as --374--", "scope": "resource" }, - "go.coverageOptions": { + "gop.coverageOptions": { "type": "string", "enum": [ "showCoveredCodeOnly", @@ -1378,7 +1378,7 @@ "description": "Use these options to control whether only covered or only uncovered code or both should be highlighted after running test coverage", "scope": "resource" }, - "go.coverageDecorator": { + "gop.coverageDecorator": { "type": "object", "properties": { "type": { @@ -1454,25 +1454,25 @@ "description": "This option lets you choose the way to display code coverage. Choose either to highlight the complete line or to show a decorator in the gutter. You can customize the colors and borders for the former and the style for the latter.", "scope": "resource" }, - "go.testTimeout": { + "gop.testTimeout": { "type": "string", "default": "30s", "description": "Specifies the timeout for go test in ParseDuration format.", "scope": "resource" }, - "go.testEnvVars": { + "gop.testEnvVars": { "type": "object", "default": {}, "description": "Environment variables that will be passed to the process that runs the Go tests", "scope": "resource" }, - "go.testEnvFile": { + "gop.testEnvFile": { "type": "string", "default": null, "description": "Absolute path to a file containing environment variables definitions. File contents should be of the form key=value.", "scope": "resource" }, - "go.testFlags": { + "gop.testFlags": { "type": [ "array", "null" @@ -1484,13 +1484,13 @@ "description": "Flags to pass to `go test`. If null, then buildFlags will be used. This is not propagated to the language server.", "scope": "resource" }, - "go.testExplorer.enable": { + "gop.testExplorer.enable": { "type": "boolean", "default": true, "scope": "window", "description": "Enable the Go test explorer" }, - "go.testExplorer.packageDisplayMode": { + "gop.testExplorer.packageDisplayMode": { "type": "string", "enum": [ "flat", @@ -1500,31 +1500,31 @@ "description": "Present packages in the test explorer flat or nested.", "scope": "resource" }, - "go.testExplorer.alwaysRunBenchmarks": { + "gop.testExplorer.alwaysRunBenchmarks": { "type": "boolean", "default": false, "description": "Run benchmarks when running all tests in a file or folder.", "scope": "resource" }, - "go.testExplorer.concatenateMessages": { + "gop.testExplorer.concatenateMessages": { "type": "boolean", "default": true, "description": "Concatenate all test log messages for a given location into a single message.", "scope": "resource" }, - "go.testExplorer.showDynamicSubtestsInEditor": { + "gop.testExplorer.showDynamicSubtestsInEditor": { "type": "boolean", "default": false, "description": "Set the source location of dynamically discovered subtests to the location of the containing function. As a result, dynamically discovered subtests will be added to the gutter test widget of the containing function.", "scope": "resource" }, - "go.testExplorer.showOutput": { + "gop.testExplorer.showOutput": { "type": "boolean", "default": true, "description": "Open the test output terminal when a test run is started.", "scope": "window" }, - "go.generateTestsFlags": { + "gop.generateTestsFlags": { "type": "array", "items": { "type": "string" @@ -1533,13 +1533,13 @@ "description": "Additional command line flags to pass to `gotests` for generating tests.", "scope": "resource" }, - "go.toolsEnvVars": { + "gop.toolsEnvVars": { "type": "object", "default": {}, "description": "Environment variables that will be passed to the tools that run the Go tools (e.g. CGO_CFLAGS) and debuggee process launched by Delve. Format as string key:value pairs. When debugging, merged with `envFile` and `env` values with precedence `env` > `envFile` > `go.toolsEnvVars`.", "scope": "resource" }, - "go.gocodeFlags": { + "gop.gocodeFlags": { "type": "array", "items": { "type": "string" @@ -1553,14 +1553,14 @@ "scope": "resource", "markdownDeprecationMessage": "`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`)." }, - "go.gocodeAutoBuild": { + "gop.gocodeAutoBuild": { "type": "boolean", "default": false, "description": "Enable gocode's autobuild feature. Not applicable when using the language server.", "scope": "resource", "markdownDeprecationMessage": "`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`)." }, - "go.gocodePackageLookupMode": { + "gop.gocodePackageLookupMode": { "type": "string", "enum": [ "go", @@ -1572,28 +1572,28 @@ "scope": "resource", "markdownDeprecationMessage": "`gocode` is deprecated by the Go language server. Enable the Go language server (`#go.useLanguageServer#`)." }, - "go.useCodeSnippetsOnFunctionSuggest": { + "gop.useCodeSnippetsOnFunctionSuggest": { "type": "boolean", "default": false, "description": "Complete functions with their parameter signature, including the variable type. Not propagated to the language server.", "scope": "resource", "markdownDeprecationMessage": "Code completion without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`) and use [`gopls's `ui.completion.usePlaceholders` setting](https://github.com/golang/vscode-go/wiki/settings#uicompletionuseplaceholders) instead." }, - "go.useCodeSnippetsOnFunctionSuggestWithoutType": { + "gop.useCodeSnippetsOnFunctionSuggestWithoutType": { "type": "boolean", "default": false, "description": "Complete functions with their parameter signature, excluding the variable types. Use `gopls.usePlaceholders` when using the language server.", "scope": "resource", "markdownDeprecationMessage": "Code completion without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`) and use [`gopls's `ui.completion.usePlaceholders` setting](https://github.com/golang/vscode-go/wiki/settings#uicompletionuseplaceholders) instead." }, - "go.autocompleteUnimportedPackages": { + "gop.autocompleteUnimportedPackages": { "type": "boolean", "default": false, "description": "Include unimported packages in auto-complete suggestions. Not applicable when using the language server.", "scope": "resource", "markdownDeprecationMessage": "Code completion without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)." }, - "go.docsTool": { + "gop.docsTool": { "type": "string", "default": "godoc", "description": "Pick 'godoc' or 'gogetdoc' to get documentation. Not applicable when using the language server.", @@ -1605,17 +1605,17 @@ ], "markdownDeprecationMessage": "Documentation support without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)." }, - "go.useLanguageServer": { + "gop.useLanguageServer": { "type": "boolean", "default": true, "description": "Enable intellisense, code navigation, refactoring, formatting & diagnostics for Go. The features are powered by the Go language server \"gopls\"." }, - "go.languageServerFlags": { + "gop.languageServerFlags": { "type": "array", "default": [], "description": "Flags like -rpc.trace and -logfile to be used while running the language server." }, - "go.trace.server": { + "gop.trace.server": { "type": "string", "enum": [ "off", @@ -1625,7 +1625,7 @@ "default": "off", "description": "Trace the communication between VS Code and the Go language server." }, - "go.logging.level": { + "gop.logging.level": { "type": "string", "default": "error", "enum": [ @@ -1637,13 +1637,13 @@ "description": "The logging level the extension logs at, defaults to 'error'", "scope": "machine-overridable" }, - "go.toolsManagement.go": { + "gop.toolsManagement.go": { "type": "string", "default": "", "description": "The path to the `go` binary used to install the Go tools. If it's empty, the same `go` binary chosen for the project will be used for tool installation.", "scope": "machine-overridable" }, - "go.toolsManagement.checkForUpdates": { + "gop.toolsManagement.checkForUpdates": { "type": "string", "default": "proxy", "enum": [ @@ -1658,33 +1658,33 @@ ], "markdownDescription": "Specify whether to prompt about new versions of Go and the Go tools (currently, only `gopls`) the extension depends on" }, - "go.toolsManagement.autoUpdate": { + "gop.toolsManagement.autoUpdate": { "type": "boolean", "default": false, "description": "Automatically update the tools used by the extension, without prompting the user.", "scope": "resource" }, - "go.useGoProxyToCheckForToolUpdates": { + "gop.useGoProxyToCheckForToolUpdates": { "type": "boolean", "default": true, "description": "When enabled, the extension automatically checks the Go proxy if there are updates available for Go and the Go tools (at present, only gopls) it depends on and prompts the user accordingly", "markdownDeprecationMessage": "Use `go.toolsManagement.checkForUpdates` instead." }, - "go.gotoSymbol.includeImports": { + "gop.gotoSymbol.includeImports": { "type": "boolean", "default": false, "description": "If false, the import statements will be excluded while using the Go to Symbol in File feature. Not applicable when using the language server.", "scope": "resource", "markdownDeprecationMessage": "Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)." }, - "go.gotoSymbol.includeGoroot": { + "gop.gotoSymbol.includeGoroot": { "type": "boolean", "default": false, "description": "If false, the standard library located at $GOROOT will be excluded while using the Go to Symbol in File feature. Not applicable when using the language server.", "scope": "resource", "markdownDeprecationMessage": "Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)." }, - "go.enableCodeLens": { + "gop.enableCodeLens": { "type": "object", "properties": { "runtest": { @@ -1700,7 +1700,7 @@ "description": "Feature level setting to enable/disable code lens for references and run/debug tests", "scope": "resource" }, - "go.addTags": { + "gop.addTags": { "type": "object", "properties": { "promptForTags": { @@ -1747,7 +1747,7 @@ "description": "Tags and options configured here will be used by the Add Tags command to add tags to struct fields. If promptForTags is true, then user will be prompted for tags and options. By default, json tags are added.", "scope": "resource" }, - "go.liveErrors": { + "gop.liveErrors": { "type": "object", "properties": { "enabled": { @@ -1770,7 +1770,7 @@ "scope": "resource", "markdownDeprecationMessage": "Real-time diagnostics without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)." }, - "go.removeTags": { + "gop.removeTags": { "type": "object", "properties": { "promptForTags": { @@ -1798,7 +1798,7 @@ "description": "Tags and options configured here will be used by the Remove Tags command to remove tags to struct fields. If promptForTags is true, then user will be prompted for tags and options. By default, all tags and options will be removed.", "scope": "resource" }, - "go.playground": { + "gop.playground": { "type": "object", "properties": { "openbrowser": { @@ -1825,12 +1825,12 @@ "run": true } }, - "go.survey.prompt": { + "gop.survey.prompt": { "type": "boolean", "default": true, "description": "Prompt for surveys, including the gopls survey and the Go developer survey." }, - "go.editorContextMenuCommands": { + "gop.editorContextMenuCommands": { "type": "object", "properties": { "toggleTestFile": { @@ -1930,7 +1930,7 @@ "description": "Experimental Feature: Enable/Disable entries from the context menu in the editor.", "scope": "resource" }, - "go.gotoSymbol.ignoreFolders": { + "gop.gotoSymbol.ignoreFolders": { "type": "array", "items": { "type": "string" @@ -1940,7 +1940,7 @@ "scope": "resource", "markdownDeprecationMessage": "Code navigation without the language server is deprecated. Enable the Go language server (`#go.useLanguageServer#`)." }, - "go.delveConfig": { + "gop.delveConfig": { "type": "object", "properties": { "dlvLoadConfig": { @@ -2065,7 +2065,7 @@ "description": "Delve settings that applies to all debugging sessions. Debug configuration in the launch.json file will override these values.", "scope": "resource" }, - "go.alternateTools": { + "gop.alternateTools": { "type": "object", "default": {}, "description": "Alternate tools or alternate paths for the same tools used by the Go extension. Provide either absolute path or the name of the binary in GOPATH/bin, GOROOT/bin or PATH. Useful when you want to use wrapper script for the Go tools.", @@ -2094,19 +2094,19 @@ }, "additionalProperties": true }, - "go.tasks.provideDefault": { + "gop.tasks.provideDefault": { "default": true, "description": "enable the default go build/test task provider.", "scope": "window", "type": "boolean" }, - "go.terminal.activateEnvironment": { + "gop.terminal.activateEnvironment": { "default": true, "description": "Apply the Go & PATH environment variables used by the extension to all integrated terminals.", "scope": "resource", "type": "boolean" }, - "gopls": { + "goxls": { "type": "object", "markdownDescription": "Configure the default Go language server ('gopls'). In most cases, configuring this section is unnecessary. See [the documentation](https://github.com/golang/tools/blob/master/gopls/doc/settings.md) for all available settings.", "scope": "resource", @@ -2709,7 +2709,7 @@ } } }, - "go.diagnostic.vulncheck": { + "gop.diagnostic.vulncheck": { "type": "string", "markdownDescription": "(Experimental) vulncheck enables vulnerability scanning.\n", "enum": [ @@ -2723,37 +2723,37 @@ "default": "Off", "scope": "resource" }, - "go.inlayHints.assignVariableTypes": { + "gop.inlayHints.assignVariableTypes": { "type": "boolean", "markdownDescription": "Enable/disable inlay hints for variable types in assign statements:\n```go\n\ti/* int*/, j/* int*/ := 0, len(r)-1\n```", "default": false }, - "go.inlayHints.compositeLiteralFields": { + "gop.inlayHints.compositeLiteralFields": { "type": "boolean", "markdownDescription": "Enable/disable inlay hints for composite literal field names:\n```go\n\t{/*in: */\"Hello, world\", /*want: */\"dlrow ,olleH\"}\n```", "default": false }, - "go.inlayHints.compositeLiteralTypes": { + "gop.inlayHints.compositeLiteralTypes": { "type": "boolean", "markdownDescription": "Enable/disable inlay hints for composite literal types:\n```go\n\tfor _, c := range []struct {\n\t\tin, want string\n\t}{\n\t\t/*struct{ in string; want string }*/{\"Hello, world\", \"dlrow ,olleH\"},\n\t}\n```", "default": false }, - "go.inlayHints.constantValues": { + "gop.inlayHints.constantValues": { "type": "boolean", "markdownDescription": "Enable/disable inlay hints for constant values:\n```go\n\tconst (\n\t\tKindNone Kind = iota/* = 0*/\n\t\tKindPrint/* = 1*/\n\t\tKindPrintf/* = 2*/\n\t\tKindErrorf/* = 3*/\n\t)\n```", "default": false }, - "go.inlayHints.functionTypeParameters": { + "gop.inlayHints.functionTypeParameters": { "type": "boolean", "markdownDescription": "Enable/disable inlay hints for implicit type parameters on generic functions:\n```go\n\tmyFoo/*[int, string]*/(1, \"hello\")\n```", "default": false }, - "go.inlayHints.parameterNames": { + "gop.inlayHints.parameterNames": { "type": "boolean", "markdownDescription": "Enable/disable inlay hints for parameter names:\n```go\n\tparseInt(/* str: */ \"123\", /* radix: */ 8)\n```", "default": false }, - "go.inlayHints.rangeVariableTypes": { + "gop.inlayHints.rangeVariableTypes": { "type": "boolean", "markdownDescription": "Enable/disable inlay hints for variable types in range statements:\n```go\n\tfor k/* int*/, v/* string*/ := range []string{} {\n\t\tfmt.Println(k, v)\n\t}\n```", "default": false diff --git a/src/config.ts b/src/config.ts index 48cb530078..bd2a65d009 100644 --- a/src/config.ts +++ b/src/config.ts @@ -9,12 +9,14 @@ import { extensionId } from './const'; /** getGoConfig is declared as an exported const rather than a function, so it can be stubbbed in testing. */ export const getGoConfig = (uri?: vscode.Uri) => { - return getConfig('go', uri); + // goxls: conflicts fix (getConfig) + return getConfig('gop', uri); }; /** getGoplsConfig returns the user's gopls configuration. */ export function getGoplsConfig(uri?: vscode.Uri) { - return getConfig('gopls', uri); + // goxls: conflicts fix (getConfig) + return getConfig('goxls', uri); } function getConfig(section: string, uri?: vscode.Uri | null) { From 7b7658a67a0772b9d23520ceba50d6bc91a71334 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Sat, 14 Oct 2023 00:15:01 +0800 Subject: [PATCH 08/10] npm run lint --- src/goTest/explore.ts | 4 ++-- src/language/goLanguageServer.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/goTest/explore.ts b/src/goTest/explore.ts index 611209f9c1..8f26b11ccd 100644 --- a/src/goTest/explore.ts +++ b/src/goTest/explore.ts @@ -50,9 +50,9 @@ export class GoTestExplorer { // goxls: conflicts fix (registerTreeDataProvider) context.subscriptions.push(vscode.window.registerTreeDataProvider('gop.test.profile', inst.profiler.view)); + // goxls: conflicts fix context.subscriptions.push( - // goxls: conflicts fix - vscode.commands.registerCommand('gop.test.refresh', async (item) => { + vscode.commands.registerCommand('gop.test.refresh', async (item) => { if (!item) { await vscode.window.showErrorMessage('No test selected'); return; diff --git a/src/language/goLanguageServer.ts b/src/language/goLanguageServer.ts index c7fc9041f6..9eb788f756 100644 --- a/src/language/goLanguageServer.ts +++ b/src/language/goLanguageServer.ts @@ -164,9 +164,11 @@ export function scheduleGoplsSuggestions(goCtx: GoExtensionContext) { const usingGo = (): boolean => { return vscode.workspace.textDocuments.some((doc) => doc.languageId === 'go'); }; - const usingGop = (): boolean => { // goxls: Go+ + /* goxls: Go+ + const usingGop = (): boolean => { return vscode.workspace.textDocuments.some((doc) => doc.languageId === 'gop'); }; + */ const installGopls = async (cfg: LanguageServerConfig) => { const tool = getTool('gopls'); const versionToUpdate = await shouldUpdateLanguageServer(tool, cfg); From b6ea2b9648590eafea5c7d8865cd6adf49df9b7c Mon Sep 17 00:00:00 2001 From: xushiwei Date: Sat, 14 Oct 2023 00:23:19 +0800 Subject: [PATCH 09/10] getCheckForToolUpdatesConfig tests fix --- test/gopls/update.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/gopls/update.test.ts b/test/gopls/update.test.ts index a8ea197110..02b3f6c294 100644 --- a/test/gopls/update.test.ts +++ b/test/gopls/update.test.ts @@ -27,7 +27,7 @@ suite('getCheckForToolUpdatesConfig tests', () => { assert.deepStrictEqual( { key, defaultValue, globalValue, workspaceValue }, { - key: `go.${CHECK_FOR_UPDATES}`, + key: `gop.${CHECK_FOR_UPDATES}`, defaultValue: 'proxy', globalValue: undefined, workspaceValue: undefined From f548da290699172a91f2e04c3b5ae55601916b6a Mon Sep 17 00:00:00 2001 From: xushiwei Date: Sat, 14 Oct 2023 00:39:45 +0800 Subject: [PATCH 10/10] ci: macos-latest --- .github/workflows/test-smoke.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-smoke.yml b/.github/workflows/test-smoke.yml index f743e56f7a..9cea05eee2 100644 --- a/.github/workflows/test-smoke.yml +++ b/.github/workflows/test-smoke.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, macos-latest] version: ['stable'] steps: