Skip to content

Commit 690cf2e

Browse files
hyangahgopherbot
authored andcommitted
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 #3122 Updates #3121 Change-Id: I04e441ecac71b4ab42e635835d91dcf344353e67 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/554316 Reviewed-by: Suzy Mueller <[email protected]> Auto-Submit: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Commit-Queue: Hyang-Ah Hana Kim <[email protected]>
1 parent b01b0b7 commit 690cf2e

File tree

282 files changed

+705
-598
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+705
-598
lines changed

.github/workflows/test-long-all.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
with:
2929
node-version: '18'
3030
cache: 'npm'
31+
cache-dependency-path: './extension/package-lock.json'
3132

3233
- name: Setup Go
3334
uses: actions/setup-go@v4
@@ -38,34 +39,41 @@ jobs:
3839

3940
- name: Install dependencies
4041
run: npm ci
42+
working-directory: ./extension
4143

4244
- name: Compile
4345
run: npm run vscode:prepublish
46+
working-directory: ./extension
4447

4548
- name: Install Go tools (Modules mode)
4649
run: |
4750
go version
48-
go run ./tools/installtools/main.go
51+
go run ./tools/installtools/main.Go
52+
working-directory: ./extension
4953
env:
5054
GO111MODULE: on
5155
EXT: "${{ matrix.os == 'windows-latest' && '.exe' || ''}}"
5256

5357
- name: Run unit tests
5458
run: npm run unit-test
59+
working-directory: ./extension
5560

5661
- name: Run tests (Linux)
5762
run: xvfb-run -a npm run test
63+
working-directory: ./extension
5864
if: ${{ matrix.os == 'ubuntu-latest' }}
5965
env:
6066
CODE_VERSION: ${{ matrix.version }}
6167
VSCODEGO_BEFORE_RELEASE_TESTS: true
6268
- name: Run tests (Windows/Mac)
6369
run: npm run test
70+
working-directory: ./extension
6471
if: ${{ matrix.os != 'ubuntu-latest' }}
6572
env:
6673
CODE_VERSION: ${{ matrix.version }}
6774
VSCODEGO_BEFORE_RELEASE_TESTS: true
6875

6976
- name: Lint check
7077
run: npm run lint
78+
working-directory: ./extension
7179
if: ${{ matrix.os == 'ubuntu-latest' && matrix.version == 'stable' }}

.github/workflows/test-long.yml

+8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
with:
2828
node-version: '18'
2929
cache: 'npm'
30+
cache-dependency-path: './extension/package-lock.json'
3031

3132
- name: Setup Go
3233
uses: actions/setup-go@v4
@@ -37,32 +38,39 @@ jobs:
3738

3839
- name: Install dependencies
3940
run: npm ci
41+
working-directory: ./extension
4042

4143
- name: Compile
4244
run: npm run vscode:prepublish
45+
working-directory: ./extension
4346

4447
- name: Install Go tools (Modules mode)
4548
run: |
4649
go version
4750
go run ./tools/installtools/main.go
51+
working-directory: ./extension
4852
env:
4953
GO111MODULE: on
5054
EXT: "${{ matrix.os == 'windows-latest' && '.exe' || ''}}"
5155

5256
- name: Run unit tests
5357
run: npm run unit-test
58+
working-directory: ./extension
5459

5560
- name: Run tests (Linux)
5661
run: xvfb-run -a npm run test
62+
working-directory: ./extension
5763
if: ${{ matrix.os == 'ubuntu-latest' }}
5864
env:
5965
CODE_VERSION: ${{ matrix.version }}
6066
- name: Run tests (Windows/Mac)
6167
run: npm run test
68+
working-directory: ./extension
6269
if: ${{ matrix.os != 'ubuntu-latest' }}
6370
env:
6471
CODE_VERSION: ${{ matrix.version }}
6572

6673
- name: Lint check
6774
run: npm run lint
75+
working-directory: ./extension
6876
if: ${{ matrix.os == 'ubuntu-latest' && matrix.version == 'stable' }}

.github/workflows/test-smoke.yml

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
with:
2727
node-version: '18'
2828
cache: 'npm'
29+
cache-dependency-path: './extension/package-lock.json'
2930

3031
- name: Setup Go
3132
uses: actions/setup-go@v4
@@ -36,32 +37,39 @@ jobs:
3637

3738
- name: Install dependencies
3839
run: npm ci
40+
working-directory: ./extension
3941

4042
- name: Compile
4143
run: npm run vscode:prepublish
44+
working-directory: ./extension
4245

4346
- name: Install Go tools (Modules mode)
4447
run: |
4548
go version
4649
go run ./tools/installtools/main.go
50+
working-directory: ./extension
4751
env:
4852
GO111MODULE: on
4953
EXT: "${{ matrix.os == 'windows-latest' && '.exe' || ''}}"
5054

5155
- name: Run unit tests
5256
run: npm run unit-test
57+
working-directory: ./extension
5358

5459
- name: Run tests (Linux)
5560
run: xvfb-run -a npm run test
61+
working-directory: ./extension
5662
if: ${{ matrix.os == 'ubuntu-latest' }}
5763
env:
5864
CODE_VERSION: ${{ matrix.version }}
5965
- name: Run tests (Windows/Mac)
6066
run: npm run test
67+
working-directory: ./extension
6168
if: ${{ matrix.os != 'ubuntu-latest' }}
6269
env:
6370
CODE_VERSION: ${{ matrix.version }}
6471

6572
- name: Lint check
6673
run: npm run lint
74+
working-directory: ./extension
6775
if: ${{ matrix.os == 'ubuntu-latest' && matrix.version == 'stable' }}

.prettierrc.js

-3
This file was deleted.

.vscode/launch.json

+15-35
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"type": "go",
77
"request": "launch",
88
"mode": "debug",
9-
"program": "${workspaceFolder}/tools/generate.go",
10-
"cwd": "${workspaceFolder}"
9+
"program": "${workspaceFolder}/extension/tools/generate.go",
10+
"cwd": "${workspaceFolder}/extension"
1111
},
1212
{
1313
"name": "Launch Extension",
@@ -20,29 +20,15 @@
2020
"--disable-extensions"
2121
],
2222
"outFiles": [
23-
"${workspaceFolder}/dist/**/*.js"
23+
"${workspaceFolder}/extension/dist/**/*.js"
2424
],
2525
"sourceMaps": true,
2626
"smartStep": true,
2727
"preLaunchTask": "npm: bundle-dev",
2828
"env": {
2929
"VSCODE_GO_IN_TEST": "" // Enable code
3030
},
31-
},
32-
{
33-
"name": "Launch as server",
34-
"type": "node",
35-
"request": "launch",
36-
"program": "${workspaceFolder}/dist/debugAdapter.js",
37-
"args": [
38-
"--server=4711"
39-
],
40-
"outFiles": [
41-
"${workspaceFolder}/dist/**/*.js"
42-
],
43-
"sourceMaps": true,
44-
"smartStep": true,
45-
"preLaunchTask": "npm: bundle-dev"
31+
"cwd": "${workspaceFolder}/extension"
4632
},
4733
{
4834
"name": "Launch Extension Tests",
@@ -53,9 +39,9 @@
5339
"args": [
5440
"--disable-extensions",
5541
"--profile-temp",
56-
"--extensionDevelopmentPath=${workspaceFolder}",
57-
"--extensionTestsPath=${workspaceFolder}/out/test/integration/index",
58-
"--user-data-dir=${workspaceFolder}/.user-data-dir-test",
42+
"--extensionDevelopmentPath=${workspaceFolder}/extension",
43+
"--extensionTestsPath=${workspaceFolder}/extension/out/test/integration/index",
44+
"--user-data-dir=${workspaceFolder}/extension/.user-data-dir-test",
5945
"--timeout",
6046
"999999"
6147
],
@@ -66,6 +52,7 @@
6652
"sourceMaps": true,
6753
"smartStep": true,
6854
"preLaunchTask": "npm: watch",
55+
"cwd": "${workspaceFolder}/extension"
6956
},
7057
{
7158
"name": "Launch Extension Tests with Gopls",
@@ -76,41 +63,34 @@
7663
"args": [
7764
"--disable-extensions",
7865
"--profile-temp",
79-
"--extensionDevelopmentPath=${workspaceFolder}",
80-
"--extensionTestsPath=${workspaceFolder}/out/test/gopls/index",
81-
"--user-data-dir=${workspaceFolder}/.user-data-dir-test",
66+
"--extensionDevelopmentPath=${workspaceFolder}/extension",
67+
"--extensionTestsPath=${workspaceFolder}/extension/out/test/gopls/index",
68+
"--user-data-dir=${workspaceFolder}/extension/.user-data-dir-test",
8269
"--timeout", "999999",
8370
],
8471
"env": {
8572
"VSCODE_GO_IN_TEST": "1" // Disable code that shouldn't be used in test
8673
},
8774
"sourceMaps": true,
8875
"preLaunchTask": "npm: watch",
76+
"cwd": "${workspaceFolder}/extension"
8977
},
9078
{
9179
"type": "node",
9280
"request": "launch",
9381
"name": "Launch Unit Tests",
94-
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
82+
"program": "${workspaceFolder}/extension/node_modules/mocha/bin/_mocha",
9583
"args": [
9684
"-u",
9785
"tdd",
9886
"--timeout",
9987
"5000",
10088
"--colors",
101-
"${workspaceFolder}/out/test/unit"
89+
"${workspaceFolder}/extension/out/test/unit"
10290
],
10391
"internalConsoleOptions": "openOnSessionStart",
10492
"preLaunchTask": "npm: watch",
93+
"cwd": "${workspaceFolder}/extension"
10594
},
106-
],
107-
"compounds": [
108-
{
109-
"name": "Extension + Debug server",
110-
"configurations": [
111-
"Launch Extension",
112-
"Launch as server"
113-
]
114-
}
11595
]
11696
}

.vscode/settings.json

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
33
"files.exclude": {
4-
"out": true,
5-
"typings": false
4+
"**/out": true,
5+
"**/.vscode-test": true,
6+
"**/.user-data-dir-test": true,
67
},
78
"search.exclude": {
8-
"**/node_modules": true,
9-
"**/bower_components": true,
10-
"out/": true
9+
"node_modules": true,
10+
"out": true,
11+
"dist": true,
12+
".vscode-test": true,
13+
".user-data-dir-test": true,
1114
},
1215
"editor.insertSpaces": false,
13-
"typescript.tsdk": "node_modules\\typescript\\lib",
16+
"[yaml]": {
17+
"editor.autoIndent": "advanced"
18+
},
1419
}

.vscode/tasks.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
"tasks": [
3434
{
3535
"type": "typescript",
36-
"tsconfig": "./tsconfig.build.json",
36+
"tsconfig": "extension/tsconfig.json",
3737
"problemMatcher": [
3838
"$tsc"
39-
]
39+
],
4040
},
4141
{
4242
"type": "npm",
@@ -50,6 +50,7 @@
5050
"kind": "build",
5151
"isDefault": true
5252
},
53+
"path": "extension"
5354
},
5455
{
5556
"type": "npm",
@@ -59,13 +60,15 @@
5960
"isBackground": true,
6061
"presentation": {
6162
"reveal": "never"
62-
}
63+
},
64+
"path": "extension"
6365
},
6466
{
6567
"type": "npm",
6668
"script": "bundle-dev",
6769
"group": "build",
6870
"problemMatcher": "$esbuild",
71+
"path": "extension"
6972
}
7073
]
7174
}

build/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ENV GOBIN /gobin
66

77
# Install other Go tools tests depend on
88
RUN mkdir -p /scratch/installtools
9-
ADD tools/installtools/main.go /scratch/installtools/main.go
9+
ADD extension/tools/installtools/main.go /scratch/installtools/main.go
1010
RUN go run /scratch/installtools/main.go
1111

1212
FROM node:latest

0 commit comments

Comments
 (0)