From 690cf2e3ff37d77314bbe2835bcfde80cad086a9 Mon Sep 17 00:00:00 2001 From: "Hana (Hyang-Ah) Kim" Date: Fri, 5 Jan 2024 09:52:33 -0500 Subject: [PATCH] extension: move extension code to a separate module The vscgo command line tool is moved to the repo root module. This simplifies the release process. The extension module is meant to be used only for development and majority of the code is non-Go code. src/goInstallTools.ts installVSCGO is modified too - Nightly installs with @master. Updates golang/vscode-go#3122 Updates golang/vscode-go#3121 Change-Id: I04e441ecac71b4ab42e635835d91dcf344353e67 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/554316 Reviewed-by: Suzy Mueller Auto-Submit: Hyang-Ah Hana Kim TryBot-Result: kokoro Commit-Queue: Hyang-Ah Hana Kim --- .github/workflows/test-long-all.yml | 10 +- .github/workflows/test-long.yml | 8 + .github/workflows/test-smoke.yml | 8 + .prettierrc.js | 3 - .vscode/launch.json | 50 ++-- .vscode/settings.json | 17 +- .vscode/tasks.json | 9 +- build/Dockerfile | 2 +- build/all.bash | 22 +- build/release-nightly.yaml | 8 +- build/release.yaml | 8 +- doc.go | 8 + docs/go.mod | 3 + .eslintignore => extension/.eslintignore | 0 .eslintrc.json => extension/.eslintrc.json | 0 extension/.prettierrc.js | 3 + .../.prettierrc.json | 0 .vscodeignore => extension/.vscodeignore | 0 CHANGELOG.md => extension/CHANGELOG.md | 0 extension/LICENSE | 24 ++ extension/doc.go | 15 ++ extension/go.mod | 46 ++++ extension/go.sum | 223 ++++++++++++++++ .../go.mod.language-configuration.json | 0 {media => extension/media}/announce.png | Bin {media => extension/media}/codicon.css | 0 {media => extension/media}/codicon.ttf | Bin {media => extension/media}/go-logo-blue.png | Bin {media => extension/media}/go-logo-white.svg | 0 .../media}/gutter-blockblue.svg | 0 .../media}/gutter-blockgreen.svg | 0 .../media}/gutter-blockred.svg | 0 .../media}/gutter-blockyellow.svg | 0 .../media}/gutter-slashblue.svg | 0 .../media}/gutter-slashgreen.svg | 0 .../media}/gutter-slashred.svg | 0 .../media}/gutter-slashyellow.svg | 0 .../media}/gutter-vertblue.svg | 0 .../media}/gutter-vertgreen.svg | 0 {media => extension/media}/gutter-vertred.svg | 0 .../media}/gutter-vertyellow.svg | 0 {media => extension/media}/reset.css | 0 {media => extension/media}/vscode.css | 0 {media => extension/media}/welcome.css | 0 {media => extension/media}/welcome.js | 0 .../package-lock.json | 0 package.json => extension/package.json | 0 {snippets => extension/snippets}/go.json | 0 .../src}/commands/applyCoverprofile.ts | 0 .../src}/commands/getConfiguredGoTools.ts | 0 .../src}/commands/getCurrentGoPath.ts | 0 .../src}/commands/getCurrentGoRoot.ts | 0 {src => extension/src}/commands/index.ts | 0 .../src}/commands/installTools.ts | 0 {src => extension/src}/commands/runBuilds.ts | 0 .../src}/commands/showCommands.ts | 0 .../src}/commands/startDebugSession.ts | 0 .../src}/commands/startLanguageServer.ts | 0 .../src}/commands/toggleGCDetails.ts | 0 {src => extension/src}/config.ts | 0 {src => extension/src}/const.ts | 0 {src => extension/src}/context.ts | 0 {src => extension/src}/debugAdapter/README.md | 0 .../src}/debugAdapter/goDebug.ts | 8 +- {src => extension/src}/diffUtils.ts | 0 {src => extension/src}/export.d.ts | 0 {src => extension/src}/extensionAPI.ts | 0 {src => extension/src}/goBaseCodelens.ts | 0 {src => extension/src}/goBrowsePackage.ts | 0 {src => extension/src}/goBuild.ts | 0 {src => extension/src}/goCheck.ts | 0 {src => extension/src}/goCover.ts | 0 .../src}/goDebugConfiguration.ts | 0 {src => extension/src}/goDebugFactory.ts | 0 {src => extension/src}/goDeveloperSurvey.ts | 0 {src => extension/src}/goDocumentSymbols.ts | 0 {src => extension/src}/goEnv.ts | 0 {src => extension/src}/goEnvironmentStatus.ts | 0 {src => extension/src}/goExplorer.ts | 0 {src => extension/src}/goGenerateTests.ts | 0 {src => extension/src}/goGetPackage.ts | 0 {src => extension/src}/goImpl.ts | 0 {src => extension/src}/goImport.ts | 0 {src => extension/src}/goInstall.ts | 0 {src => extension/src}/goInstallTools.ts | 42 +-- {src => extension/src}/goLint.ts | 0 {src => extension/src}/goLogging.ts | 0 {src => extension/src}/goMain.ts | 5 +- {src => extension/src}/goMode.ts | 0 {src => extension/src}/goModifytags.ts | 0 {src => extension/src}/goModules.ts | 0 {src => extension/src}/goPackages.ts | 0 {src => extension/src}/goPlayground.ts | 0 {src => extension/src}/goRunTestCodelens.ts | 0 {src => extension/src}/goStatus.ts | 0 {src => extension/src}/goSurvey.ts | 0 {src => extension/src}/goTaskProvider.ts | 0 {src => extension/src}/goTelemetry.ts | 0 {src => extension/src}/goTest.ts | 0 {src => extension/src}/goTest/explore.ts | 0 {src => extension/src}/goTest/profile.ts | 0 {src => extension/src}/goTest/resolve.ts | 0 {src => extension/src}/goTest/run.ts | 0 .../src}/goTest/test-explorer.md | 0 {src => extension/src}/goTest/test_events.md | 0 {src => extension/src}/goTest/utils.ts | 0 {src => extension/src}/goTest/walk.ts | 0 {src => extension/src}/goTools.ts | 0 {src => extension/src}/goToolsInformation.ts | 0 {src => extension/src}/goVet.ts | 0 {src => extension/src}/goVulncheck.ts | 0 .../src}/language/goLanguageServer.ts | 0 .../src}/language/legacy/goFormat.ts | 0 .../src}/language/registerDefaultProviders.ts | 0 {src => extension/src}/pickProcess.ts | 0 {src => extension/src}/stateUtils.ts | 0 {src => extension/src}/subTestUtils.ts | 0 {src => extension/src}/testUtils.ts | 0 {src => extension/src}/util.ts | 0 {src => extension/src}/utils/README.md | 0 {src => extension/src}/utils/argsUtil.ts | 0 {src => extension/src}/utils/envUtils.ts | 0 .../src}/utils/lsofProcessParser.ts | 0 {src => extension/src}/utils/mutex.ts | 0 {src => extension/src}/utils/pathUtils.ts | 0 {src => extension/src}/utils/processUtils.ts | 0 .../src}/utils/psProcessParser.ts | 0 .../src}/utils/randomDayutils.ts | 0 .../src}/utils/wmicProcessParser.ts | 0 {src => extension/src}/welcome.ts | 0 .../syntaxes}/go.mod.tmGrammar.json | 0 .../syntaxes}/go.sum.tmGrammar.json | 0 .../test}/gopls/codelens.test.ts | 0 .../test}/gopls/configuration.test.ts | 0 .../test}/gopls/extension.test.ts | 0 .../test}/gopls/goTest.explore.test.ts | 0 .../test}/gopls/goTest.resolve.test.ts | 0 .../test}/gopls/goTest.run.test.ts | 0 .../test}/gopls/goTest.utils.ts | 0 .../test}/gopls/goplsTestEnv.utils.ts | 0 {test => extension/test}/gopls/index.ts | 0 {test => extension/test}/gopls/report.test.ts | 0 {test => extension/test}/gopls/survey.test.ts | 0 .../test}/gopls/telemetry.test.ts | 5 +- .../gopls/testdata/src/workspace/.gitignore | 0 .../src/workspace/.vscode/settings.json | 0 {test => extension/test}/gopls/update.test.ts | 0 .../test}/gopls/vulncheck.test.ts | 0 .../test}/integration/coverage.test.ts | 0 .../test}/integration/extension.test.ts | 0 .../test}/integration/goDebug.test.ts | 0 .../integration/goDebugConfiguration.test.ts | 0 .../test}/integration/goExplorer.test.ts | 0 .../test}/integration/goTask.test.ts | 0 .../test}/integration/goversion.test.ts | 0 {test => extension/test}/integration/index.ts | 0 .../test}/integration/install.test.ts | 0 .../test}/integration/pickProcess.test.ts | 0 .../test}/integration/stateUtils.test.ts | 0 .../test}/integration/statusbar.test.ts | 0 .../test}/integration/test.test.ts | 0 .../test}/integration/testutils.ts | 0 .../test}/integration/utils.test.ts | 0 .../test}/integration/welcome.test.ts | 0 {test => extension/test}/mocks/MockCfg.ts | 0 {test => extension/test}/mocks/MockContext.ts | 0 {test => extension/test}/mocks/MockMemento.ts | 0 {test => extension/test}/mocks/MockTest.ts | 0 {test => extension/test}/runTest.ts | 0 .../test}/testdata/baseTest/go.mod | 0 .../test}/testdata/baseTest/sample_test.go | 0 .../test}/testdata/baseTest/test.go | 0 .../test}/testdata/buildTags/go.mod | 0 .../test}/testdata/buildTags/hello.go | 0 .../test}/testdata/codelens/codelens2_test.go | 0 .../codelens/codelens_benchmark_test.go | 0 .../testdata/codelens/codelens_go118_test.go | 0 .../test}/testdata/codelens/codelens_test.go | 0 .../test}/testdata/codelens/go.mod | 0 .../codelens/testmain/testmain_test.go | 0 .../completions/exportedMemberDocs.go | 0 .../test}/testdata/completions/go.mod | 0 .../test}/testdata/completions/nosnippets.go | 0 .../test}/testdata/completions/snippets.go | 0 .../completions/unimportedMultiplePkgs.go | 0 .../testdata/completions/unimportedPkgs.go | 0 .../test}/testdata/condbp/condbp.go | 0 .../test}/testdata/condbp/go.mod | 0 .../test}/testdata/coverage/a/a.go | 0 .../test}/testdata/coverage/b/b.go | 0 .../test}/testdata/coverage/cover.out | 0 .../test}/testdata/coverage/go.mod | 0 .../test}/testdata/cwdTest/cwdTest/go.mod | 0 .../test}/testdata/cwdTest/cwdTest/hello.txt | 0 .../test}/testdata/cwdTest/cwdTest/main.go | 0 .../test}/testdata/cwdTest/hello.txt | 0 .../test}/testdata/diffTestData/file1.go | 0 .../test}/testdata/diffTestData/file2.go | 0 .../test}/testdata/diffTestData/go.mod | 0 .../test}/testdata/envTest/main.go | 0 .../test}/testdata/errorsTest/errors.go | 0 .../test}/testdata/errorsTest/go.mod | 0 .../testdata/generatetests/generatetests.go | 0 .../test}/testdata/generatetests/go.mod | 0 .../test}/testdata/goTestTest/a_test.go | 0 .../test}/testdata/goTestTest/b/b_test.go | 0 .../test}/testdata/goTestTest/go.mod | 0 .../test}/testdata/gogetdocTestData/format.go | 0 .../test}/testdata/gogetdocTestData/go.mod | 0 .../test}/testdata/gogetdocTestData/test.go | 0 .../test}/testdata/goroutineTest/go.mod | 0 .../test}/testdata/goroutineTest/main.go | 0 .../test}/testdata/helloWorldServer/go.mod | 0 .../test}/testdata/helloWorldServer/main.go | 0 .../test}/testdata/importTest/cgoImports.go | 0 .../test}/testdata/importTest/go.mod | 0 .../test}/testdata/importTest/groupImports.go | 0 .../test}/testdata/importTest/noimports.go | 0 .../testdata/importTest/singleImports.go | 0 .../test}/testdata/linterTest/go.mod | 0 .../test}/testdata/linterTest/linter_1.go | 0 .../test}/testdata/linterTest/linter_2.go | 0 {test => extension/test}/testdata/loop/go.mod | 0 .../test}/testdata/loop/loop.go | 0 .../test}/testdata/outlineTest/go.mod | 0 .../test}/testdata/outlineTest/test.go | 0 .../test}/testdata/panic/go.mod | 0 .../test}/testdata/panic/panic.go | 0 .../test}/testdata/runtimeError/go.mod | 0 .../test}/testdata/runtimeError/oops.go | 0 .../test}/testdata/sleep/go.mod | 0 .../test}/testdata/sleep/sleep.go | 0 .../test}/testdata/stretchrTestSuite/go.mod | 0 .../test}/testdata/stretchrTestSuite/go.sum | 0 .../testdata/stretchrTestSuite/suite_test.go | 0 .../test}/testdata/subTest/go.mod | 0 .../test}/testdata/subTest/sub_test.go | 0 .../test}/testdata/testTags/go.mod | 0 .../test}/testdata/testTags/hello_test.go | 0 .../test}/testdata/vendoring/main.go | 0 .../vendoring/vendor/example/vendorpls/lib.go | 0 .../test}/testdata/vuln/go.work | 0 .../test}/testdata/vuln/mod1/go.mod | 0 .../test}/testdata/vuln/mod1/go.sum | 0 .../test}/testdata/vuln/mod1/test.go | 0 .../test}/testdata/vuln/mod2/go.mod | 0 .../test}/testdata/vuln/mod2/test.go | 0 .../testdata/vuln/vulndb/GO-1970-FMT.json | 0 .../testdata/vuln/vulndb/GO-1970-TEXT.json | 0 {test => extension/test}/unit/calendartest.ts | 0 {test => extension/test}/unit/logger.test.ts | 0 {test => extension/test}/unit/mutex.test.ts | 0 .../test}/unit/subTestUtils.test.ts | 0 {test => extension/test}/unit/util.test.ts | 0 .../third_party}/README.md | 0 .../third_party}/tree-kill/LICENSE | 0 .../third_party}/tree-kill/README.md | 0 .../third_party}/tree-kill/index.d.ts | 0 .../third_party}/tree-kill/index.js | 0 .../third_party}/tree-kill/package.json | 0 {tools => extension/tools}/allTools.ts.in | 0 {tools => extension/tools}/docs2wiki/main.go | 0 .../tools}/docs2wiki/main_test.go | 0 {tools => extension/tools}/generate.go | 10 +- .../tools}/goplssetting/goplssetting.go | 0 .../tools}/goplssetting/goplssetting_test.go | 0 .../tools}/installtools/main.go | 0 .../tools}/installtools/main_test.go | 0 {tools => extension/tools}/license.sh | 0 {build => extension/tools/release}/release.go | 2 +- .../tools}/relnotes/relnotes.go | 0 tsconfig.json => extension/tsconfig.json | 0 {typings => extension/typings}/diff.d.ts | 0 {typings => extension/typings}/json-rpc2.d.ts | 0 {typings => extension/typings}/lodash.d.ts | 0 go.mod | 38 +-- go.sum | 222 +--------------- internal/vscgo/main.go | 250 ++++++++++++++++++ {vscgo => internal/vscgo}/main_test.go | 2 +- vscgo/go.mod | 7 - vscgo/go.sum | 4 - vscgo/main.go | 241 +---------------- 282 files changed, 705 insertions(+), 598 deletions(-) delete mode 100644 .prettierrc.js create mode 100644 doc.go create mode 100644 docs/go.mod rename .eslintignore => extension/.eslintignore (100%) rename .eslintrc.json => extension/.eslintrc.json (100%) create mode 100644 extension/.prettierrc.js rename .prettierrc.json => extension/.prettierrc.json (100%) rename .vscodeignore => extension/.vscodeignore (100%) rename CHANGELOG.md => extension/CHANGELOG.md (100%) create mode 100644 extension/LICENSE create mode 100644 extension/doc.go create mode 100644 extension/go.mod create mode 100644 extension/go.sum rename {languages => extension/languages}/go.mod.language-configuration.json (100%) rename {media => extension/media}/announce.png (100%) rename {media => extension/media}/codicon.css (100%) rename {media => extension/media}/codicon.ttf (100%) rename {media => extension/media}/go-logo-blue.png (100%) rename {media => extension/media}/go-logo-white.svg (100%) rename {media => extension/media}/gutter-blockblue.svg (100%) rename {media => extension/media}/gutter-blockgreen.svg (100%) rename {media => extension/media}/gutter-blockred.svg (100%) rename {media => extension/media}/gutter-blockyellow.svg (100%) rename {media => extension/media}/gutter-slashblue.svg (100%) rename {media => extension/media}/gutter-slashgreen.svg (100%) rename {media => extension/media}/gutter-slashred.svg (100%) rename {media => extension/media}/gutter-slashyellow.svg (100%) rename {media => extension/media}/gutter-vertblue.svg (100%) rename {media => extension/media}/gutter-vertgreen.svg (100%) rename {media => extension/media}/gutter-vertred.svg (100%) rename {media => extension/media}/gutter-vertyellow.svg (100%) rename {media => extension/media}/reset.css (100%) rename {media => extension/media}/vscode.css (100%) rename {media => extension/media}/welcome.css (100%) rename {media => extension/media}/welcome.js (100%) rename package-lock.json => extension/package-lock.json (100%) rename package.json => extension/package.json (100%) rename {snippets => extension/snippets}/go.json (100%) rename {src => extension/src}/commands/applyCoverprofile.ts (100%) rename {src => extension/src}/commands/getConfiguredGoTools.ts (100%) rename {src => extension/src}/commands/getCurrentGoPath.ts (100%) rename {src => extension/src}/commands/getCurrentGoRoot.ts (100%) rename {src => extension/src}/commands/index.ts (100%) rename {src => extension/src}/commands/installTools.ts (100%) rename {src => extension/src}/commands/runBuilds.ts (100%) rename {src => extension/src}/commands/showCommands.ts (100%) rename {src => extension/src}/commands/startDebugSession.ts (100%) rename {src => extension/src}/commands/startLanguageServer.ts (100%) rename {src => extension/src}/commands/toggleGCDetails.ts (100%) rename {src => extension/src}/config.ts (100%) rename {src => extension/src}/const.ts (100%) rename {src => extension/src}/context.ts (100%) rename {src => extension/src}/debugAdapter/README.md (100%) rename {src => extension/src}/debugAdapter/goDebug.ts (99%) rename {src => extension/src}/diffUtils.ts (100%) rename {src => extension/src}/export.d.ts (100%) rename {src => extension/src}/extensionAPI.ts (100%) rename {src => extension/src}/goBaseCodelens.ts (100%) rename {src => extension/src}/goBrowsePackage.ts (100%) rename {src => extension/src}/goBuild.ts (100%) rename {src => extension/src}/goCheck.ts (100%) rename {src => extension/src}/goCover.ts (100%) rename {src => extension/src}/goDebugConfiguration.ts (100%) rename {src => extension/src}/goDebugFactory.ts (100%) rename {src => extension/src}/goDeveloperSurvey.ts (100%) rename {src => extension/src}/goDocumentSymbols.ts (100%) rename {src => extension/src}/goEnv.ts (100%) rename {src => extension/src}/goEnvironmentStatus.ts (100%) rename {src => extension/src}/goExplorer.ts (100%) rename {src => extension/src}/goGenerateTests.ts (100%) rename {src => extension/src}/goGetPackage.ts (100%) rename {src => extension/src}/goImpl.ts (100%) rename {src => extension/src}/goImport.ts (100%) rename {src => extension/src}/goInstall.ts (100%) rename {src => extension/src}/goInstallTools.ts (96%) rename {src => extension/src}/goLint.ts (100%) rename {src => extension/src}/goLogging.ts (100%) rename {src => extension/src}/goMain.ts (99%) rename {src => extension/src}/goMode.ts (100%) rename {src => extension/src}/goModifytags.ts (100%) rename {src => extension/src}/goModules.ts (100%) rename {src => extension/src}/goPackages.ts (100%) rename {src => extension/src}/goPlayground.ts (100%) rename {src => extension/src}/goRunTestCodelens.ts (100%) rename {src => extension/src}/goStatus.ts (100%) rename {src => extension/src}/goSurvey.ts (100%) rename {src => extension/src}/goTaskProvider.ts (100%) rename {src => extension/src}/goTelemetry.ts (100%) rename {src => extension/src}/goTest.ts (100%) rename {src => extension/src}/goTest/explore.ts (100%) rename {src => extension/src}/goTest/profile.ts (100%) rename {src => extension/src}/goTest/resolve.ts (100%) rename {src => extension/src}/goTest/run.ts (100%) rename {src => extension/src}/goTest/test-explorer.md (100%) rename {src => extension/src}/goTest/test_events.md (100%) rename {src => extension/src}/goTest/utils.ts (100%) rename {src => extension/src}/goTest/walk.ts (100%) rename {src => extension/src}/goTools.ts (100%) rename {src => extension/src}/goToolsInformation.ts (100%) rename {src => extension/src}/goVet.ts (100%) rename {src => extension/src}/goVulncheck.ts (100%) rename {src => extension/src}/language/goLanguageServer.ts (100%) rename {src => extension/src}/language/legacy/goFormat.ts (100%) rename {src => extension/src}/language/registerDefaultProviders.ts (100%) rename {src => extension/src}/pickProcess.ts (100%) rename {src => extension/src}/stateUtils.ts (100%) rename {src => extension/src}/subTestUtils.ts (100%) rename {src => extension/src}/testUtils.ts (100%) rename {src => extension/src}/util.ts (100%) rename {src => extension/src}/utils/README.md (100%) rename {src => extension/src}/utils/argsUtil.ts (100%) rename {src => extension/src}/utils/envUtils.ts (100%) rename {src => extension/src}/utils/lsofProcessParser.ts (100%) rename {src => extension/src}/utils/mutex.ts (100%) rename {src => extension/src}/utils/pathUtils.ts (100%) rename {src => extension/src}/utils/processUtils.ts (100%) rename {src => extension/src}/utils/psProcessParser.ts (100%) rename {src => extension/src}/utils/randomDayutils.ts (100%) rename {src => extension/src}/utils/wmicProcessParser.ts (100%) rename {src => extension/src}/welcome.ts (100%) rename {syntaxes => extension/syntaxes}/go.mod.tmGrammar.json (100%) rename {syntaxes => extension/syntaxes}/go.sum.tmGrammar.json (100%) rename {test => extension/test}/gopls/codelens.test.ts (100%) rename {test => extension/test}/gopls/configuration.test.ts (100%) rename {test => extension/test}/gopls/extension.test.ts (100%) rename {test => extension/test}/gopls/goTest.explore.test.ts (100%) rename {test => extension/test}/gopls/goTest.resolve.test.ts (100%) rename {test => extension/test}/gopls/goTest.run.test.ts (100%) rename {test => extension/test}/gopls/goTest.utils.ts (100%) rename {test => extension/test}/gopls/goplsTestEnv.utils.ts (100%) rename {test => extension/test}/gopls/index.ts (100%) rename {test => extension/test}/gopls/report.test.ts (100%) rename {test => extension/test}/gopls/survey.test.ts (100%) rename {test => extension/test}/gopls/telemetry.test.ts (98%) rename {test => extension/test}/gopls/testdata/src/workspace/.gitignore (100%) rename {test => extension/test}/gopls/testdata/src/workspace/.vscode/settings.json (100%) rename {test => extension/test}/gopls/update.test.ts (100%) rename {test => extension/test}/gopls/vulncheck.test.ts (100%) rename {test => extension/test}/integration/coverage.test.ts (100%) rename {test => extension/test}/integration/extension.test.ts (100%) rename {test => extension/test}/integration/goDebug.test.ts (100%) rename {test => extension/test}/integration/goDebugConfiguration.test.ts (100%) rename {test => extension/test}/integration/goExplorer.test.ts (100%) rename {test => extension/test}/integration/goTask.test.ts (100%) rename {test => extension/test}/integration/goversion.test.ts (100%) rename {test => extension/test}/integration/index.ts (100%) rename {test => extension/test}/integration/install.test.ts (100%) rename {test => extension/test}/integration/pickProcess.test.ts (100%) rename {test => extension/test}/integration/stateUtils.test.ts (100%) rename {test => extension/test}/integration/statusbar.test.ts (100%) rename {test => extension/test}/integration/test.test.ts (100%) rename {test => extension/test}/integration/testutils.ts (100%) rename {test => extension/test}/integration/utils.test.ts (100%) rename {test => extension/test}/integration/welcome.test.ts (100%) rename {test => extension/test}/mocks/MockCfg.ts (100%) rename {test => extension/test}/mocks/MockContext.ts (100%) rename {test => extension/test}/mocks/MockMemento.ts (100%) rename {test => extension/test}/mocks/MockTest.ts (100%) rename {test => extension/test}/runTest.ts (100%) rename {test => extension/test}/testdata/baseTest/go.mod (100%) rename {test => extension/test}/testdata/baseTest/sample_test.go (100%) rename {test => extension/test}/testdata/baseTest/test.go (100%) rename {test => extension/test}/testdata/buildTags/go.mod (100%) rename {test => extension/test}/testdata/buildTags/hello.go (100%) rename {test => extension/test}/testdata/codelens/codelens2_test.go (100%) rename {test => extension/test}/testdata/codelens/codelens_benchmark_test.go (100%) rename {test => extension/test}/testdata/codelens/codelens_go118_test.go (100%) rename {test => extension/test}/testdata/codelens/codelens_test.go (100%) rename {test => extension/test}/testdata/codelens/go.mod (100%) rename {test => extension/test}/testdata/codelens/testmain/testmain_test.go (100%) rename {test => extension/test}/testdata/completions/exportedMemberDocs.go (100%) rename {test => extension/test}/testdata/completions/go.mod (100%) rename {test => extension/test}/testdata/completions/nosnippets.go (100%) rename {test => extension/test}/testdata/completions/snippets.go (100%) rename {test => extension/test}/testdata/completions/unimportedMultiplePkgs.go (100%) rename {test => extension/test}/testdata/completions/unimportedPkgs.go (100%) rename {test => extension/test}/testdata/condbp/condbp.go (100%) rename {test => extension/test}/testdata/condbp/go.mod (100%) rename {test => extension/test}/testdata/coverage/a/a.go (100%) rename {test => extension/test}/testdata/coverage/b/b.go (100%) rename {test => extension/test}/testdata/coverage/cover.out (100%) rename {test => extension/test}/testdata/coverage/go.mod (100%) rename {test => extension/test}/testdata/cwdTest/cwdTest/go.mod (100%) rename {test => extension/test}/testdata/cwdTest/cwdTest/hello.txt (100%) rename {test => extension/test}/testdata/cwdTest/cwdTest/main.go (100%) rename {test => extension/test}/testdata/cwdTest/hello.txt (100%) rename {test => extension/test}/testdata/diffTestData/file1.go (100%) rename {test => extension/test}/testdata/diffTestData/file2.go (100%) rename {test => extension/test}/testdata/diffTestData/go.mod (100%) rename {test => extension/test}/testdata/envTest/main.go (100%) rename {test => extension/test}/testdata/errorsTest/errors.go (100%) rename {test => extension/test}/testdata/errorsTest/go.mod (100%) rename {test => extension/test}/testdata/generatetests/generatetests.go (100%) rename {test => extension/test}/testdata/generatetests/go.mod (100%) rename {test => extension/test}/testdata/goTestTest/a_test.go (100%) rename {test => extension/test}/testdata/goTestTest/b/b_test.go (100%) rename {test => extension/test}/testdata/goTestTest/go.mod (100%) rename {test => extension/test}/testdata/gogetdocTestData/format.go (100%) rename {test => extension/test}/testdata/gogetdocTestData/go.mod (100%) rename {test => extension/test}/testdata/gogetdocTestData/test.go (100%) rename {test => extension/test}/testdata/goroutineTest/go.mod (100%) rename {test => extension/test}/testdata/goroutineTest/main.go (100%) rename {test => extension/test}/testdata/helloWorldServer/go.mod (100%) rename {test => extension/test}/testdata/helloWorldServer/main.go (100%) rename {test => extension/test}/testdata/importTest/cgoImports.go (100%) rename {test => extension/test}/testdata/importTest/go.mod (100%) rename {test => extension/test}/testdata/importTest/groupImports.go (100%) rename {test => extension/test}/testdata/importTest/noimports.go (100%) rename {test => extension/test}/testdata/importTest/singleImports.go (100%) rename {test => extension/test}/testdata/linterTest/go.mod (100%) rename {test => extension/test}/testdata/linterTest/linter_1.go (100%) rename {test => extension/test}/testdata/linterTest/linter_2.go (100%) rename {test => extension/test}/testdata/loop/go.mod (100%) rename {test => extension/test}/testdata/loop/loop.go (100%) rename {test => extension/test}/testdata/outlineTest/go.mod (100%) rename {test => extension/test}/testdata/outlineTest/test.go (100%) rename {test => extension/test}/testdata/panic/go.mod (100%) rename {test => extension/test}/testdata/panic/panic.go (100%) rename {test => extension/test}/testdata/runtimeError/go.mod (100%) rename {test => extension/test}/testdata/runtimeError/oops.go (100%) rename {test => extension/test}/testdata/sleep/go.mod (100%) rename {test => extension/test}/testdata/sleep/sleep.go (100%) rename {test => extension/test}/testdata/stretchrTestSuite/go.mod (100%) rename {test => extension/test}/testdata/stretchrTestSuite/go.sum (100%) rename {test => extension/test}/testdata/stretchrTestSuite/suite_test.go (100%) rename {test => extension/test}/testdata/subTest/go.mod (100%) rename {test => extension/test}/testdata/subTest/sub_test.go (100%) rename {test => extension/test}/testdata/testTags/go.mod (100%) rename {test => extension/test}/testdata/testTags/hello_test.go (100%) rename {test => extension/test}/testdata/vendoring/main.go (100%) rename {test => extension/test}/testdata/vendoring/vendor/example/vendorpls/lib.go (100%) rename {test => extension/test}/testdata/vuln/go.work (100%) rename {test => extension/test}/testdata/vuln/mod1/go.mod (100%) rename {test => extension/test}/testdata/vuln/mod1/go.sum (100%) rename {test => extension/test}/testdata/vuln/mod1/test.go (100%) rename {test => extension/test}/testdata/vuln/mod2/go.mod (100%) rename {test => extension/test}/testdata/vuln/mod2/test.go (100%) rename {test => extension/test}/testdata/vuln/vulndb/GO-1970-FMT.json (100%) rename {test => extension/test}/testdata/vuln/vulndb/GO-1970-TEXT.json (100%) rename {test => extension/test}/unit/calendartest.ts (100%) rename {test => extension/test}/unit/logger.test.ts (100%) rename {test => extension/test}/unit/mutex.test.ts (100%) rename {test => extension/test}/unit/subTestUtils.test.ts (100%) rename {test => extension/test}/unit/util.test.ts (100%) rename {third_party => extension/third_party}/README.md (100%) rename {third_party => extension/third_party}/tree-kill/LICENSE (100%) rename {third_party => extension/third_party}/tree-kill/README.md (100%) rename {third_party => extension/third_party}/tree-kill/index.d.ts (100%) rename {third_party => extension/third_party}/tree-kill/index.js (100%) rename {third_party => extension/third_party}/tree-kill/package.json (100%) rename {tools => extension/tools}/allTools.ts.in (100%) rename {tools => extension/tools}/docs2wiki/main.go (100%) rename {tools => extension/tools}/docs2wiki/main_test.go (100%) rename {tools => extension/tools}/generate.go (98%) rename {tools => extension/tools}/goplssetting/goplssetting.go (100%) rename {tools => extension/tools}/goplssetting/goplssetting_test.go (100%) rename {tools => extension/tools}/installtools/main.go (100%) rename {tools => extension/tools}/installtools/main_test.go (100%) rename {tools => extension/tools}/license.sh (100%) rename {build => extension/tools/release}/release.go (98%) rename {tools => extension/tools}/relnotes/relnotes.go (100%) rename tsconfig.json => extension/tsconfig.json (100%) rename {typings => extension/typings}/diff.d.ts (100%) rename {typings => extension/typings}/json-rpc2.d.ts (100%) rename {typings => extension/typings}/lodash.d.ts (100%) create mode 100644 internal/vscgo/main.go rename {vscgo => internal/vscgo}/main_test.go (99%) delete mode 100644 vscgo/go.mod delete mode 100644 vscgo/go.sum diff --git a/.github/workflows/test-long-all.yml b/.github/workflows/test-long-all.yml index 3a5aca0fab..36cffce14c 100644 --- a/.github/workflows/test-long-all.yml +++ b/.github/workflows/test-long-all.yml @@ -28,6 +28,7 @@ jobs: with: node-version: '18' cache: 'npm' + cache-dependency-path: './extension/package-lock.json' - name: Setup Go uses: actions/setup-go@v4 @@ -38,29 +39,35 @@ jobs: - name: Install dependencies run: npm ci + working-directory: ./extension - name: Compile run: npm run vscode:prepublish + working-directory: ./extension - name: Install Go tools (Modules mode) run: | go version - go run ./tools/installtools/main.go + go run ./tools/installtools/main.Go + working-directory: ./extension env: GO111MODULE: on EXT: "${{ matrix.os == 'windows-latest' && '.exe' || ''}}" - name: Run unit tests run: npm run unit-test + working-directory: ./extension - name: Run tests (Linux) run: xvfb-run -a npm run test + working-directory: ./extension if: ${{ matrix.os == 'ubuntu-latest' }} env: CODE_VERSION: ${{ matrix.version }} VSCODEGO_BEFORE_RELEASE_TESTS: true - name: Run tests (Windows/Mac) run: npm run test + working-directory: ./extension if: ${{ matrix.os != 'ubuntu-latest' }} env: CODE_VERSION: ${{ matrix.version }} @@ -68,4 +75,5 @@ jobs: - name: Lint check run: npm run lint + working-directory: ./extension if: ${{ matrix.os == 'ubuntu-latest' && matrix.version == 'stable' }} diff --git a/.github/workflows/test-long.yml b/.github/workflows/test-long.yml index d5b3d23710..aff6b13f26 100644 --- a/.github/workflows/test-long.yml +++ b/.github/workflows/test-long.yml @@ -27,6 +27,7 @@ jobs: with: node-version: '18' cache: 'npm' + cache-dependency-path: './extension/package-lock.json' - name: Setup Go uses: actions/setup-go@v4 @@ -37,32 +38,39 @@ jobs: - name: Install dependencies run: npm ci + working-directory: ./extension - name: Compile run: npm run vscode:prepublish + working-directory: ./extension - name: Install Go tools (Modules mode) run: | go version go run ./tools/installtools/main.go + working-directory: ./extension env: GO111MODULE: on EXT: "${{ matrix.os == 'windows-latest' && '.exe' || ''}}" - name: Run unit tests run: npm run unit-test + working-directory: ./extension - name: Run tests (Linux) run: xvfb-run -a npm run test + working-directory: ./extension if: ${{ matrix.os == 'ubuntu-latest' }} env: CODE_VERSION: ${{ matrix.version }} - name: Run tests (Windows/Mac) run: npm run test + working-directory: ./extension if: ${{ matrix.os != 'ubuntu-latest' }} env: CODE_VERSION: ${{ matrix.version }} - name: Lint check run: npm run lint + working-directory: ./extension if: ${{ matrix.os == 'ubuntu-latest' && matrix.version == 'stable' }} diff --git a/.github/workflows/test-smoke.yml b/.github/workflows/test-smoke.yml index b7f79093e4..c5f78fc876 100644 --- a/.github/workflows/test-smoke.yml +++ b/.github/workflows/test-smoke.yml @@ -26,6 +26,7 @@ jobs: with: node-version: '18' cache: 'npm' + cache-dependency-path: './extension/package-lock.json' - name: Setup Go uses: actions/setup-go@v4 @@ -36,32 +37,39 @@ jobs: - name: Install dependencies run: npm ci + working-directory: ./extension - name: Compile run: npm run vscode:prepublish + working-directory: ./extension - name: Install Go tools (Modules mode) run: | go version go run ./tools/installtools/main.go + working-directory: ./extension env: GO111MODULE: on EXT: "${{ matrix.os == 'windows-latest' && '.exe' || ''}}" - name: Run unit tests run: npm run unit-test + working-directory: ./extension - name: Run tests (Linux) run: xvfb-run -a npm run test + working-directory: ./extension if: ${{ matrix.os == 'ubuntu-latest' }} env: CODE_VERSION: ${{ matrix.version }} - name: Run tests (Windows/Mac) run: npm run test + working-directory: ./extension if: ${{ matrix.os != 'ubuntu-latest' }} env: CODE_VERSION: ${{ matrix.version }} - name: Lint check run: npm run lint + working-directory: ./extension if: ${{ matrix.os == 'ubuntu-latest' && matrix.version == 'stable' }} diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index ff15483392..0000000000 --- a/.prettierrc.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/.vscode/launch.json b/.vscode/launch.json index e6bfc34d40..93b6e39a91 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,8 +6,8 @@ "type": "go", "request": "launch", "mode": "debug", - "program": "${workspaceFolder}/tools/generate.go", - "cwd": "${workspaceFolder}" + "program": "${workspaceFolder}/extension/tools/generate.go", + "cwd": "${workspaceFolder}/extension" }, { "name": "Launch Extension", @@ -20,7 +20,7 @@ "--disable-extensions" ], "outFiles": [ - "${workspaceFolder}/dist/**/*.js" + "${workspaceFolder}/extension/dist/**/*.js" ], "sourceMaps": true, "smartStep": true, @@ -28,21 +28,7 @@ "env": { "VSCODE_GO_IN_TEST": "" // Enable code }, - }, - { - "name": "Launch as server", - "type": "node", - "request": "launch", - "program": "${workspaceFolder}/dist/debugAdapter.js", - "args": [ - "--server=4711" - ], - "outFiles": [ - "${workspaceFolder}/dist/**/*.js" - ], - "sourceMaps": true, - "smartStep": true, - "preLaunchTask": "npm: bundle-dev" + "cwd": "${workspaceFolder}/extension" }, { "name": "Launch Extension Tests", @@ -53,9 +39,9 @@ "args": [ "--disable-extensions", "--profile-temp", - "--extensionDevelopmentPath=${workspaceFolder}", - "--extensionTestsPath=${workspaceFolder}/out/test/integration/index", - "--user-data-dir=${workspaceFolder}/.user-data-dir-test", + "--extensionDevelopmentPath=${workspaceFolder}/extension", + "--extensionTestsPath=${workspaceFolder}/extension/out/test/integration/index", + "--user-data-dir=${workspaceFolder}/extension/.user-data-dir-test", "--timeout", "999999" ], @@ -66,6 +52,7 @@ "sourceMaps": true, "smartStep": true, "preLaunchTask": "npm: watch", + "cwd": "${workspaceFolder}/extension" }, { "name": "Launch Extension Tests with Gopls", @@ -76,9 +63,9 @@ "args": [ "--disable-extensions", "--profile-temp", - "--extensionDevelopmentPath=${workspaceFolder}", - "--extensionTestsPath=${workspaceFolder}/out/test/gopls/index", - "--user-data-dir=${workspaceFolder}/.user-data-dir-test", + "--extensionDevelopmentPath=${workspaceFolder}/extension", + "--extensionTestsPath=${workspaceFolder}/extension/out/test/gopls/index", + "--user-data-dir=${workspaceFolder}/extension/.user-data-dir-test", "--timeout", "999999", ], "env": { @@ -86,31 +73,24 @@ }, "sourceMaps": true, "preLaunchTask": "npm: watch", + "cwd": "${workspaceFolder}/extension" }, { "type": "node", "request": "launch", "name": "Launch Unit Tests", - "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "program": "${workspaceFolder}/extension/node_modules/mocha/bin/_mocha", "args": [ "-u", "tdd", "--timeout", "5000", "--colors", - "${workspaceFolder}/out/test/unit" + "${workspaceFolder}/extension/out/test/unit" ], "internalConsoleOptions": "openOnSessionStart", "preLaunchTask": "npm: watch", + "cwd": "${workspaceFolder}/extension" }, - ], - "compounds": [ - { - "name": "Extension + Debug server", - "configurations": [ - "Launch Extension", - "Launch as server" - ] - } ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 5fd2c96d96..2e93ae088d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,14 +1,19 @@ // Place your settings in this file to overwrite default and user settings. { "files.exclude": { - "out": true, - "typings": false + "**/out": true, + "**/.vscode-test": true, + "**/.user-data-dir-test": true, }, "search.exclude": { - "**/node_modules": true, - "**/bower_components": true, - "out/": true + "node_modules": true, + "out": true, + "dist": true, + ".vscode-test": true, + ".user-data-dir-test": true, }, "editor.insertSpaces": false, - "typescript.tsdk": "node_modules\\typescript\\lib", + "[yaml]": { + "editor.autoIndent": "advanced" + }, } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 801a598c32..00d68da5e6 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -33,10 +33,10 @@ "tasks": [ { "type": "typescript", - "tsconfig": "./tsconfig.build.json", + "tsconfig": "extension/tsconfig.json", "problemMatcher": [ "$tsc" - ] + ], }, { "type": "npm", @@ -50,6 +50,7 @@ "kind": "build", "isDefault": true }, + "path": "extension" }, { "type": "npm", @@ -59,13 +60,15 @@ "isBackground": true, "presentation": { "reveal": "never" - } + }, + "path": "extension" }, { "type": "npm", "script": "bundle-dev", "group": "build", "problemMatcher": "$esbuild", + "path": "extension" } ] } diff --git a/build/Dockerfile b/build/Dockerfile index 45235cd963..b1cac5a69a 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -6,7 +6,7 @@ ENV GOBIN /gobin # Install other Go tools tests depend on RUN mkdir -p /scratch/installtools -ADD tools/installtools/main.go /scratch/installtools/main.go +ADD extension/tools/installtools/main.go /scratch/installtools/main.go RUN go run /scratch/installtools/main.go FROM node:latest diff --git a/build/all.bash b/build/all.bash index e26482977a..83ee99dd85 100755 --- a/build/all.bash +++ b/build/all.bash @@ -37,36 +37,39 @@ setup_virtual_display() { go_binaries_info() { echo "**** Go version ****" go version + df -h | grep shm } run_doc_test() { - df -h | grep shm - echo "**** Run settings generator ****" - go run ./tools/generate.go -w=false -gopls=true + go run -C extension ./tools/generate.go -w=false -gopls=true +} +run_test() { + pushd . + cd "$(root_dir)/extension" echo "**** Test build ****" npm ci npm run compile -} -run_test() { echo "**** Run Go tests ****" go test ./... echo "**** Run test ****" npm run unit-test npm test --silent + popd } run_lint() { + pushd . + cd "$(root_dir)/extension" echo "**** Run lint ****" npm run lint + popd } run_test_in_docker() { - which npm && npm version || echo "no npm" - which go && go version || echo "no go" echo "**** Building the docker image ***" docker build -t vscode-test-env ${GOVERSION:+ --build-arg GOVERSION="${GOVERSION}"} -f ./build/Dockerfile . @@ -75,6 +78,8 @@ run_test_in_docker() { } prepare_nightly() { + pushd . + cd "$(root_dir)/extension" # Version format: YYYY.MM.DDHH based on the latest commit timestamp. # e.g. 2020.1.510 is the version built based on a commit that was made # on 2020/01/05 10:00 @@ -98,10 +103,11 @@ prepare_nightly() { sed '/^# Go for Visual Studio Code$/d' README.md | cat build/nightly/README.md - > /tmp/README.md.new && mv /tmp/README.md.new README.md # Replace src/const.ts with build/nightly/const.ts. cp build/nightly/const.ts src/const.ts + popd } main() { - cd "$(root_dir)" # always run from the script root. + cd "$(root_dir)" # always start to run from the extension source root. case "$1" in "help"|"-h"|"--help") usage diff --git a/build/release-nightly.yaml b/build/release-nightly.yaml index ccae628edd..43c4b49410 100644 --- a/build/release-nightly.yaml +++ b/build/release-nightly.yaml @@ -24,7 +24,7 @@ steps: - name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image args: - ci - dir: vscode-go + dir: vscode-go/extension id: install npm dependencies entrypoint: npm - name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image @@ -38,14 +38,14 @@ steps: args: - run - package - dir: vscode-go + dir: vscode-go/extension id: build .vsix entrypoint: npm - name: ubuntu args: - '-c' - ls -1 go-nightly-*.vsix | tee /workspace/vsix_name.txt - dir: vscode-go + dir: vscode-go/extension id: store the vsix file name entrypoint: bash - name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image @@ -64,7 +64,7 @@ steps: npx vsce publish -i $(cat /workspace/vsix_name.txt) -p $$VSCE_PAT --baseContentUrl=https://github.com/golang/vscode-go --baseImagesUrl=https://github.com/golang/vscode-go - dir: vscode-go + dir: vscode-go/extension id: publish nightly extension entrypoint: bash secretEnv: diff --git a/build/release.yaml b/build/release.yaml index c0a3a0199b..2305d6862f 100644 --- a/build/release.yaml +++ b/build/release.yaml @@ -31,15 +31,15 @@ steps: - name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image args: - ci - dir: vscode-go + dir: vscode-go/extension id: install npm dependencies entrypoint: npm - name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image args: - -c - | - go run build/release.go package && - go run build/release.go publish + go run -C extension tools/release/release.go package && + go run -C extension tools/release/release.go publish dir: vscode-go id: package and publish the extension entrypoint: bash @@ -56,7 +56,7 @@ artifacts: objects: location: 'gs://$PROJECT_ID/releases/$TAG_NAME' paths: - - vscode-go/*.vsix + - vscode-go/extension/*.vsix availableSecrets: secretManager: - versionName: projects/$PROJECT_ID/secrets/$_VSCE_TOKEN/versions/latest diff --git a/doc.go b/doc.go new file mode 100644 index 0000000000..40621eb98b --- /dev/null +++ b/doc.go @@ -0,0 +1,8 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// VS Code Go is a Go extension for Visual Studio Code. +package vscodego + +// By adding this doc, pkg.go.dev will render README.md. diff --git a/docs/go.mod b/docs/go.mod new file mode 100644 index 0000000000..0e86589558 --- /dev/null +++ b/docs/go.mod @@ -0,0 +1,3 @@ +module github.com/golang/vscode-go/docs + +go 1.21 diff --git a/.eslintignore b/extension/.eslintignore similarity index 100% rename from .eslintignore rename to extension/.eslintignore diff --git a/.eslintrc.json b/extension/.eslintrc.json similarity index 100% rename from .eslintrc.json rename to extension/.eslintrc.json diff --git a/extension/.prettierrc.js b/extension/.prettierrc.js new file mode 100644 index 0000000000..dcf982c304 --- /dev/null +++ b/extension/.prettierrc.js @@ -0,0 +1,3 @@ +module.exports = { + ...require('.prettierrc.json') +} diff --git a/.prettierrc.json b/extension/.prettierrc.json similarity index 100% rename from .prettierrc.json rename to extension/.prettierrc.json diff --git a/.vscodeignore b/extension/.vscodeignore similarity index 100% rename from .vscodeignore rename to extension/.vscodeignore diff --git a/CHANGELOG.md b/extension/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to extension/CHANGELOG.md diff --git a/extension/LICENSE b/extension/LICENSE new file mode 100644 index 0000000000..bec3260395 --- /dev/null +++ b/extension/LICENSE @@ -0,0 +1,24 @@ +vscode-go + +The MIT License (MIT) + +Original Work Copyright (c) 2015-2020 Microsoft Corporation +Current Work and Modifications Copyright (c) 2020-present The Go Authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/extension/doc.go b/extension/doc.go new file mode 100644 index 0000000000..58fc897b22 --- /dev/null +++ b/extension/doc.go @@ -0,0 +1,15 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package extension is a dummy package to configure +// dependency on the github.com/golang/vscode-go/vscgo tool. +package extension + +// Dummy command to add dependency on vscgo. + +import ( + // internal/vscgo is the implementation of + // the vscgo tool. + _ "github.com/golang/vscode-go/internal/vscgo" +) diff --git a/extension/go.mod b/extension/go.mod new file mode 100644 index 0000000000..74acac5583 --- /dev/null +++ b/extension/go.mod @@ -0,0 +1,46 @@ +module github.com/golang/vscode-go/extension + +go 1.21 + +require ( + github.com/golang/vscode-go v0.0.0-00010101000000-000000000000 + github.com/google/go-cmp v0.6.0 + github.com/stamblerre/work-stats v0.0.0-20221215212512-f2f2cf51e506 + golang.org/x/build v0.0.0-20240104151245-5535e355572c +) + +require ( + cloud.google.com/go/compute v1.23.0 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/go-github v17.0.0+incompatible // indirect + github.com/google/go-querystring v1.1.0 // indirect + github.com/google/s2a-go v0.1.4 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect + github.com/googleapis/gax-go/v2 v2.12.0 // indirect + github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect + github.com/stamblerre/sheets v0.0.0-20220322044539-54bdb620f700 // indirect + go.opencensus.io v0.24.0 // indirect + go4.org v0.0.0-20180809161055-417644f6feb5 // indirect + golang.org/x/crypto v0.16.0 // indirect + golang.org/x/exp v0.0.0-20230809094429-853ea248256d // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/oauth2 v0.15.0 // indirect + golang.org/x/sync v0.5.0 // indirect + golang.org/x/sys v0.16.0 // indirect + golang.org/x/telemetry v0.0.0-20240104150930-463b4b688e47 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/time v0.5.0 // indirect + google.golang.org/api v0.136.0 // indirect + google.golang.org/appengine v1.6.8-0.20221117013220-504804fb50de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect + google.golang.org/grpc v1.58.3 // indirect + google.golang.org/protobuf v1.31.0 // indirect +) + +// For development, use the vscgo in the same repo. +// This go.mod file is excluded when packaging .vsix. +replace github.com/golang/vscode-go => ../ diff --git a/extension/go.sum b/extension/go.sum new file mode 100644 index 0000000000..5059c470bd --- /dev/null +++ b/extension/go.sum @@ -0,0 +1,223 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.110.7 h1:rJyC7nWRg2jWGZ4wSJ5nY65GTdYJkg0cd/uXb+ACI6o= +cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= +cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/iam v1.1.2 h1:gacbrBdWcoVmGLozRuStX45YKvJtzIjJdAolzUs1sm4= +cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= +cloud.google.com/go/secretmanager v1.11.1 h1:cLTCwAjFh9fKvU6F13Y4L9vPcx9yiWPyWXE4+zkuEQs= +cloud.google.com/go/secretmanager v1.11.1/go.mod h1:znq9JlXgTNdBeQk9TBW/FnR/W4uChEKGeqQWAJ8SXFw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM= +github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= +github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/stamblerre/sheets v0.0.0-20220322044539-54bdb620f700 h1:04VNnGQnE26PVIdxBjeJfCLS2W/5u8H8hFym+0EMf+s= +github.com/stamblerre/sheets v0.0.0-20220322044539-54bdb620f700/go.mod h1:XK977hNdUZpQFoSGTEDpbQicSofCnB1PT1CdOOf1lzs= +github.com/stamblerre/work-stats v0.0.0-20221215212512-f2f2cf51e506 h1:YQ1/WiCB8AV8giB+KO9CxheDJuD2Zl4su+vAQdv2ItQ= +github.com/stamblerre/work-stats v0.0.0-20221215212512-f2f2cf51e506/go.mod h1:G94Cv2VI3I+UtGIIah0eQE4OZBVZ3Z9r+XTmQfKlPk4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go4.org v0.0.0-20180809161055-417644f6feb5 h1:+hE86LblG4AyDgwMCLTE6FOlM9+qjHSYS+rKqxUVdsM= +go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= +golang.org/x/build v0.0.0-20240104151245-5535e355572c h1:rlI1VIwI7dfmvrRBxyCyhsp6YH9QjC5GgzPYGB+lO5g= +golang.org/x/build v0.0.0-20240104151245-5535e355572c/go.mod h1:dYD00ZPoQHK4GMm3QX05aTutZAk8hP43zHq62Wmljdk= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20230809094429-853ea248256d h1:wu5bD43Ana/nF1ZmaLr3lW/FQeJU8CcI+Ln7yWHViXE= +golang.org/x/exp v0.0.0-20230809094429-853ea248256d/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= +golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/telemetry v0.0.0-20240104150930-463b4b688e47 h1:OhY/KFZPGLcoV+r5kqpxht3i8M4QdIP2EAsKr+wddho= +golang.org/x/telemetry v0.0.0-20240104150930-463b4b688e47/go.mod h1:ZthVHHkOi8rlMEsfFr3Ie42Ym1NonbFNNRKW3ci0UrU= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.136.0 h1:e/6enzUE1s4tGPa6Q3ZYShKTtvRc+1Jq0rrafhppmOs= +google.golang.org/api v0.136.0/go.mod h1:XtJfF+V2zgUxelOn5Zs3kECtluMxneJG8ZxUTlLNTPA= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.8-0.20221117013220-504804fb50de h1:MvEeYmzkzk0Rsw+ceqy28aIJN7Mum+4aYqBwCMqYNug= +google.golang.org/appengine v1.6.8-0.20221117013220-504804fb50de/go.mod h1:BbwiCY3WCmCUKOJTrX5NwgQzew1c32w3kxa6Sxvs0cQ= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20230807174057-1744710a1577 h1:Tyk/35yqszRCvaragTn5NnkY6IiKk/XvHzEWepo71N0= +google.golang.org/genproto v0.0.0-20230807174057-1744710a1577/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= +google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5 h1:nIgk/EEq3/YlnmVVXVnm14rC2oxgs1o0ong4sD/rd44= +google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5/go.mod h1:5DZzOUPCLYL3mNkQ0ms0F3EuUNZ7py1Bqeq6sxzI7/Q= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 h1:wukfNtZmZUurLN/atp2hiIeTKn7QJWIQdHzqmsOnAOk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/languages/go.mod.language-configuration.json b/extension/languages/go.mod.language-configuration.json similarity index 100% rename from languages/go.mod.language-configuration.json rename to extension/languages/go.mod.language-configuration.json diff --git a/media/announce.png b/extension/media/announce.png similarity index 100% rename from media/announce.png rename to extension/media/announce.png diff --git a/media/codicon.css b/extension/media/codicon.css similarity index 100% rename from media/codicon.css rename to extension/media/codicon.css diff --git a/media/codicon.ttf b/extension/media/codicon.ttf similarity index 100% rename from media/codicon.ttf rename to extension/media/codicon.ttf diff --git a/media/go-logo-blue.png b/extension/media/go-logo-blue.png similarity index 100% rename from media/go-logo-blue.png rename to extension/media/go-logo-blue.png diff --git a/media/go-logo-white.svg b/extension/media/go-logo-white.svg similarity index 100% rename from media/go-logo-white.svg rename to extension/media/go-logo-white.svg diff --git a/media/gutter-blockblue.svg b/extension/media/gutter-blockblue.svg similarity index 100% rename from media/gutter-blockblue.svg rename to extension/media/gutter-blockblue.svg diff --git a/media/gutter-blockgreen.svg b/extension/media/gutter-blockgreen.svg similarity index 100% rename from media/gutter-blockgreen.svg rename to extension/media/gutter-blockgreen.svg diff --git a/media/gutter-blockred.svg b/extension/media/gutter-blockred.svg similarity index 100% rename from media/gutter-blockred.svg rename to extension/media/gutter-blockred.svg diff --git a/media/gutter-blockyellow.svg b/extension/media/gutter-blockyellow.svg similarity index 100% rename from media/gutter-blockyellow.svg rename to extension/media/gutter-blockyellow.svg diff --git a/media/gutter-slashblue.svg b/extension/media/gutter-slashblue.svg similarity index 100% rename from media/gutter-slashblue.svg rename to extension/media/gutter-slashblue.svg diff --git a/media/gutter-slashgreen.svg b/extension/media/gutter-slashgreen.svg similarity index 100% rename from media/gutter-slashgreen.svg rename to extension/media/gutter-slashgreen.svg diff --git a/media/gutter-slashred.svg b/extension/media/gutter-slashred.svg similarity index 100% rename from media/gutter-slashred.svg rename to extension/media/gutter-slashred.svg diff --git a/media/gutter-slashyellow.svg b/extension/media/gutter-slashyellow.svg similarity index 100% rename from media/gutter-slashyellow.svg rename to extension/media/gutter-slashyellow.svg diff --git a/media/gutter-vertblue.svg b/extension/media/gutter-vertblue.svg similarity index 100% rename from media/gutter-vertblue.svg rename to extension/media/gutter-vertblue.svg diff --git a/media/gutter-vertgreen.svg b/extension/media/gutter-vertgreen.svg similarity index 100% rename from media/gutter-vertgreen.svg rename to extension/media/gutter-vertgreen.svg diff --git a/media/gutter-vertred.svg b/extension/media/gutter-vertred.svg similarity index 100% rename from media/gutter-vertred.svg rename to extension/media/gutter-vertred.svg diff --git a/media/gutter-vertyellow.svg b/extension/media/gutter-vertyellow.svg similarity index 100% rename from media/gutter-vertyellow.svg rename to extension/media/gutter-vertyellow.svg diff --git a/media/reset.css b/extension/media/reset.css similarity index 100% rename from media/reset.css rename to extension/media/reset.css diff --git a/media/vscode.css b/extension/media/vscode.css similarity index 100% rename from media/vscode.css rename to extension/media/vscode.css diff --git a/media/welcome.css b/extension/media/welcome.css similarity index 100% rename from media/welcome.css rename to extension/media/welcome.css diff --git a/media/welcome.js b/extension/media/welcome.js similarity index 100% rename from media/welcome.js rename to extension/media/welcome.js diff --git a/package-lock.json b/extension/package-lock.json similarity index 100% rename from package-lock.json rename to extension/package-lock.json diff --git a/package.json b/extension/package.json similarity index 100% rename from package.json rename to extension/package.json diff --git a/snippets/go.json b/extension/snippets/go.json similarity index 100% rename from snippets/go.json rename to extension/snippets/go.json diff --git a/src/commands/applyCoverprofile.ts b/extension/src/commands/applyCoverprofile.ts similarity index 100% rename from src/commands/applyCoverprofile.ts rename to extension/src/commands/applyCoverprofile.ts diff --git a/src/commands/getConfiguredGoTools.ts b/extension/src/commands/getConfiguredGoTools.ts similarity index 100% rename from src/commands/getConfiguredGoTools.ts rename to extension/src/commands/getConfiguredGoTools.ts diff --git a/src/commands/getCurrentGoPath.ts b/extension/src/commands/getCurrentGoPath.ts similarity index 100% rename from src/commands/getCurrentGoPath.ts rename to extension/src/commands/getCurrentGoPath.ts diff --git a/src/commands/getCurrentGoRoot.ts b/extension/src/commands/getCurrentGoRoot.ts similarity index 100% rename from src/commands/getCurrentGoRoot.ts rename to extension/src/commands/getCurrentGoRoot.ts diff --git a/src/commands/index.ts b/extension/src/commands/index.ts similarity index 100% rename from src/commands/index.ts rename to extension/src/commands/index.ts diff --git a/src/commands/installTools.ts b/extension/src/commands/installTools.ts similarity index 100% rename from src/commands/installTools.ts rename to extension/src/commands/installTools.ts diff --git a/src/commands/runBuilds.ts b/extension/src/commands/runBuilds.ts similarity index 100% rename from src/commands/runBuilds.ts rename to extension/src/commands/runBuilds.ts diff --git a/src/commands/showCommands.ts b/extension/src/commands/showCommands.ts similarity index 100% rename from src/commands/showCommands.ts rename to extension/src/commands/showCommands.ts diff --git a/src/commands/startDebugSession.ts b/extension/src/commands/startDebugSession.ts similarity index 100% rename from src/commands/startDebugSession.ts rename to extension/src/commands/startDebugSession.ts diff --git a/src/commands/startLanguageServer.ts b/extension/src/commands/startLanguageServer.ts similarity index 100% rename from src/commands/startLanguageServer.ts rename to extension/src/commands/startLanguageServer.ts diff --git a/src/commands/toggleGCDetails.ts b/extension/src/commands/toggleGCDetails.ts similarity index 100% rename from src/commands/toggleGCDetails.ts rename to extension/src/commands/toggleGCDetails.ts diff --git a/src/config.ts b/extension/src/config.ts similarity index 100% rename from src/config.ts rename to extension/src/config.ts diff --git a/src/const.ts b/extension/src/const.ts similarity index 100% rename from src/const.ts rename to extension/src/const.ts diff --git a/src/context.ts b/extension/src/context.ts similarity index 100% rename from src/context.ts rename to extension/src/context.ts diff --git a/src/debugAdapter/README.md b/extension/src/debugAdapter/README.md similarity index 100% rename from src/debugAdapter/README.md rename to extension/src/debugAdapter/README.md diff --git a/src/debugAdapter/goDebug.ts b/extension/src/debugAdapter/goDebug.ts similarity index 99% rename from src/debugAdapter/goDebug.ts rename to extension/src/debugAdapter/goDebug.ts index cf1eb3e17f..526f185cb2 100644 --- a/src/debugAdapter/goDebug.ts +++ b/extension/src/debugAdapter/goDebug.ts @@ -1628,7 +1628,9 @@ export class GoDebugSession extends LoggingDebugSession { response, 2007, 'Unable to list global vars: "{e}"', - { e: listPkgVarsErr.toString() } + { + e: listPkgVarsErr.toString() + } ); } const globals = this.delve?.isApiV1 @@ -2088,7 +2090,9 @@ export class GoDebugSession extends LoggingDebugSession { response, 2001, 'Failed to get remote server version: "{e}"', - { e: err.toString() } + { + e: err.toString() + } ); } const clientVersion = this.delve?.isApiV1 ? 1 : 2; diff --git a/src/diffUtils.ts b/extension/src/diffUtils.ts similarity index 100% rename from src/diffUtils.ts rename to extension/src/diffUtils.ts diff --git a/src/export.d.ts b/extension/src/export.d.ts similarity index 100% rename from src/export.d.ts rename to extension/src/export.d.ts diff --git a/src/extensionAPI.ts b/extension/src/extensionAPI.ts similarity index 100% rename from src/extensionAPI.ts rename to extension/src/extensionAPI.ts diff --git a/src/goBaseCodelens.ts b/extension/src/goBaseCodelens.ts similarity index 100% rename from src/goBaseCodelens.ts rename to extension/src/goBaseCodelens.ts diff --git a/src/goBrowsePackage.ts b/extension/src/goBrowsePackage.ts similarity index 100% rename from src/goBrowsePackage.ts rename to extension/src/goBrowsePackage.ts diff --git a/src/goBuild.ts b/extension/src/goBuild.ts similarity index 100% rename from src/goBuild.ts rename to extension/src/goBuild.ts diff --git a/src/goCheck.ts b/extension/src/goCheck.ts similarity index 100% rename from src/goCheck.ts rename to extension/src/goCheck.ts diff --git a/src/goCover.ts b/extension/src/goCover.ts similarity index 100% rename from src/goCover.ts rename to extension/src/goCover.ts diff --git a/src/goDebugConfiguration.ts b/extension/src/goDebugConfiguration.ts similarity index 100% rename from src/goDebugConfiguration.ts rename to extension/src/goDebugConfiguration.ts diff --git a/src/goDebugFactory.ts b/extension/src/goDebugFactory.ts similarity index 100% rename from src/goDebugFactory.ts rename to extension/src/goDebugFactory.ts diff --git a/src/goDeveloperSurvey.ts b/extension/src/goDeveloperSurvey.ts similarity index 100% rename from src/goDeveloperSurvey.ts rename to extension/src/goDeveloperSurvey.ts diff --git a/src/goDocumentSymbols.ts b/extension/src/goDocumentSymbols.ts similarity index 100% rename from src/goDocumentSymbols.ts rename to extension/src/goDocumentSymbols.ts diff --git a/src/goEnv.ts b/extension/src/goEnv.ts similarity index 100% rename from src/goEnv.ts rename to extension/src/goEnv.ts diff --git a/src/goEnvironmentStatus.ts b/extension/src/goEnvironmentStatus.ts similarity index 100% rename from src/goEnvironmentStatus.ts rename to extension/src/goEnvironmentStatus.ts diff --git a/src/goExplorer.ts b/extension/src/goExplorer.ts similarity index 100% rename from src/goExplorer.ts rename to extension/src/goExplorer.ts diff --git a/src/goGenerateTests.ts b/extension/src/goGenerateTests.ts similarity index 100% rename from src/goGenerateTests.ts rename to extension/src/goGenerateTests.ts diff --git a/src/goGetPackage.ts b/extension/src/goGetPackage.ts similarity index 100% rename from src/goGetPackage.ts rename to extension/src/goGetPackage.ts diff --git a/src/goImpl.ts b/extension/src/goImpl.ts similarity index 100% rename from src/goImpl.ts rename to extension/src/goImpl.ts diff --git a/src/goImport.ts b/extension/src/goImport.ts similarity index 100% rename from src/goImport.ts rename to extension/src/goImport.ts diff --git a/src/goInstall.ts b/extension/src/goInstall.ts similarity index 100% rename from src/goInstall.ts rename to extension/src/goInstall.ts diff --git a/src/goInstallTools.ts b/extension/src/goInstallTools.ts similarity index 96% rename from src/goInstallTools.ts rename to extension/src/goInstallTools.ts index eff2c248a7..63ce1a7bf3 100644 --- a/src/goInstallTools.ts +++ b/extension/src/goInstallTools.ts @@ -607,7 +607,10 @@ export async function latestToolVersion(tool: Tool, includePrerelease?: boolean) const { stdout } = await execFile( goCmd, ['list', '-m', '--versions', '-json', `${tool.modulePath}@${version}`], - { env, cwd: tmpDir } + { + env, + cwd: tmpDir + } ); const m = JSON.parse(stdout); // Versions field is a list of all known versions of the module, @@ -794,17 +797,17 @@ export async function listOutdatedTools(configuredGoVersion: GoVersion | undefin // Unlike other tools, it is installed under the extension path (which is cleared // when a new version is installed). export async function installVSCGO( + extensionMode: vscode.ExtensionMode, extensionId: string, extensionVersion: string, extensionPath: string, - isPreview: boolean, - forceInstall = false + isPreview: boolean ): Promise { // golang.go stable, golang.go-nightly stable -> install once per version. // golang.go dev through launch.json -> install every time. const progPath = path.join(extensionPath, 'bin', correctBinname('vscgo')); - if (!forceInstall && executableFileExists(progPath)) { + if (extensionMode === vscode.ExtensionMode.Production && executableFileExists(progPath)) { return progPath; // reuse existing executable. } telemetryReporter.add('vscgo_install', 1); @@ -812,25 +815,24 @@ export async function installVSCGO( await mkdir(path.dirname(progPath), { recursive: true }); const execFile = util.promisify(cp.execFile); - const cwd = path.join(extensionPath, 'vscgo'); + const cwd = path.join(extensionPath); const env = toolExecutionEnvironment(); env['GOBIN'] = path.dirname(progPath); + const importPath = allToolsInformation['vscgo'].importPath; + const version = + extensionMode !== vscode.ExtensionMode.Production + ? '' + : extensionId !== 'golang.go' || isPreview + ? '@master' + : `@v${extensionVersion}`; // build from source acquired from the module proxy if this is a non-preview version. - if (extensionId === 'golang.go' && !isPreview && !extensionVersion.includes('-dev.')) { - const importPath = allToolsInformation['vscgo'].importPath; - try { - const args = ['install', `${importPath}@v${extensionVersion}`]; - await execFile(getBinPath('go'), args, { cwd, env }); - return progPath; - } catch (e) { - telemetryReporter.add('vscgo_install_fail', 1); - console.log(`failed to install ${importPath}@v${extensionVersion};\n${e}`); - console.log('falling back to install the dev version packaged in the extension'); - } + try { + const args = ['install', `${importPath}${version}`]; + await execFile(getBinPath('go'), args, { cwd, env }); + return progPath; + } catch (e) { + telemetryReporter.add('vscgo_install_fail', 1); + return Promise.reject(`failed to install vscgo - ${e}`); } - // build from the source included in vsix or test extension. - const args = ['install', '.']; - await execFile(getBinPath('go'), args, { cwd, env }); // throw error in case of failure. - return progPath; } diff --git a/src/goLint.ts b/extension/src/goLint.ts similarity index 100% rename from src/goLint.ts rename to extension/src/goLint.ts diff --git a/src/goLogging.ts b/extension/src/goLogging.ts similarity index 100% rename from src/goLogging.ts rename to extension/src/goLogging.ts diff --git a/src/goMain.ts b/extension/src/goMain.ts similarity index 99% rename from src/goMain.ts rename to extension/src/goMain.ts index 321b48b6aa..bb5be239c4 100644 --- a/src/goMain.ts +++ b/extension/src/goMain.ts @@ -105,13 +105,12 @@ export async function activate(ctx: vscode.ExtensionContext): Promise telemetryReporter.setTool(path)) .catch((reason) => console.error(reason)); diff --git a/src/goMode.ts b/extension/src/goMode.ts similarity index 100% rename from src/goMode.ts rename to extension/src/goMode.ts diff --git a/src/goModifytags.ts b/extension/src/goModifytags.ts similarity index 100% rename from src/goModifytags.ts rename to extension/src/goModifytags.ts diff --git a/src/goModules.ts b/extension/src/goModules.ts similarity index 100% rename from src/goModules.ts rename to extension/src/goModules.ts diff --git a/src/goPackages.ts b/extension/src/goPackages.ts similarity index 100% rename from src/goPackages.ts rename to extension/src/goPackages.ts diff --git a/src/goPlayground.ts b/extension/src/goPlayground.ts similarity index 100% rename from src/goPlayground.ts rename to extension/src/goPlayground.ts diff --git a/src/goRunTestCodelens.ts b/extension/src/goRunTestCodelens.ts similarity index 100% rename from src/goRunTestCodelens.ts rename to extension/src/goRunTestCodelens.ts diff --git a/src/goStatus.ts b/extension/src/goStatus.ts similarity index 100% rename from src/goStatus.ts rename to extension/src/goStatus.ts diff --git a/src/goSurvey.ts b/extension/src/goSurvey.ts similarity index 100% rename from src/goSurvey.ts rename to extension/src/goSurvey.ts diff --git a/src/goTaskProvider.ts b/extension/src/goTaskProvider.ts similarity index 100% rename from src/goTaskProvider.ts rename to extension/src/goTaskProvider.ts diff --git a/src/goTelemetry.ts b/extension/src/goTelemetry.ts similarity index 100% rename from src/goTelemetry.ts rename to extension/src/goTelemetry.ts diff --git a/src/goTest.ts b/extension/src/goTest.ts similarity index 100% rename from src/goTest.ts rename to extension/src/goTest.ts diff --git a/src/goTest/explore.ts b/extension/src/goTest/explore.ts similarity index 100% rename from src/goTest/explore.ts rename to extension/src/goTest/explore.ts diff --git a/src/goTest/profile.ts b/extension/src/goTest/profile.ts similarity index 100% rename from src/goTest/profile.ts rename to extension/src/goTest/profile.ts diff --git a/src/goTest/resolve.ts b/extension/src/goTest/resolve.ts similarity index 100% rename from src/goTest/resolve.ts rename to extension/src/goTest/resolve.ts diff --git a/src/goTest/run.ts b/extension/src/goTest/run.ts similarity index 100% rename from src/goTest/run.ts rename to extension/src/goTest/run.ts diff --git a/src/goTest/test-explorer.md b/extension/src/goTest/test-explorer.md similarity index 100% rename from src/goTest/test-explorer.md rename to extension/src/goTest/test-explorer.md diff --git a/src/goTest/test_events.md b/extension/src/goTest/test_events.md similarity index 100% rename from src/goTest/test_events.md rename to extension/src/goTest/test_events.md diff --git a/src/goTest/utils.ts b/extension/src/goTest/utils.ts similarity index 100% rename from src/goTest/utils.ts rename to extension/src/goTest/utils.ts diff --git a/src/goTest/walk.ts b/extension/src/goTest/walk.ts similarity index 100% rename from src/goTest/walk.ts rename to extension/src/goTest/walk.ts diff --git a/src/goTools.ts b/extension/src/goTools.ts similarity index 100% rename from src/goTools.ts rename to extension/src/goTools.ts diff --git a/src/goToolsInformation.ts b/extension/src/goToolsInformation.ts similarity index 100% rename from src/goToolsInformation.ts rename to extension/src/goToolsInformation.ts diff --git a/src/goVet.ts b/extension/src/goVet.ts similarity index 100% rename from src/goVet.ts rename to extension/src/goVet.ts diff --git a/src/goVulncheck.ts b/extension/src/goVulncheck.ts similarity index 100% rename from src/goVulncheck.ts rename to extension/src/goVulncheck.ts diff --git a/src/language/goLanguageServer.ts b/extension/src/language/goLanguageServer.ts similarity index 100% rename from src/language/goLanguageServer.ts rename to extension/src/language/goLanguageServer.ts diff --git a/src/language/legacy/goFormat.ts b/extension/src/language/legacy/goFormat.ts similarity index 100% rename from src/language/legacy/goFormat.ts rename to extension/src/language/legacy/goFormat.ts diff --git a/src/language/registerDefaultProviders.ts b/extension/src/language/registerDefaultProviders.ts similarity index 100% rename from src/language/registerDefaultProviders.ts rename to extension/src/language/registerDefaultProviders.ts diff --git a/src/pickProcess.ts b/extension/src/pickProcess.ts similarity index 100% rename from src/pickProcess.ts rename to extension/src/pickProcess.ts diff --git a/src/stateUtils.ts b/extension/src/stateUtils.ts similarity index 100% rename from src/stateUtils.ts rename to extension/src/stateUtils.ts diff --git a/src/subTestUtils.ts b/extension/src/subTestUtils.ts similarity index 100% rename from src/subTestUtils.ts rename to extension/src/subTestUtils.ts diff --git a/src/testUtils.ts b/extension/src/testUtils.ts similarity index 100% rename from src/testUtils.ts rename to extension/src/testUtils.ts diff --git a/src/util.ts b/extension/src/util.ts similarity index 100% rename from src/util.ts rename to extension/src/util.ts diff --git a/src/utils/README.md b/extension/src/utils/README.md similarity index 100% rename from src/utils/README.md rename to extension/src/utils/README.md diff --git a/src/utils/argsUtil.ts b/extension/src/utils/argsUtil.ts similarity index 100% rename from src/utils/argsUtil.ts rename to extension/src/utils/argsUtil.ts diff --git a/src/utils/envUtils.ts b/extension/src/utils/envUtils.ts similarity index 100% rename from src/utils/envUtils.ts rename to extension/src/utils/envUtils.ts diff --git a/src/utils/lsofProcessParser.ts b/extension/src/utils/lsofProcessParser.ts similarity index 100% rename from src/utils/lsofProcessParser.ts rename to extension/src/utils/lsofProcessParser.ts diff --git a/src/utils/mutex.ts b/extension/src/utils/mutex.ts similarity index 100% rename from src/utils/mutex.ts rename to extension/src/utils/mutex.ts diff --git a/src/utils/pathUtils.ts b/extension/src/utils/pathUtils.ts similarity index 100% rename from src/utils/pathUtils.ts rename to extension/src/utils/pathUtils.ts diff --git a/src/utils/processUtils.ts b/extension/src/utils/processUtils.ts similarity index 100% rename from src/utils/processUtils.ts rename to extension/src/utils/processUtils.ts diff --git a/src/utils/psProcessParser.ts b/extension/src/utils/psProcessParser.ts similarity index 100% rename from src/utils/psProcessParser.ts rename to extension/src/utils/psProcessParser.ts diff --git a/src/utils/randomDayutils.ts b/extension/src/utils/randomDayutils.ts similarity index 100% rename from src/utils/randomDayutils.ts rename to extension/src/utils/randomDayutils.ts diff --git a/src/utils/wmicProcessParser.ts b/extension/src/utils/wmicProcessParser.ts similarity index 100% rename from src/utils/wmicProcessParser.ts rename to extension/src/utils/wmicProcessParser.ts diff --git a/src/welcome.ts b/extension/src/welcome.ts similarity index 100% rename from src/welcome.ts rename to extension/src/welcome.ts diff --git a/syntaxes/go.mod.tmGrammar.json b/extension/syntaxes/go.mod.tmGrammar.json similarity index 100% rename from syntaxes/go.mod.tmGrammar.json rename to extension/syntaxes/go.mod.tmGrammar.json diff --git a/syntaxes/go.sum.tmGrammar.json b/extension/syntaxes/go.sum.tmGrammar.json similarity index 100% rename from syntaxes/go.sum.tmGrammar.json rename to extension/syntaxes/go.sum.tmGrammar.json diff --git a/test/gopls/codelens.test.ts b/extension/test/gopls/codelens.test.ts similarity index 100% rename from test/gopls/codelens.test.ts rename to extension/test/gopls/codelens.test.ts diff --git a/test/gopls/configuration.test.ts b/extension/test/gopls/configuration.test.ts similarity index 100% rename from test/gopls/configuration.test.ts rename to extension/test/gopls/configuration.test.ts diff --git a/test/gopls/extension.test.ts b/extension/test/gopls/extension.test.ts similarity index 100% rename from test/gopls/extension.test.ts rename to extension/test/gopls/extension.test.ts diff --git a/test/gopls/goTest.explore.test.ts b/extension/test/gopls/goTest.explore.test.ts similarity index 100% rename from test/gopls/goTest.explore.test.ts rename to extension/test/gopls/goTest.explore.test.ts diff --git a/test/gopls/goTest.resolve.test.ts b/extension/test/gopls/goTest.resolve.test.ts similarity index 100% rename from test/gopls/goTest.resolve.test.ts rename to extension/test/gopls/goTest.resolve.test.ts diff --git a/test/gopls/goTest.run.test.ts b/extension/test/gopls/goTest.run.test.ts similarity index 100% rename from test/gopls/goTest.run.test.ts rename to extension/test/gopls/goTest.run.test.ts diff --git a/test/gopls/goTest.utils.ts b/extension/test/gopls/goTest.utils.ts similarity index 100% rename from test/gopls/goTest.utils.ts rename to extension/test/gopls/goTest.utils.ts diff --git a/test/gopls/goplsTestEnv.utils.ts b/extension/test/gopls/goplsTestEnv.utils.ts similarity index 100% rename from test/gopls/goplsTestEnv.utils.ts rename to extension/test/gopls/goplsTestEnv.utils.ts diff --git a/test/gopls/index.ts b/extension/test/gopls/index.ts similarity index 100% rename from test/gopls/index.ts rename to extension/test/gopls/index.ts diff --git a/test/gopls/report.test.ts b/extension/test/gopls/report.test.ts similarity index 100% rename from test/gopls/report.test.ts rename to extension/test/gopls/report.test.ts diff --git a/test/gopls/survey.test.ts b/extension/test/gopls/survey.test.ts similarity index 100% rename from test/gopls/survey.test.ts rename to extension/test/gopls/survey.test.ts diff --git a/test/gopls/telemetry.test.ts b/extension/test/gopls/telemetry.test.ts similarity index 98% rename from test/gopls/telemetry.test.ts rename to extension/test/gopls/telemetry.test.ts index 055a68aeac..e4ce1728bc 100644 --- a/test/gopls/telemetry.test.ts +++ b/extension/test/gopls/telemetry.test.ts @@ -21,6 +21,7 @@ import os = require('os'); import { rmdirRecursive } from '../../src/util'; import { extensionId } from '../../src/const'; import { executableFileExists, fileExists } from '../../src/utils/pathUtils'; +import { ExtensionMode } from 'vscode'; describe('# prompt for telemetry', () => { it( @@ -186,11 +187,11 @@ describe('# telemetry reporter using vscgo', async () => { suiteSetup(async () => { try { vscgo = await installVSCGO( + ExtensionMode.Test, extensionId, '', extensionDevelopmentPath, - true /*isPreview*/, - true /* force install */ + true /*isPreview*/ ); } catch (e) { assert.fail(`failed to install vscgo needed for testing: ${e}`); diff --git a/test/gopls/testdata/src/workspace/.gitignore b/extension/test/gopls/testdata/src/workspace/.gitignore similarity index 100% rename from test/gopls/testdata/src/workspace/.gitignore rename to extension/test/gopls/testdata/src/workspace/.gitignore diff --git a/test/gopls/testdata/src/workspace/.vscode/settings.json b/extension/test/gopls/testdata/src/workspace/.vscode/settings.json similarity index 100% rename from test/gopls/testdata/src/workspace/.vscode/settings.json rename to extension/test/gopls/testdata/src/workspace/.vscode/settings.json diff --git a/test/gopls/update.test.ts b/extension/test/gopls/update.test.ts similarity index 100% rename from test/gopls/update.test.ts rename to extension/test/gopls/update.test.ts diff --git a/test/gopls/vulncheck.test.ts b/extension/test/gopls/vulncheck.test.ts similarity index 100% rename from test/gopls/vulncheck.test.ts rename to extension/test/gopls/vulncheck.test.ts diff --git a/test/integration/coverage.test.ts b/extension/test/integration/coverage.test.ts similarity index 100% rename from test/integration/coverage.test.ts rename to extension/test/integration/coverage.test.ts diff --git a/test/integration/extension.test.ts b/extension/test/integration/extension.test.ts similarity index 100% rename from test/integration/extension.test.ts rename to extension/test/integration/extension.test.ts diff --git a/test/integration/goDebug.test.ts b/extension/test/integration/goDebug.test.ts similarity index 100% rename from test/integration/goDebug.test.ts rename to extension/test/integration/goDebug.test.ts diff --git a/test/integration/goDebugConfiguration.test.ts b/extension/test/integration/goDebugConfiguration.test.ts similarity index 100% rename from test/integration/goDebugConfiguration.test.ts rename to extension/test/integration/goDebugConfiguration.test.ts diff --git a/test/integration/goExplorer.test.ts b/extension/test/integration/goExplorer.test.ts similarity index 100% rename from test/integration/goExplorer.test.ts rename to extension/test/integration/goExplorer.test.ts diff --git a/test/integration/goTask.test.ts b/extension/test/integration/goTask.test.ts similarity index 100% rename from test/integration/goTask.test.ts rename to extension/test/integration/goTask.test.ts diff --git a/test/integration/goversion.test.ts b/extension/test/integration/goversion.test.ts similarity index 100% rename from test/integration/goversion.test.ts rename to extension/test/integration/goversion.test.ts diff --git a/test/integration/index.ts b/extension/test/integration/index.ts similarity index 100% rename from test/integration/index.ts rename to extension/test/integration/index.ts diff --git a/test/integration/install.test.ts b/extension/test/integration/install.test.ts similarity index 100% rename from test/integration/install.test.ts rename to extension/test/integration/install.test.ts diff --git a/test/integration/pickProcess.test.ts b/extension/test/integration/pickProcess.test.ts similarity index 100% rename from test/integration/pickProcess.test.ts rename to extension/test/integration/pickProcess.test.ts diff --git a/test/integration/stateUtils.test.ts b/extension/test/integration/stateUtils.test.ts similarity index 100% rename from test/integration/stateUtils.test.ts rename to extension/test/integration/stateUtils.test.ts diff --git a/test/integration/statusbar.test.ts b/extension/test/integration/statusbar.test.ts similarity index 100% rename from test/integration/statusbar.test.ts rename to extension/test/integration/statusbar.test.ts diff --git a/test/integration/test.test.ts b/extension/test/integration/test.test.ts similarity index 100% rename from test/integration/test.test.ts rename to extension/test/integration/test.test.ts diff --git a/test/integration/testutils.ts b/extension/test/integration/testutils.ts similarity index 100% rename from test/integration/testutils.ts rename to extension/test/integration/testutils.ts diff --git a/test/integration/utils.test.ts b/extension/test/integration/utils.test.ts similarity index 100% rename from test/integration/utils.test.ts rename to extension/test/integration/utils.test.ts diff --git a/test/integration/welcome.test.ts b/extension/test/integration/welcome.test.ts similarity index 100% rename from test/integration/welcome.test.ts rename to extension/test/integration/welcome.test.ts diff --git a/test/mocks/MockCfg.ts b/extension/test/mocks/MockCfg.ts similarity index 100% rename from test/mocks/MockCfg.ts rename to extension/test/mocks/MockCfg.ts diff --git a/test/mocks/MockContext.ts b/extension/test/mocks/MockContext.ts similarity index 100% rename from test/mocks/MockContext.ts rename to extension/test/mocks/MockContext.ts diff --git a/test/mocks/MockMemento.ts b/extension/test/mocks/MockMemento.ts similarity index 100% rename from test/mocks/MockMemento.ts rename to extension/test/mocks/MockMemento.ts diff --git a/test/mocks/MockTest.ts b/extension/test/mocks/MockTest.ts similarity index 100% rename from test/mocks/MockTest.ts rename to extension/test/mocks/MockTest.ts diff --git a/test/runTest.ts b/extension/test/runTest.ts similarity index 100% rename from test/runTest.ts rename to extension/test/runTest.ts diff --git a/test/testdata/baseTest/go.mod b/extension/test/testdata/baseTest/go.mod similarity index 100% rename from test/testdata/baseTest/go.mod rename to extension/test/testdata/baseTest/go.mod diff --git a/test/testdata/baseTest/sample_test.go b/extension/test/testdata/baseTest/sample_test.go similarity index 100% rename from test/testdata/baseTest/sample_test.go rename to extension/test/testdata/baseTest/sample_test.go diff --git a/test/testdata/baseTest/test.go b/extension/test/testdata/baseTest/test.go similarity index 100% rename from test/testdata/baseTest/test.go rename to extension/test/testdata/baseTest/test.go diff --git a/test/testdata/buildTags/go.mod b/extension/test/testdata/buildTags/go.mod similarity index 100% rename from test/testdata/buildTags/go.mod rename to extension/test/testdata/buildTags/go.mod diff --git a/test/testdata/buildTags/hello.go b/extension/test/testdata/buildTags/hello.go similarity index 100% rename from test/testdata/buildTags/hello.go rename to extension/test/testdata/buildTags/hello.go diff --git a/test/testdata/codelens/codelens2_test.go b/extension/test/testdata/codelens/codelens2_test.go similarity index 100% rename from test/testdata/codelens/codelens2_test.go rename to extension/test/testdata/codelens/codelens2_test.go diff --git a/test/testdata/codelens/codelens_benchmark_test.go b/extension/test/testdata/codelens/codelens_benchmark_test.go similarity index 100% rename from test/testdata/codelens/codelens_benchmark_test.go rename to extension/test/testdata/codelens/codelens_benchmark_test.go diff --git a/test/testdata/codelens/codelens_go118_test.go b/extension/test/testdata/codelens/codelens_go118_test.go similarity index 100% rename from test/testdata/codelens/codelens_go118_test.go rename to extension/test/testdata/codelens/codelens_go118_test.go diff --git a/test/testdata/codelens/codelens_test.go b/extension/test/testdata/codelens/codelens_test.go similarity index 100% rename from test/testdata/codelens/codelens_test.go rename to extension/test/testdata/codelens/codelens_test.go diff --git a/test/testdata/codelens/go.mod b/extension/test/testdata/codelens/go.mod similarity index 100% rename from test/testdata/codelens/go.mod rename to extension/test/testdata/codelens/go.mod diff --git a/test/testdata/codelens/testmain/testmain_test.go b/extension/test/testdata/codelens/testmain/testmain_test.go similarity index 100% rename from test/testdata/codelens/testmain/testmain_test.go rename to extension/test/testdata/codelens/testmain/testmain_test.go diff --git a/test/testdata/completions/exportedMemberDocs.go b/extension/test/testdata/completions/exportedMemberDocs.go similarity index 100% rename from test/testdata/completions/exportedMemberDocs.go rename to extension/test/testdata/completions/exportedMemberDocs.go diff --git a/test/testdata/completions/go.mod b/extension/test/testdata/completions/go.mod similarity index 100% rename from test/testdata/completions/go.mod rename to extension/test/testdata/completions/go.mod diff --git a/test/testdata/completions/nosnippets.go b/extension/test/testdata/completions/nosnippets.go similarity index 100% rename from test/testdata/completions/nosnippets.go rename to extension/test/testdata/completions/nosnippets.go diff --git a/test/testdata/completions/snippets.go b/extension/test/testdata/completions/snippets.go similarity index 100% rename from test/testdata/completions/snippets.go rename to extension/test/testdata/completions/snippets.go diff --git a/test/testdata/completions/unimportedMultiplePkgs.go b/extension/test/testdata/completions/unimportedMultiplePkgs.go similarity index 100% rename from test/testdata/completions/unimportedMultiplePkgs.go rename to extension/test/testdata/completions/unimportedMultiplePkgs.go diff --git a/test/testdata/completions/unimportedPkgs.go b/extension/test/testdata/completions/unimportedPkgs.go similarity index 100% rename from test/testdata/completions/unimportedPkgs.go rename to extension/test/testdata/completions/unimportedPkgs.go diff --git a/test/testdata/condbp/condbp.go b/extension/test/testdata/condbp/condbp.go similarity index 100% rename from test/testdata/condbp/condbp.go rename to extension/test/testdata/condbp/condbp.go diff --git a/test/testdata/condbp/go.mod b/extension/test/testdata/condbp/go.mod similarity index 100% rename from test/testdata/condbp/go.mod rename to extension/test/testdata/condbp/go.mod diff --git a/test/testdata/coverage/a/a.go b/extension/test/testdata/coverage/a/a.go similarity index 100% rename from test/testdata/coverage/a/a.go rename to extension/test/testdata/coverage/a/a.go diff --git a/test/testdata/coverage/b/b.go b/extension/test/testdata/coverage/b/b.go similarity index 100% rename from test/testdata/coverage/b/b.go rename to extension/test/testdata/coverage/b/b.go diff --git a/test/testdata/coverage/cover.out b/extension/test/testdata/coverage/cover.out similarity index 100% rename from test/testdata/coverage/cover.out rename to extension/test/testdata/coverage/cover.out diff --git a/test/testdata/coverage/go.mod b/extension/test/testdata/coverage/go.mod similarity index 100% rename from test/testdata/coverage/go.mod rename to extension/test/testdata/coverage/go.mod diff --git a/test/testdata/cwdTest/cwdTest/go.mod b/extension/test/testdata/cwdTest/cwdTest/go.mod similarity index 100% rename from test/testdata/cwdTest/cwdTest/go.mod rename to extension/test/testdata/cwdTest/cwdTest/go.mod diff --git a/test/testdata/cwdTest/cwdTest/hello.txt b/extension/test/testdata/cwdTest/cwdTest/hello.txt similarity index 100% rename from test/testdata/cwdTest/cwdTest/hello.txt rename to extension/test/testdata/cwdTest/cwdTest/hello.txt diff --git a/test/testdata/cwdTest/cwdTest/main.go b/extension/test/testdata/cwdTest/cwdTest/main.go similarity index 100% rename from test/testdata/cwdTest/cwdTest/main.go rename to extension/test/testdata/cwdTest/cwdTest/main.go diff --git a/test/testdata/cwdTest/hello.txt b/extension/test/testdata/cwdTest/hello.txt similarity index 100% rename from test/testdata/cwdTest/hello.txt rename to extension/test/testdata/cwdTest/hello.txt diff --git a/test/testdata/diffTestData/file1.go b/extension/test/testdata/diffTestData/file1.go similarity index 100% rename from test/testdata/diffTestData/file1.go rename to extension/test/testdata/diffTestData/file1.go diff --git a/test/testdata/diffTestData/file2.go b/extension/test/testdata/diffTestData/file2.go similarity index 100% rename from test/testdata/diffTestData/file2.go rename to extension/test/testdata/diffTestData/file2.go diff --git a/test/testdata/diffTestData/go.mod b/extension/test/testdata/diffTestData/go.mod similarity index 100% rename from test/testdata/diffTestData/go.mod rename to extension/test/testdata/diffTestData/go.mod diff --git a/test/testdata/envTest/main.go b/extension/test/testdata/envTest/main.go similarity index 100% rename from test/testdata/envTest/main.go rename to extension/test/testdata/envTest/main.go diff --git a/test/testdata/errorsTest/errors.go b/extension/test/testdata/errorsTest/errors.go similarity index 100% rename from test/testdata/errorsTest/errors.go rename to extension/test/testdata/errorsTest/errors.go diff --git a/test/testdata/errorsTest/go.mod b/extension/test/testdata/errorsTest/go.mod similarity index 100% rename from test/testdata/errorsTest/go.mod rename to extension/test/testdata/errorsTest/go.mod diff --git a/test/testdata/generatetests/generatetests.go b/extension/test/testdata/generatetests/generatetests.go similarity index 100% rename from test/testdata/generatetests/generatetests.go rename to extension/test/testdata/generatetests/generatetests.go diff --git a/test/testdata/generatetests/go.mod b/extension/test/testdata/generatetests/go.mod similarity index 100% rename from test/testdata/generatetests/go.mod rename to extension/test/testdata/generatetests/go.mod diff --git a/test/testdata/goTestTest/a_test.go b/extension/test/testdata/goTestTest/a_test.go similarity index 100% rename from test/testdata/goTestTest/a_test.go rename to extension/test/testdata/goTestTest/a_test.go diff --git a/test/testdata/goTestTest/b/b_test.go b/extension/test/testdata/goTestTest/b/b_test.go similarity index 100% rename from test/testdata/goTestTest/b/b_test.go rename to extension/test/testdata/goTestTest/b/b_test.go diff --git a/test/testdata/goTestTest/go.mod b/extension/test/testdata/goTestTest/go.mod similarity index 100% rename from test/testdata/goTestTest/go.mod rename to extension/test/testdata/goTestTest/go.mod diff --git a/test/testdata/gogetdocTestData/format.go b/extension/test/testdata/gogetdocTestData/format.go similarity index 100% rename from test/testdata/gogetdocTestData/format.go rename to extension/test/testdata/gogetdocTestData/format.go diff --git a/test/testdata/gogetdocTestData/go.mod b/extension/test/testdata/gogetdocTestData/go.mod similarity index 100% rename from test/testdata/gogetdocTestData/go.mod rename to extension/test/testdata/gogetdocTestData/go.mod diff --git a/test/testdata/gogetdocTestData/test.go b/extension/test/testdata/gogetdocTestData/test.go similarity index 100% rename from test/testdata/gogetdocTestData/test.go rename to extension/test/testdata/gogetdocTestData/test.go diff --git a/test/testdata/goroutineTest/go.mod b/extension/test/testdata/goroutineTest/go.mod similarity index 100% rename from test/testdata/goroutineTest/go.mod rename to extension/test/testdata/goroutineTest/go.mod diff --git a/test/testdata/goroutineTest/main.go b/extension/test/testdata/goroutineTest/main.go similarity index 100% rename from test/testdata/goroutineTest/main.go rename to extension/test/testdata/goroutineTest/main.go diff --git a/test/testdata/helloWorldServer/go.mod b/extension/test/testdata/helloWorldServer/go.mod similarity index 100% rename from test/testdata/helloWorldServer/go.mod rename to extension/test/testdata/helloWorldServer/go.mod diff --git a/test/testdata/helloWorldServer/main.go b/extension/test/testdata/helloWorldServer/main.go similarity index 100% rename from test/testdata/helloWorldServer/main.go rename to extension/test/testdata/helloWorldServer/main.go diff --git a/test/testdata/importTest/cgoImports.go b/extension/test/testdata/importTest/cgoImports.go similarity index 100% rename from test/testdata/importTest/cgoImports.go rename to extension/test/testdata/importTest/cgoImports.go diff --git a/test/testdata/importTest/go.mod b/extension/test/testdata/importTest/go.mod similarity index 100% rename from test/testdata/importTest/go.mod rename to extension/test/testdata/importTest/go.mod diff --git a/test/testdata/importTest/groupImports.go b/extension/test/testdata/importTest/groupImports.go similarity index 100% rename from test/testdata/importTest/groupImports.go rename to extension/test/testdata/importTest/groupImports.go diff --git a/test/testdata/importTest/noimports.go b/extension/test/testdata/importTest/noimports.go similarity index 100% rename from test/testdata/importTest/noimports.go rename to extension/test/testdata/importTest/noimports.go diff --git a/test/testdata/importTest/singleImports.go b/extension/test/testdata/importTest/singleImports.go similarity index 100% rename from test/testdata/importTest/singleImports.go rename to extension/test/testdata/importTest/singleImports.go diff --git a/test/testdata/linterTest/go.mod b/extension/test/testdata/linterTest/go.mod similarity index 100% rename from test/testdata/linterTest/go.mod rename to extension/test/testdata/linterTest/go.mod diff --git a/test/testdata/linterTest/linter_1.go b/extension/test/testdata/linterTest/linter_1.go similarity index 100% rename from test/testdata/linterTest/linter_1.go rename to extension/test/testdata/linterTest/linter_1.go diff --git a/test/testdata/linterTest/linter_2.go b/extension/test/testdata/linterTest/linter_2.go similarity index 100% rename from test/testdata/linterTest/linter_2.go rename to extension/test/testdata/linterTest/linter_2.go diff --git a/test/testdata/loop/go.mod b/extension/test/testdata/loop/go.mod similarity index 100% rename from test/testdata/loop/go.mod rename to extension/test/testdata/loop/go.mod diff --git a/test/testdata/loop/loop.go b/extension/test/testdata/loop/loop.go similarity index 100% rename from test/testdata/loop/loop.go rename to extension/test/testdata/loop/loop.go diff --git a/test/testdata/outlineTest/go.mod b/extension/test/testdata/outlineTest/go.mod similarity index 100% rename from test/testdata/outlineTest/go.mod rename to extension/test/testdata/outlineTest/go.mod diff --git a/test/testdata/outlineTest/test.go b/extension/test/testdata/outlineTest/test.go similarity index 100% rename from test/testdata/outlineTest/test.go rename to extension/test/testdata/outlineTest/test.go diff --git a/test/testdata/panic/go.mod b/extension/test/testdata/panic/go.mod similarity index 100% rename from test/testdata/panic/go.mod rename to extension/test/testdata/panic/go.mod diff --git a/test/testdata/panic/panic.go b/extension/test/testdata/panic/panic.go similarity index 100% rename from test/testdata/panic/panic.go rename to extension/test/testdata/panic/panic.go diff --git a/test/testdata/runtimeError/go.mod b/extension/test/testdata/runtimeError/go.mod similarity index 100% rename from test/testdata/runtimeError/go.mod rename to extension/test/testdata/runtimeError/go.mod diff --git a/test/testdata/runtimeError/oops.go b/extension/test/testdata/runtimeError/oops.go similarity index 100% rename from test/testdata/runtimeError/oops.go rename to extension/test/testdata/runtimeError/oops.go diff --git a/test/testdata/sleep/go.mod b/extension/test/testdata/sleep/go.mod similarity index 100% rename from test/testdata/sleep/go.mod rename to extension/test/testdata/sleep/go.mod diff --git a/test/testdata/sleep/sleep.go b/extension/test/testdata/sleep/sleep.go similarity index 100% rename from test/testdata/sleep/sleep.go rename to extension/test/testdata/sleep/sleep.go diff --git a/test/testdata/stretchrTestSuite/go.mod b/extension/test/testdata/stretchrTestSuite/go.mod similarity index 100% rename from test/testdata/stretchrTestSuite/go.mod rename to extension/test/testdata/stretchrTestSuite/go.mod diff --git a/test/testdata/stretchrTestSuite/go.sum b/extension/test/testdata/stretchrTestSuite/go.sum similarity index 100% rename from test/testdata/stretchrTestSuite/go.sum rename to extension/test/testdata/stretchrTestSuite/go.sum diff --git a/test/testdata/stretchrTestSuite/suite_test.go b/extension/test/testdata/stretchrTestSuite/suite_test.go similarity index 100% rename from test/testdata/stretchrTestSuite/suite_test.go rename to extension/test/testdata/stretchrTestSuite/suite_test.go diff --git a/test/testdata/subTest/go.mod b/extension/test/testdata/subTest/go.mod similarity index 100% rename from test/testdata/subTest/go.mod rename to extension/test/testdata/subTest/go.mod diff --git a/test/testdata/subTest/sub_test.go b/extension/test/testdata/subTest/sub_test.go similarity index 100% rename from test/testdata/subTest/sub_test.go rename to extension/test/testdata/subTest/sub_test.go diff --git a/test/testdata/testTags/go.mod b/extension/test/testdata/testTags/go.mod similarity index 100% rename from test/testdata/testTags/go.mod rename to extension/test/testdata/testTags/go.mod diff --git a/test/testdata/testTags/hello_test.go b/extension/test/testdata/testTags/hello_test.go similarity index 100% rename from test/testdata/testTags/hello_test.go rename to extension/test/testdata/testTags/hello_test.go diff --git a/test/testdata/vendoring/main.go b/extension/test/testdata/vendoring/main.go similarity index 100% rename from test/testdata/vendoring/main.go rename to extension/test/testdata/vendoring/main.go diff --git a/test/testdata/vendoring/vendor/example/vendorpls/lib.go b/extension/test/testdata/vendoring/vendor/example/vendorpls/lib.go similarity index 100% rename from test/testdata/vendoring/vendor/example/vendorpls/lib.go rename to extension/test/testdata/vendoring/vendor/example/vendorpls/lib.go diff --git a/test/testdata/vuln/go.work b/extension/test/testdata/vuln/go.work similarity index 100% rename from test/testdata/vuln/go.work rename to extension/test/testdata/vuln/go.work diff --git a/test/testdata/vuln/mod1/go.mod b/extension/test/testdata/vuln/mod1/go.mod similarity index 100% rename from test/testdata/vuln/mod1/go.mod rename to extension/test/testdata/vuln/mod1/go.mod diff --git a/test/testdata/vuln/mod1/go.sum b/extension/test/testdata/vuln/mod1/go.sum similarity index 100% rename from test/testdata/vuln/mod1/go.sum rename to extension/test/testdata/vuln/mod1/go.sum diff --git a/test/testdata/vuln/mod1/test.go b/extension/test/testdata/vuln/mod1/test.go similarity index 100% rename from test/testdata/vuln/mod1/test.go rename to extension/test/testdata/vuln/mod1/test.go diff --git a/test/testdata/vuln/mod2/go.mod b/extension/test/testdata/vuln/mod2/go.mod similarity index 100% rename from test/testdata/vuln/mod2/go.mod rename to extension/test/testdata/vuln/mod2/go.mod diff --git a/test/testdata/vuln/mod2/test.go b/extension/test/testdata/vuln/mod2/test.go similarity index 100% rename from test/testdata/vuln/mod2/test.go rename to extension/test/testdata/vuln/mod2/test.go diff --git a/test/testdata/vuln/vulndb/GO-1970-FMT.json b/extension/test/testdata/vuln/vulndb/GO-1970-FMT.json similarity index 100% rename from test/testdata/vuln/vulndb/GO-1970-FMT.json rename to extension/test/testdata/vuln/vulndb/GO-1970-FMT.json diff --git a/test/testdata/vuln/vulndb/GO-1970-TEXT.json b/extension/test/testdata/vuln/vulndb/GO-1970-TEXT.json similarity index 100% rename from test/testdata/vuln/vulndb/GO-1970-TEXT.json rename to extension/test/testdata/vuln/vulndb/GO-1970-TEXT.json diff --git a/test/unit/calendartest.ts b/extension/test/unit/calendartest.ts similarity index 100% rename from test/unit/calendartest.ts rename to extension/test/unit/calendartest.ts diff --git a/test/unit/logger.test.ts b/extension/test/unit/logger.test.ts similarity index 100% rename from test/unit/logger.test.ts rename to extension/test/unit/logger.test.ts diff --git a/test/unit/mutex.test.ts b/extension/test/unit/mutex.test.ts similarity index 100% rename from test/unit/mutex.test.ts rename to extension/test/unit/mutex.test.ts diff --git a/test/unit/subTestUtils.test.ts b/extension/test/unit/subTestUtils.test.ts similarity index 100% rename from test/unit/subTestUtils.test.ts rename to extension/test/unit/subTestUtils.test.ts diff --git a/test/unit/util.test.ts b/extension/test/unit/util.test.ts similarity index 100% rename from test/unit/util.test.ts rename to extension/test/unit/util.test.ts diff --git a/third_party/README.md b/extension/third_party/README.md similarity index 100% rename from third_party/README.md rename to extension/third_party/README.md diff --git a/third_party/tree-kill/LICENSE b/extension/third_party/tree-kill/LICENSE similarity index 100% rename from third_party/tree-kill/LICENSE rename to extension/third_party/tree-kill/LICENSE diff --git a/third_party/tree-kill/README.md b/extension/third_party/tree-kill/README.md similarity index 100% rename from third_party/tree-kill/README.md rename to extension/third_party/tree-kill/README.md diff --git a/third_party/tree-kill/index.d.ts b/extension/third_party/tree-kill/index.d.ts similarity index 100% rename from third_party/tree-kill/index.d.ts rename to extension/third_party/tree-kill/index.d.ts diff --git a/third_party/tree-kill/index.js b/extension/third_party/tree-kill/index.js similarity index 100% rename from third_party/tree-kill/index.js rename to extension/third_party/tree-kill/index.js diff --git a/third_party/tree-kill/package.json b/extension/third_party/tree-kill/package.json similarity index 100% rename from third_party/tree-kill/package.json rename to extension/third_party/tree-kill/package.json diff --git a/tools/allTools.ts.in b/extension/tools/allTools.ts.in similarity index 100% rename from tools/allTools.ts.in rename to extension/tools/allTools.ts.in diff --git a/tools/docs2wiki/main.go b/extension/tools/docs2wiki/main.go similarity index 100% rename from tools/docs2wiki/main.go rename to extension/tools/docs2wiki/main.go diff --git a/tools/docs2wiki/main_test.go b/extension/tools/docs2wiki/main_test.go similarity index 100% rename from tools/docs2wiki/main_test.go rename to extension/tools/docs2wiki/main_test.go diff --git a/tools/generate.go b/extension/tools/generate.go similarity index 98% rename from tools/generate.go rename to extension/tools/generate.go index d806abe3cf..725dafa58c 100644 --- a/tools/generate.go +++ b/extension/tools/generate.go @@ -28,7 +28,7 @@ import ( "sort" "strings" - "github.com/golang/vscode-go/tools/goplssetting" + "github.com/golang/vscode-go/extension/tools/goplssetting" ) var ( @@ -52,7 +52,7 @@ func checkAndWrite(filename string, oldContent, newContent []byte) { } fmt.Printf("updated %s\n", filename) } else { - base := filepath.Join("docs", filepath.Base(filename)) + base := filepath.Join("..", "docs", filepath.Base(filename)) fmt.Printf(`%s have changed in the package.json, but documentation in %s was not updated. To update the settings, run "go run tools/generate.go -w". `, strings.TrimSuffix(base, ".md"), base) @@ -180,7 +180,7 @@ func main() { b.WriteString("\n\n") } } - rewrite(filepath.Join(dir, "docs", "commands.md"), b.Bytes()) + rewrite(filepath.Join(dir, "..", "docs", "commands.md"), b.Bytes()) // Clear so that we can rewrite settings.md. b.Reset() @@ -218,11 +218,11 @@ func main() { b.WriteString("## Settings for `gopls`\n\n") writeGoplsSettingsSection(b, goplsProperty) - rewrite(filepath.Join(dir, "docs", "settings.md"), b.Bytes()) + rewrite(filepath.Join(dir, "..", "docs", "settings.md"), b.Bytes()) b.Reset() generateDebugConfigTable(b, pkgJSON) - rewriteDebugDoc(filepath.Join(dir, "docs", "debugging.md"), b.Bytes()) + rewriteDebugDoc(filepath.Join(dir, "..", "docs", "debugging.md"), b.Bytes()) // Only update the latest tool versions if the flag is set. if !*updateLatestToolVersionsFlag { diff --git a/tools/goplssetting/goplssetting.go b/extension/tools/goplssetting/goplssetting.go similarity index 100% rename from tools/goplssetting/goplssetting.go rename to extension/tools/goplssetting/goplssetting.go diff --git a/tools/goplssetting/goplssetting_test.go b/extension/tools/goplssetting/goplssetting_test.go similarity index 100% rename from tools/goplssetting/goplssetting_test.go rename to extension/tools/goplssetting/goplssetting_test.go diff --git a/tools/installtools/main.go b/extension/tools/installtools/main.go similarity index 100% rename from tools/installtools/main.go rename to extension/tools/installtools/main.go diff --git a/tools/installtools/main_test.go b/extension/tools/installtools/main_test.go similarity index 100% rename from tools/installtools/main_test.go rename to extension/tools/installtools/main_test.go diff --git a/tools/license.sh b/extension/tools/license.sh similarity index 100% rename from tools/license.sh rename to extension/tools/license.sh diff --git a/build/release.go b/extension/tools/release/release.go similarity index 98% rename from build/release.go rename to extension/tools/release/release.go index 15162f4994..bfa06d9d9d 100644 --- a/build/release.go +++ b/extension/tools/release/release.go @@ -79,7 +79,7 @@ func requireEnvVars(vars ...string) { } } -// checkWD checks if the working directory is the root of the repository where package.json is located. +// checkWD checks if the working directory is the extension directory where package.json is located. func checkWD() { wd, err := os.Getwd() if err != nil { diff --git a/tools/relnotes/relnotes.go b/extension/tools/relnotes/relnotes.go similarity index 100% rename from tools/relnotes/relnotes.go rename to extension/tools/relnotes/relnotes.go diff --git a/tsconfig.json b/extension/tsconfig.json similarity index 100% rename from tsconfig.json rename to extension/tsconfig.json diff --git a/typings/diff.d.ts b/extension/typings/diff.d.ts similarity index 100% rename from typings/diff.d.ts rename to extension/typings/diff.d.ts diff --git a/typings/json-rpc2.d.ts b/extension/typings/json-rpc2.d.ts similarity index 100% rename from typings/json-rpc2.d.ts rename to extension/typings/json-rpc2.d.ts diff --git a/typings/lodash.d.ts b/extension/typings/lodash.d.ts similarity index 100% rename from typings/lodash.d.ts rename to extension/typings/lodash.d.ts diff --git a/go.mod b/go.mod index d6095c366e..3a657d0e13 100644 --- a/go.mod +++ b/go.mod @@ -1,40 +1,10 @@ module github.com/golang/vscode-go -go 1.18 +go 1.21 -require ( - github.com/google/go-cmp v0.5.9 - github.com/stamblerre/work-stats v0.0.0-20221215212512-f2f2cf51e506 - golang.org/x/build v0.0.0-20230221151429-f03e733dd241 -) +require golang.org/x/telemetry v0.0.0-20240104150930-463b4b688e47 require ( - cloud.google.com/go/compute v1.21.0 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.1 // indirect - cloud.google.com/go/secretmanager v1.11.1 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/go-github v17.0.0+incompatible // indirect - github.com/google/go-querystring v1.1.0 // indirect - github.com/google/s2a-go v0.1.4 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.11.0 // indirect - github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect - github.com/stamblerre/sheets v0.0.0-20220322044539-54bdb620f700 // indirect - go.opencensus.io v0.24.0 // indirect - go4.org v0.0.0-20180809161055-417644f6feb5 // indirect - golang.org/x/crypto v0.14.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/oauth2 v0.10.0 // indirect - golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect - google.golang.org/api v0.126.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect - google.golang.org/grpc v1.58.3 // indirect - google.golang.org/protobuf v1.31.0 // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/sys v0.16.0 // indirect ) diff --git a/go.sum b/go.sum index 980f67569c..d113ac4c47 100644 --- a/go.sum +++ b/go.sum @@ -1,216 +1,6 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go/compute v1.21.0 h1:JNBsyXVoOoNJtTQcnEY5uYpZIbeCTYIeDe0Xh1bySMk= -cloud.google.com/go/compute v1.21.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y= -cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= -cloud.google.com/go/secretmanager v1.11.1 h1:cLTCwAjFh9fKvU6F13Y4L9vPcx9yiWPyWXE4+zkuEQs= -cloud.google.com/go/secretmanager v1.11.1/go.mod h1:znq9JlXgTNdBeQk9TBW/FnR/W4uChEKGeqQWAJ8SXFw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= -github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= -github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/stamblerre/sheets v0.0.0-20220322044539-54bdb620f700 h1:04VNnGQnE26PVIdxBjeJfCLS2W/5u8H8hFym+0EMf+s= -github.com/stamblerre/sheets v0.0.0-20220322044539-54bdb620f700/go.mod h1:XK977hNdUZpQFoSGTEDpbQicSofCnB1PT1CdOOf1lzs= -github.com/stamblerre/work-stats v0.0.0-20221215212512-f2f2cf51e506 h1:YQ1/WiCB8AV8giB+KO9CxheDJuD2Zl4su+vAQdv2ItQ= -github.com/stamblerre/work-stats v0.0.0-20221215212512-f2f2cf51e506/go.mod h1:G94Cv2VI3I+UtGIIah0eQE4OZBVZ3Z9r+XTmQfKlPk4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go4.org v0.0.0-20180809161055-417644f6feb5 h1:+hE86LblG4AyDgwMCLTE6FOlM9+qjHSYS+rKqxUVdsM= -go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -golang.org/x/build v0.0.0-20230221151429-f03e733dd241 h1:sznAkJX6CdC88Rd77YOVArrsvyFr3uL+mNuAJngyW20= -golang.org/x/build v0.0.0-20230221151429-f03e733dd241/go.mod h1:Pe8oJaqVQS1ECtyqKtYOzVRP1if83ekUSSbEkkFYBIM= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= -golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= -google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 h1:Z0hjGZePRE0ZBWotvtrwxFNrNE9CUAGtplaDK5NNI/g= -google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= -google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/telemetry v0.0.0-20240104150930-463b4b688e47 h1:OhY/KFZPGLcoV+r5kqpxht3i8M4QdIP2EAsKr+wddho= +golang.org/x/telemetry v0.0.0-20240104150930-463b4b688e47/go.mod h1:ZthVHHkOi8rlMEsfFr3Ie42Ym1NonbFNNRKW3ci0UrU= diff --git a/internal/vscgo/main.go b/internal/vscgo/main.go new file mode 100644 index 0000000000..506eb247f6 --- /dev/null +++ b/internal/vscgo/main.go @@ -0,0 +1,250 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// The package vscgo is an implementation of +// github.com/golang/vscode-go/vscgo. This is in +// a separate internal package, so +// github.com/golang/vscode-go/extension can import. +package vscgo + +import ( + "bufio" + "flag" + "fmt" + "log" + "os" + "runtime/debug" + "strings" + "time" + + "golang.org/x/telemetry/counter" +) + +type command struct { + usage string + short string + flags *flag.FlagSet + hasArgs bool + run func(args []string) error +} + +func (c command) name() string { + name, _, _ := strings.Cut(c.usage, " ") + return name +} + +var allCommands []*command + +func init() { + allCommands = []*command{ + { + usage: "inc_counters", + short: "increment telemetry counters", + run: runIncCounters, + }, + { + usage: "version", + short: "print version information", + run: runVersion, + }, + { + usage: "help ", + short: "show help for a command", + hasArgs: true, + run: runHelp, // accesses allCommands. + }, + } + + for _, cmd := range allCommands { + name := cmd.name() + if cmd.flags == nil { + cmd.flags = flag.NewFlagSet(name, flag.ExitOnError) + } + cmd.flags.Usage = func() { + help(name) + } + } +} + +func Main() { + counter.Open() + log.SetFlags(0) + flag.Usage = usage + flag.Parse() + + args := flag.Args() + var cmd *command + if len(args) > 0 { + cmd = findCommand(args[0]) + } + if cmd == nil { + flag.Usage() + os.Exit(2) + } + cmd.flags.Parse(args[1:]) // will exit on error + args = cmd.flags.Args() + if !cmd.hasArgs && len(args) > 0 { + help(cmd.name()) + failf("\ncommand %q does not accept any arguments.\n", cmd.name()) + } + if err := cmd.run(args); err != nil { + failf("%v\n", err) + } +} + +func output(msgs ...interface{}) { + fmt.Fprintln(flag.CommandLine.Output(), msgs...) +} + +func usage() { + printCommand := func(cmd *command) { + output(fmt.Sprintf("\t%s\t%s", cmd.name(), cmd.short)) + } + output("vscgo is a helper tool for the VS Code Go extension, written in Go.") + output() + output("Usage:") + output() + output("\tvscgo [arguments]") + output() + output("The commands are:") + output() + for _, cmd := range allCommands { + printCommand(cmd) + } + output() + output(`Use "vscgo help " for details about any command.`) + output() +} + +func failf(format string, args ...any) { + fmt.Fprintf(os.Stderr, format, args...) + os.Exit(1) +} + +func findCommand(name string) *command { + for _, cmd := range allCommands { + if cmd.name() == name { + return cmd + } + } + return nil +} + +func help(name string) { + cmd := findCommand(name) + if cmd == nil { + failf("unknown command %q\n", name) + } + output(fmt.Sprintf("Usage: vscgo %s", cmd.usage)) + output() + output(fmt.Sprintf("%s is used to %s.", cmd.name(), cmd.short)) + anyflags := false + cmd.flags.VisitAll(func(*flag.Flag) { + anyflags = true + }) + if anyflags { + output() + output("Flags:") + output() + cmd.flags.PrintDefaults() + } +} + +// runIncCounters increments telemetry counters read from stdin. +func runIncCounters(_ []string) error { + scanner := bufio.NewScanner(os.Stdin) + if counterFile := os.Getenv("TELEMETRY_COUNTER_FILE"); counterFile != "" { + return printCounter(counterFile, scanner) + } + return runIncCountersImpl(scanner, counter.Add) +} + +func printCounter(fname string, scanner *bufio.Scanner) (rerr error) { + f, err := os.OpenFile(fname, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644) + if err != nil { + return err + } + defer func() { + if err := f.Close(); rerr == nil { + rerr = err + } + }() + return runIncCountersImpl(scanner, func(name string, count int64) { + fmt.Fprintln(f, name, count) + }) +} + +const ( + incCountersBadInput = "inc_counters_bad_input" +) + +func incCountersInputLength(n int) string { + const name = "inc_counters_num_input" + for i := 1; i < 8; i *= 2 { + if n < i { + return fmt.Sprintf("%s:<%d", name, i) + } + } + return name + ":>=8" +} + +func incCountersDuration(duration time.Duration) string { + const name = "inc_counters_duration" + switch { + case duration < 10*time.Millisecond: + return name + ":<10ms" + case duration < 100*time.Millisecond: + return name + ":<100ms" + case duration < 1*time.Second: + return name + ":<1s" + case duration < 10*time.Second: + return name + ":<10s" + } + return name + ":>=10s" +} + +func runIncCountersImpl(scanner *bufio.Scanner, incCounter func(name string, count int64)) error { + start := time.Now() + linenum := 0 + for scanner.Scan() { + line := strings.TrimSpace(scanner.Text()) + if line == "" { + continue + } + var name string + var count int64 + if _, err := fmt.Sscanf(line, "%s %d", &name, &count); err != nil || count < 0 { + incCounter(incCountersBadInput, 1) + return fmt.Errorf("invalid line: %q", line) + } + linenum++ + incCounter(name, int64(count)) + } + incCounter(incCountersInputLength(linenum), 1) + incCounter(incCountersDuration(time.Since(start)), 1) + return nil +} + +func runVersion(_ []string) error { + info, ok := debug.ReadBuildInfo() + if !ok { + fmt.Println("vscgo: unknown") + fmt.Println("go: unknown") + return nil + } + fmt.Println("vscgo:", info.Main.Version) + fmt.Println("go:", info.GoVersion) + return nil +} + +func runHelp(args []string) error { + switch len(args) { + case 1: + help(args[0]) + default: + flag.Usage() + failf("too many arguments to \"help\"") + } + return nil +} diff --git a/vscgo/main_test.go b/internal/vscgo/main_test.go similarity index 99% rename from vscgo/main_test.go rename to internal/vscgo/main_test.go index 22bdebc7cf..d2fabc3e7e 100644 --- a/vscgo/main_test.go +++ b/internal/vscgo/main_test.go @@ -5,7 +5,7 @@ // The binary vscgo is a helper of the VS Code Go extension. // The source is distributed with the extension and compiled when // the extension is first activated. -package main +package vscgo import ( "bufio" diff --git a/vscgo/go.mod b/vscgo/go.mod deleted file mode 100644 index e5ff6285bb..0000000000 --- a/vscgo/go.mod +++ /dev/null @@ -1,7 +0,0 @@ -module github.com/golang/vscode-go/vscgo - -go 1.20 - -require golang.org/x/telemetry v0.0.0-20231127153925-9e8199583d1d - -require golang.org/x/sys v0.15.0 // indirect diff --git a/vscgo/go.sum b/vscgo/go.sum deleted file mode 100644 index 93899a104f..0000000000 --- a/vscgo/go.sum +++ /dev/null @@ -1,4 +0,0 @@ -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/telemetry v0.0.0-20231127153925-9e8199583d1d h1:ogNR6QNR4EYuxIiZ41ylPQHVyK6iFcGngiOqNHfTc/M= -golang.org/x/telemetry v0.0.0-20231127153925-9e8199583d1d/go.mod h1:2hdX6fx9lgVpcqv/QJBJjwYNa2E/imfPNoTyf/a6vBo= diff --git a/vscgo/main.go b/vscgo/main.go index cf5827e542..ab69ba7f0f 100644 --- a/vscgo/main.go +++ b/vscgo/main.go @@ -1,4 +1,4 @@ -// Copyright 2023 The Go Authors. All rights reserved. +// Copyright 2024 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -7,243 +7,8 @@ // the extension is first activated. package main -import ( - "bufio" - "flag" - "fmt" - "log" - "os" - "runtime/debug" - "strings" - "time" - - "golang.org/x/telemetry/counter" -) - -type command struct { - usage string - short string - flags *flag.FlagSet - hasArgs bool - run func(args []string) error -} - -func (c command) name() string { - name, _, _ := strings.Cut(c.usage, " ") - return name -} - -var allCommands []*command - -func init() { - allCommands = []*command{ - { - usage: "inc_counters", - short: "increment telemetry counters", - run: runIncCounters, - }, - { - usage: "version", - short: "print version information", - run: runVersion, - }, - { - usage: "help ", - short: "show help for a command", - hasArgs: true, - run: runHelp, // accesses allCommands. - }, - } - - for _, cmd := range allCommands { - name := cmd.name() - if cmd.flags == nil { - cmd.flags = flag.NewFlagSet(name, flag.ExitOnError) - } - cmd.flags.Usage = func() { - help(name) - } - } -} +import "github.com/golang/vscode-go/internal/vscgo" func main() { - counter.Open() - log.SetFlags(0) - flag.Usage = usage - flag.Parse() - - args := flag.Args() - var cmd *command - if len(args) > 0 { - cmd = findCommand(args[0]) - } - if cmd == nil { - flag.Usage() - os.Exit(2) - } - cmd.flags.Parse(args[1:]) // will exit on error - args = cmd.flags.Args() - if !cmd.hasArgs && len(args) > 0 { - help(cmd.name()) - failf("\ncommand %q does not accept any arguments.\n", cmd.name()) - } - if err := cmd.run(args); err != nil { - failf("%v\n", err) - } -} - -func output(msgs ...interface{}) { - fmt.Fprintln(flag.CommandLine.Output(), msgs...) -} - -func usage() { - printCommand := func(cmd *command) { - output(fmt.Sprintf("\t%s\t%s", cmd.name(), cmd.short)) - } - output("vscgo is a helper tool for the VS Code Go extension, written in Go.") - output() - output("Usage:") - output() - output("\tvscgo [arguments]") - output() - output("The commands are:") - output() - for _, cmd := range allCommands { - printCommand(cmd) - } - output() - output(`Use "vscgo help " for details about any command.`) - output() -} - -func failf(format string, args ...any) { - fmt.Fprintf(os.Stderr, format, args...) - os.Exit(1) -} - -func findCommand(name string) *command { - for _, cmd := range allCommands { - if cmd.name() == name { - return cmd - } - } - return nil -} - -func help(name string) { - cmd := findCommand(name) - if cmd == nil { - failf("unknown command %q\n", name) - } - output(fmt.Sprintf("Usage: vscgo %s", cmd.usage)) - output() - output(fmt.Sprintf("%s is used to %s.", cmd.name(), cmd.short)) - anyflags := false - cmd.flags.VisitAll(func(*flag.Flag) { - anyflags = true - }) - if anyflags { - output() - output("Flags:") - output() - cmd.flags.PrintDefaults() - } -} - -// runIncCounters increments telemetry counters read from stdin. -func runIncCounters(_ []string) error { - scanner := bufio.NewScanner(os.Stdin) - if counterFile := os.Getenv("TELEMETRY_COUNTER_FILE"); counterFile != "" { - return printCounter(counterFile, scanner) - } - return runIncCountersImpl(scanner, counter.Add) -} - -func printCounter(fname string, scanner *bufio.Scanner) (rerr error) { - f, err := os.OpenFile(fname, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644) - if err != nil { - return err - } - defer func() { - if err := f.Close(); rerr == nil { - rerr = err - } - }() - return runIncCountersImpl(scanner, func(name string, count int64) { - fmt.Fprintln(f, name, count) - }) -} - -const ( - incCountersBadInput = "inc_counters_bad_input" -) - -func incCountersInputLength(n int) string { - const name = "inc_counters_num_input" - for i := 1; i < 8; i *= 2 { - if n < i { - return fmt.Sprintf("%s:<%d", name, i) - } - } - return name + ":>=8" -} - -func incCountersDuration(duration time.Duration) string { - const name = "inc_counters_duration" - switch { - case duration < 10*time.Millisecond: - return name + ":<10ms" - case duration < 100*time.Millisecond: - return name + ":<100ms" - case duration < 1*time.Second: - return name + ":<1s" - case duration < 10*time.Second: - return name + ":<10s" - } - return name + ":>=10s" -} - -func runIncCountersImpl(scanner *bufio.Scanner, incCounter func(name string, count int64)) error { - start := time.Now() - linenum := 0 - for scanner.Scan() { - line := strings.TrimSpace(scanner.Text()) - if line == "" { - continue - } - var name string - var count int64 - if _, err := fmt.Sscanf(line, "%s %d", &name, &count); err != nil || count < 0 { - incCounter(incCountersBadInput, 1) - return fmt.Errorf("invalid line: %q", line) - } - linenum++ - incCounter(name, int64(count)) - } - incCounter(incCountersInputLength(linenum), 1) - incCounter(incCountersDuration(time.Since(start)), 1) - return nil -} - -func runVersion(_ []string) error { - info, ok := debug.ReadBuildInfo() - if !ok { - fmt.Println("vscgo: unknown") - fmt.Println("go: unknown") - return nil - } - fmt.Println("vscgo:", info.Main.Version) - fmt.Println("go:", info.GoVersion) - return nil -} - -func runHelp(args []string) error { - switch len(args) { - case 1: - help(args[0]) - default: - flag.Usage() - failf("too many arguments to \"help\"") - } - return nil + vscgo.Main() }