Skip to content

Commit

Permalink
Silent Staged LS Installer (#868)
Browse files Browse the repository at this point in the history
* Silent Staged Installer

The terraform-ls installer no longer prompts the user for whether to install an update (or downgrade) and now respects the `extensions.autoUpdate` and `extensions.autoCheckUpdates` settings.

If `extensions.autoUpdate` is set to `true`, the installer checks for updates on activation and installs a new version if available. If set to `false`, then it does not check for updates.

When installing an updated terraform-ls version, it installs to a staging directory and continues activation. On restart it will move the terraform-ls binary from the staging location to the extension path and the new version will be used.

If `extensions.autoCheckUpdates` is set to `true`, the installer automatically checks for updates every 24 hours. If set to `false`, it does not check on a schedule.

An update can either be an upgrade or downgrade, depending on the version set in terraform.languageServer.requiredVersion. If latest or no version is specified, the most current terraform-ls version is used. In either an upgrade or a downgrade, the installer will perform the required action without asking the user.
  • Loading branch information
jpogran authored Dec 17, 2021
1 parent 2874da7 commit 6ed36c9
Show file tree
Hide file tree
Showing 24 changed files with 3,814 additions and 644 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,44 @@ jobs:
- name: lint
run: npm run lint

unit:
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 3

steps:
- name: Checkout Repo
uses: actions/checkout@v2
-
name: Read Node.js version (Unix)
if: ${{ runner.os != 'Windows' }}
id: nodejs-version-unix
run: |
content=`cat ./.nvmrc`
echo "::set-output name=content::$content"
-
name: Read Node.js version (Windows)
if: ${{ runner.os == 'Windows' }}
id: nodejs-version-win
run: |
$content = Get-Content .\.nvmrc -Raw
echo "::set-output name=content::$content"
- name: Setup Node.js
uses: actions/setup-node@v1
with:
# See https://github.com/actions/setup-node/issues/32
node-version: ${{ steps.nodejs-version-unix.outputs.content || steps.nodejs-version-win.outputs.content }}
- name: npm install
run: npm ci
- name: unit test
run: npm run test:unit

test:
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
build/
lsp/
src/
**/__mocks__
out/*.test.*
out/test/
testFixture/
Expand Down
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/src/test/unit/?(*.)+(spec|test).[jt]s?(x)'],
modulePathIgnorePatterns: ['<rootDir>/out/', '<rootDir>/.vscode-test/'],
resetMocks: true,
clearMocks: true,
verbose: true,
silent: true,
// automock: true,
};
Loading

0 comments on commit 6ed36c9

Please sign in to comment.