diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 91a6210d2699..ad647d045c77 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -100,14 +100,25 @@ jobs: - run: npm ci working-directory: editors/code - - run: npx vsce package -o "../../dist/rust-analyzer-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} + - name: Package Extension (release) + if: github.ref == 'refs/heads/release' + run: npx vsce package -o "../../dist/rust-analyzer-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} + working-directory: editors/code + + - name: Package Extension (nightly) + if: github.ref != 'refs/heads/release' + run: npx vsce package -o "../../dist/rust-analyzer-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release working-directory: editors/code - if: matrix.target == 'x86_64-unknown-linux-gnu' run: rm -rf editors/code/server - - if: matrix.target == 'x86_64-unknown-linux-gnu' - run: npx vsce package -o ../../dist/rust-analyzer.vsix + - if: matrix.target == 'x86_64-unknown-linux-gnu' && github.ref == 'refs/heads/release' + run: npx vsce package -o ../../dist/rust-analyzer-no-server.vsix + working-directory: editors/code + + - if: matrix.target == 'x86_64-unknown-linux-gnu' && github.ref != 'refs/heads/release' + run: npx vsce package -o ../../dist/rust-analyzer-no-server.vsix --pre-release working-directory: editors/code - name: Run analysis-stats on rust-analyzer @@ -151,7 +162,14 @@ jobs: - run: npm ci working-directory: editors/code - - run: npx vsce package -o "../../dist/rust-analyzer-alpine-x64.vsix" --target alpine-x64 + - name: Publish Extension (release) + if: github.ref == 'refs/heads/release' + run: npx vsce package -o "../../dist/rust-analyzer-alpine-x64.vsix" --target alpine-x64 + working-directory: editors/code + + - name: Publish Extension (nightly) + if: github.ref != 'refs/heads/release' + run: npx vsce package -o "../../dist/rust-analyzer-alpine-x64.vsix" --target alpine-x64 --pre-release working-directory: editors/code - run: rm -rf editors/code/server @@ -223,11 +241,19 @@ jobs: name: ${{ env.TAG }} token: ${{ secrets.GITHUB_TOKEN }} + - run: rm dist/rust-analyzer-no-server.vsix + - run: npm ci working-directory: ./editors/code - - name: Publish Extension + - name: Publish Extension (release) if: github.ref == 'refs/heads/release' working-directory: ./editors/code # token from https://dev.azure.com/rust-analyzer/ run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix + + - name: Publish Extension (nightly) + # check specifically for nightly in case someone triggers a release on a feature branch + if: github.ref == 'refs/heads/nightly' + working-directory: ./editors/code + run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix --pre-release diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json index 038a07c75a73..8728654662c6 100644 --- a/editors/code/package-lock.json +++ b/editors/code/package-lock.json @@ -17,7 +17,7 @@ }, "devDependencies": { "@types/node": "~14.17.5", - "@types/vscode": "~1.62.0", + "@types/vscode": "~1.63.0", "@typescript-eslint/eslint-plugin": "^5.5.0", "@typescript-eslint/parser": "^5.5.0", "@vscode/test-electron": "^1.6.2", @@ -29,7 +29,7 @@ "vsce": "^2.5.1" }, "engines": { - "vscode": "^1.62.0" + "vscode": "^1.63.0" } }, "node_modules/@eslint/eslintrc": { @@ -143,9 +143,9 @@ "dev": true }, "node_modules/@types/vscode": { - "version": "1.62.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.62.0.tgz", - "integrity": "sha512-iGlQJ1w5e3qPUryroO6v4lxg3ql1ztdTCwQW3xEwFawdyPLoeUSv48SYfMwc7kQA7h6ThUqflZIjgKAykeF9oA==", + "version": "1.63.1", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.63.1.tgz", + "integrity": "sha512-Z+ZqjRcnGfHP86dvx/BtSwWyZPKQ/LBdmAVImY82TphyjOw2KgTKcp7Nx92oNwCTsHzlshwexAG/WiY2JuUm3g==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -4053,9 +4053,9 @@ "dev": true }, "@types/vscode": { - "version": "1.62.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.62.0.tgz", - "integrity": "sha512-iGlQJ1w5e3qPUryroO6v4lxg3ql1ztdTCwQW3xEwFawdyPLoeUSv48SYfMwc7kQA7h6ThUqflZIjgKAykeF9oA==", + "version": "1.63.1", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.63.1.tgz", + "integrity": "sha512-Z+ZqjRcnGfHP86dvx/BtSwWyZPKQ/LBdmAVImY82TphyjOw2KgTKcp7Nx92oNwCTsHzlshwexAG/WiY2JuUm3g==", "dev": true }, "@typescript-eslint/eslint-plugin": { diff --git a/editors/code/package.json b/editors/code/package.json index d70ac9aacbc7..9ab57d7dc5f3 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -21,7 +21,7 @@ "Programming Languages" ], "engines": { - "vscode": "^1.62.0" + "vscode": "^1.63.0" }, "enableProposedApi": true, "scripts": { @@ -44,7 +44,7 @@ }, "devDependencies": { "@types/node": "~14.17.5", - "@types/vscode": "~1.62.0", + "@types/vscode": "~1.63.0", "@typescript-eslint/eslint-plugin": "^5.5.0", "@typescript-eslint/parser": "^5.5.0", "@vscode/test-electron": "^1.6.2", diff --git a/editors/code/src/ast_inspector.ts b/editors/code/src/ast_inspector.ts index 4fdd167bd5f7..28d8b2a5fd85 100644 --- a/editors/code/src/ast_inspector.ts +++ b/editors/code/src/ast_inspector.ts @@ -59,7 +59,7 @@ export class AstInspector implements vscode.HoverProvider, vscode.DefinitionProv } } - private onDidChangeVisibleTextEditors(editors: vscode.TextEditor[]) { + private onDidChangeVisibleTextEditors(editors: readonly vscode.TextEditor[]) { if (!this.findAstTextEditor()) { this.setRustEditor(undefined); return; diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts index a21a742a5716..9248bd1b6f6b 100644 --- a/editors/code/src/lsp_ext.ts +++ b/editors/code/src/lsp_ext.ts @@ -125,7 +125,7 @@ export interface SsrParams { parseOnly: boolean; textDocument: lc.TextDocumentIdentifier; position: lc.Position; - selections: lc.Range[]; + selections: readonly lc.Range[]; } export const ssr = new lc.RequestType('experimental/ssr');