diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index be3de6b85ad..42220cb9cd9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,7 +54,7 @@ Alternatively, you can build the extension within VS Code via `Terminal > Run Bu Before running any of the launch commands, be sure to have run the `build` command to ensure that the JavaScript is compiled and the resources are copied to the proper location. -We recommend that you keep `npm run watch` running in the backgound and you only need to re-run `npm run build` in the following situations: +We recommend that you keep `npm run watch` running in the background and you only need to re-run `npm run build` in the following situations: 1. on first checkout 2. whenever any of the non-TypeScript resources have changed @@ -152,7 +152,7 @@ The CLI integration tests require the CodeQL standard libraries in order to run #### Using a mock GitHub API server -Multi-Repo Variant Analyses (MRVA) rely on the GitHub API. In order to make development and testing easy, we have functionality that allows us to intercept requests to the GitHub API and provide mock responses. +Multi-Repo Variant Analyses (MRVA) rely on the GitHub API. In order to make development and testing easy, we have functionality that allows us to intercept requests to the GitHub API and provide mock responses. ##### Using a pre-recorded test scenario diff --git a/extensions/ql-vscode/CHANGELOG.md b/extensions/ql-vscode/CHANGELOG.md index 3938b31033e..eb3519d0fc1 100644 --- a/extensions/ql-vscode/CHANGELOG.md +++ b/extensions/ql-vscode/CHANGELOG.md @@ -2,6 +2,8 @@ ## [UNRELEASED] +- Warn users when their VS Code version is too old to support all features in the vscode-codeql extension. [#1674](https://github.com/github/vscode-codeql/pull/1674) + ## 1.7.5 - 8 November 2022 - Fix a bug where the AST Viewer was not working unless the associated CodeQL library pack is in the workspace. [#1735](https://github.com/github/vscode-codeql/pull/1735) diff --git a/extensions/ql-vscode/README.md b/extensions/ql-vscode/README.md index fa539b2beb2..cc8c48678b8 100644 --- a/extensions/ql-vscode/README.md +++ b/extensions/ql-vscode/README.md @@ -99,7 +99,7 @@ When the results are ready, they're displayed in the CodeQL Query Results view. If there are any problems running a query, a notification is displayed in the bottom right corner of the application. In addition to the error message, the notification includes details of how to fix the problem. -### Keyboad navigation +### Keyboard navigation If you wish to navigate the query results from your keyboard, you can bind shortcuts to the **CodeQL: Navigate Up/Down/Left/Right in Result Viewer** commands. diff --git a/extensions/ql-vscode/src/extension.ts b/extensions/ql-vscode/src/extension.ts index 23c11dbb372..3c6b08bafe9 100644 --- a/extensions/ql-vscode/src/extension.ts +++ b/extensions/ql-vscode/src/extension.ts @@ -16,7 +16,8 @@ import { QuickPickItem, Range, workspace, - ProviderResult + ProviderResult, + version as vscodeVersion } from 'vscode'; import { LanguageClient } from 'vscode-languageclient'; import * as os from 'os'; @@ -24,6 +25,7 @@ import * as fs from 'fs-extra'; import * as path from 'path'; import * as tmp from 'tmp-promise'; import { testExplorerExtensionId, TestHub } from 'vscode-test-adapter-api'; +import * as semver from 'semver'; import { AstViewer } from './astViewer'; import * as archiveFilesystemProvider from './archive-filesystem-provider'; @@ -186,6 +188,13 @@ export interface CodeQLExtensionInterface { readonly dispose: () => void; } +// This is the minimum version of vscode that we _want_ to support. We want to update the language server library, but that +// requires 1.67 or later. If we change the minimum version in the package.json, then anyone on an older version of vscode +// silently be unable to upgrade. So, the solution is to first bump the minimum version here and release. Then +// bump the version in the package.json and release again. This way, anyone on an older version of vscode will get a warning +// before silently being refused to upgrade. +const MIN_VERSION = '1.67.0'; + /** * Returns the CodeQLExtensionInterface, or an empty object if the interface is not * available after activation is complete. This will happen if there is no cli @@ -221,6 +230,9 @@ export async function activate(ctx: ExtensionContext): Promise { - const yesItem = { title: 'Yes', isCloseAffordance: false }; - const noItem = { title: 'No', isCloseAffordance: true }; +export async function showBinaryChoiceDialog(message: string, modal = true, yesTitle = 'Yes', noTitle = 'No'): Promise { + const yesItem = { title: yesTitle, isCloseAffordance: false }; + const noItem = { title: noTitle, isCloseAffordance: true }; const chosenItem = await Window.showInformationMessage(message, { modal }, yesItem, noItem); if (!chosenItem) { return undefined;