diff --git a/client/package-lock.json b/client/package-lock.json index 8ab4bf68..6f075153 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -13,8 +13,8 @@ "vscode-languageclient": "^7.0.0" }, "devDependencies": { - "@types/semver": "7.3.8", - "@types/vscode": "1.60.0", + "@types/semver": "7.3.9", + "@types/vscode": "1.64.0", "vscode-test": "^1.6.1" }, "engines": { @@ -31,15 +31,15 @@ } }, "node_modules/@types/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-D/2EJvAlCEtYFEYmmlGwbGXuK886HzyCc3nZX/tkFTQdEU8jZDAgiv08P162yB17y4ZXZoq7yFAnW4GDBb9Now==", + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.9.tgz", + "integrity": "sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ==", "dev": true }, "node_modules/@types/vscode": { - "version": "1.60.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.60.0.tgz", - "integrity": "sha512-wZt3VTmzYrgZ0l/3QmEbCq4KAJ71K3/hmMQ/nfpv84oH8e81KKwPEoQ5v8dNCxfHFVJ1JabHKmCvqdYOoVm1Ow==", + "version": "1.64.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.64.0.tgz", + "integrity": "sha512-bSlAWz5WtcSL3cO9tAT/KpEH9rv5OBnm93OIIFwdCshaAiqr2bp1AUyEwW9MWeCvZBHEXc3V0fTYVdVyzDNwHA==", "dev": true }, "node_modules/agent-base": { @@ -515,15 +515,15 @@ "dev": true }, "@types/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-D/2EJvAlCEtYFEYmmlGwbGXuK886HzyCc3nZX/tkFTQdEU8jZDAgiv08P162yB17y4ZXZoq7yFAnW4GDBb9Now==", + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.9.tgz", + "integrity": "sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ==", "dev": true }, "@types/vscode": { - "version": "1.60.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.60.0.tgz", - "integrity": "sha512-wZt3VTmzYrgZ0l/3QmEbCq4KAJ71K3/hmMQ/nfpv84oH8e81KKwPEoQ5v8dNCxfHFVJ1JabHKmCvqdYOoVm1Ow==", + "version": "1.64.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.64.0.tgz", + "integrity": "sha512-bSlAWz5WtcSL3cO9tAT/KpEH9rv5OBnm93OIIFwdCshaAiqr2bp1AUyEwW9MWeCvZBHEXc3V0fTYVdVyzDNwHA==", "dev": true }, "agent-base": { diff --git a/client/package.json b/client/package.json index 07e262c6..366e6b1a 100644 --- a/client/package.json +++ b/client/package.json @@ -18,8 +18,8 @@ "vscode-languageclient": "^7.0.0" }, "devDependencies": { - "@types/semver": "7.3.8", - "@types/vscode": "1.60.0", + "@types/semver": "7.3.9", + "@types/vscode": "1.64.0", "vscode-test": "^1.6.1" } } \ No newline at end of file diff --git a/client/src/commands.ts b/client/src/commands.ts index db7ea05a..5caaceac 100644 --- a/client/src/commands.ts +++ b/client/src/commands.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. /** Contains handlers for commands that are enabled in Visual Studio Code for * the extension. */ @@ -16,6 +16,7 @@ import { reloadImportRegistries as reloadImportRegistriesReq, } from "./lsp_extensions"; import * as tasks from "./tasks"; +import { DenoTestController, TestingFeature } from "./testing"; import type { DenoExtensionContext, TestCommandOptions } from "./types"; import { WelcomePanel } from "./welcome"; import { assert, getDenoCommand } from "./util"; @@ -105,6 +106,8 @@ export function startLanguageServer( if (extensionContext.client) { const client = extensionContext.client; extensionContext.client = undefined; + extensionContext.testController?.dispose(); + extensionContext.testController = undefined; extensionContext.statusBar.refresh(extensionContext); vscode.commands.executeCommand("setContext", ENABLEMENT_FLAG, false); await client.stop(); @@ -134,6 +137,8 @@ export function startLanguageServer( serverOptions, extensionContext.clientOptions, ); + const testingFeature = new TestingFeature(); + client.registerFeature(testingFeature); context.subscriptions.push(client.start()); await client.onReady(); @@ -147,6 +152,10 @@ export function startLanguageServer( extensionContext.serverCapabilities = client.initializeResult?.capabilities; extensionContext.statusBar.refresh(extensionContext); + if (testingFeature.enabled) { + context.subscriptions.push(new DenoTestController(extensionContext)); + } + context.subscriptions.push( client.onNotification( registryState, diff --git a/client/src/constants.ts b/client/src/constants.ts index 07b39983..f9b5e4c8 100644 --- a/client/src/constants.ts +++ b/client/src/constants.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. export const ENABLE = "enable"; export const ENABLE_PATHS = "enablePaths"; diff --git a/client/src/content_provider.ts b/client/src/content_provider.ts index c9eec50a..343dfa7f 100644 --- a/client/src/content_provider.ts +++ b/client/src/content_provider.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import { virtualTextDocument } from "./lsp_extensions"; import type { DenoExtensionContext } from "./types"; diff --git a/client/src/debug_config_provider.ts b/client/src/debug_config_provider.ts index a772b981..48f9365d 100644 --- a/client/src/debug_config_provider.ts +++ b/client/src/debug_config_provider.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import type { Settings } from "./types"; import { getDenoCommand } from "./util"; diff --git a/client/src/extension.ts b/client/src/extension.ts index a06985c3..712791a2 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import * as commands from "./commands"; import { ENABLE_PATHS, ENABLEMENT_FLAG, EXTENSION_NS } from "./constants"; @@ -35,6 +35,7 @@ const workspaceSettingsKeys: Array = [ "lint", "path", "suggest", + "testing", "tlsCertificate", "unsafelyIgnoreCertificateErrors", "unstable", @@ -186,7 +187,10 @@ export async function activate( { scheme: "file", language: "markdown" }, ], diagnosticCollectionName: "deno", - initializationOptions: getWorkspaceSettings(), + initializationOptions: getWorkspaceSettings, + markdown: { + isTrusted: true, + }, }; // When a workspace folder is opened, the updates or changes to the workspace diff --git a/client/src/initialize_project.ts b/client/src/initialize_project.ts index 63a7fe50..410ce329 100644 --- a/client/src/initialize_project.ts +++ b/client/src/initialize_project.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import { MultiStepInput } from "./multi_step_input"; diff --git a/client/src/lsp_extensions.ts b/client/src/lsp_extensions.ts index 9e323d43..55dd08de 100644 --- a/client/src/lsp_extensions.ts +++ b/client/src/lsp_extensions.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. /** Contains extensions to the Language Server Protocol that are supported by * the Deno Language Server. @@ -12,7 +12,12 @@ import { RequestType, RequestType0, } from "vscode-languageclient"; -import type { TextDocumentIdentifier } from "vscode-languageclient"; +import type { + Location, + MarkupContent, + Range, + TextDocumentIdentifier, +} from "vscode-languageclient"; export interface CacheParams { referrer: TextDocumentIdentifier; @@ -53,6 +58,205 @@ export const task = new RequestType< "deno/task", ); +export interface TestData { + /** The unique ID for this test/step. */ + id: string; + + /** The display label for the test/step. */ + label: string; + + /** Any test steps that are associated with this test/step */ + steps?: TestData[]; + + /** The range of the owning text document that applies to the test. */ + range?: Range; +} + +export interface TestModuleParams { + /** The text document identifier that the tests are related to. */ + textDocument: TextDocumentIdentifier; + + /** A indication if tests described are _newly_ discovered and should be + * _inserted_ or if the tests associated are a replacement for any existing + * tests. */ + kind: "insert" | "replace"; + + /** The text label for the test module. */ + label: string; + + /** An array of tests that are owned by this test module. */ + tests: TestData[]; +} + +/** Notification of a discovery of a test module. The notification parameters + * include */ +export const testModule = new NotificationType( + "deno/testModule", +); + +export interface TestModuleDeleteParams { + /** The text document identifier that has been removed. */ + textDocument: TextDocumentIdentifier; +} + +export const testModuleDelete = new NotificationType( + "deno/testModuleDelete", +); + +export interface TestRunRequestParams { + /** The id of the test run to be used for future messages. */ + id: number; + + /** The run kind. Currently Deno only supports `"run"` */ + kind: "run" | "coverage" | "debug"; + + /** Test modules or tests to exclude from the test run. */ + exclude?: TestIdentifier[]; + + /** Test modules or tests to include in the test run. */ + include?: TestIdentifier[]; +} + +interface EnqueuedTestModule { + /** The test module the enqueued test IDs relate to */ + textDocument: TextDocumentIdentifier; + + /** The test IDs which are now enqueued for testing */ + ids: string[]; +} + +export interface TestRunResponseParams { + /** Test modules and test IDs that are now enqueued for testing. */ + enqueued: EnqueuedTestModule[]; +} + +export const testRun = new RequestType< + TestRunRequestParams, + TestRunResponseParams, + void +>("deno/testRun"); + +export interface TestIdentifier { + /** The test module the message is related to. */ + textDocument: TextDocumentIdentifier; + + /** The optional ID of the test. If not present, then the message applies to + * all tests in the test module. */ + id?: string; + + /** The optional ID of the step. If not present, then the message only applies + * to the test. */ + stepId?: string; +} + +export interface TestMessage { + /** The content of the message. */ + message: MarkupContent; + + /** An optional string which represents the expected output. */ + expectedOutput?: string; + + /** An optional string which represents the actual output. */ + actualOutput?: string; + + /** An optional location related to the message. */ + location?: Location; +} + +interface TestEnqueuedStartedSkipped { + /** The state change that has occurred to a specific test or test step. + * + * - `"enqueued"` - the test is now enqueued to be tested + * - `"started"` - the test has started + * - `"skipped"` - the test was skipped + */ + type: "enqueued" | "started" | "skipped"; + + /** The test or test step relating to the state change. */ + test: TestIdentifier; +} + +interface TestFailedErrored { + /** The state change that has occurred to a specific test or test step. + * + * - `"failed"` - The test failed to run properly, versus the test erroring. + * currently the Deno language server does not support this. + * - `"errored"` - The test errored. + */ + type: "failed" | "errored"; + + /** The test or test step relating to the state change. */ + test: TestIdentifier; + + /** Messages related to the state change. */ + messages: TestMessage[]; + + /** An optional duration, in milliseconds from the start to the current + * state. */ + duration?: number; +} + +interface TestPassed { + /** The state change that has occurred to a specific test or test step. */ + type: "passed"; + + /** The test or test step relating to the state change. */ + test: TestIdentifier; + + /** An optional duration, in milliseconds from the start to the current + * state. */ + duration?: number; +} + +interface TestOutput { + /** The test or test step has output information / logged information. */ + type: "output"; + + /** The value of the output. */ + value: string; + + /** The associated test or test step if there was one. */ + test?: TestIdentifier; + + /** An optional location associated with the output. */ + location?: Location; +} + +interface TestEnd { + /** The test run has ended. */ + type: "end"; +} + +type TestRunProgressMessage = + | TestEnqueuedStartedSkipped + | TestFailedErrored + | TestPassed + | TestOutput + | TestEnd; + +export interface TestRunProgressParams { + /** The test run ID that the progress message applies to. */ + id: number; + + /** The message*/ + message: TestRunProgressMessage; +} + +export const testRunProgress = new NotificationType( + "deno/testRunProgress", +); + +export interface TestRunCancelParams { + /** The test id to be cancelled. */ + id: number; +} + +export const testRunCancel = new RequestType< + TestRunCancelParams, + boolean, + void +>("deno/testRunCancel"); + export interface VirtualTextDocumentParams { textDocument: TextDocumentIdentifier; } diff --git a/client/src/notification_handlers.ts b/client/src/notification_handlers.ts index c8db0a2a..48cba98f 100644 --- a/client/src/notification_handlers.ts +++ b/client/src/notification_handlers.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import { RegistryStateParams } from "./lsp_extensions"; import { NotificationHandler } from "vscode-languageclient"; diff --git a/client/src/server_info.ts b/client/src/server_info.ts index 85f7a148..d7cf4f07 100644 --- a/client/src/server_info.ts +++ b/client/src/server_info.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import { InitializeResult } from "vscode-languageclient"; diff --git a/client/src/shared_types.d.ts b/client/src/shared_types.d.ts index f8b79bd1..1327316a 100644 --- a/client/src/shared_types.d.ts +++ b/client/src/shared_types.d.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import type { ConfigurationScope } from "vscode"; @@ -51,6 +51,10 @@ export interface Settings { hosts: Record; } | null; } | null; + testing: { + args: string[]; + enable: boolean; + } | null; tlsCertificate: string | null; unsafelyIgnoreCertificateErrors: string[] | null; /** Determine if the extension should be type checking against the unstable diff --git a/client/src/status_bar.ts b/client/src/status_bar.ts index bbe37bb5..6ecab2c4 100644 --- a/client/src/status_bar.ts +++ b/client/src/status_bar.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import { DenoExtensionContext } from "./types"; diff --git a/client/src/tasks.ts b/client/src/tasks.ts index eb51d9db..e040715d 100644 --- a/client/src/tasks.ts +++ b/client/src/tasks.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import { task as taskReq } from "./lsp_extensions"; import type { DenoExtensionContext } from "./types"; diff --git a/client/src/testing.ts b/client/src/testing.ts new file mode 100644 index 00000000..6097b399 --- /dev/null +++ b/client/src/testing.ts @@ -0,0 +1,341 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. + +import { + type TestData, + type TestIdentifier, + type TestMessage, + testModule, + testModuleDelete, + testRun, + testRunCancel, + testRunProgress, +} from "./lsp_extensions"; +import type { DenoExtensionContext } from "./types"; +import { assert } from "./util"; + +import * as vscode from "vscode"; +import { MarkupKind } from "vscode-languageclient/node"; +import type { + ClientCapabilities, + DocumentSelector, + MarkupContent, + ServerCapabilities, + StaticFeature, +} from "vscode-languageclient/node"; + +/** Indicate to the language server that the client supports the Testing API */ +export class TestingFeature implements StaticFeature { + #enabled = false; + + get enabled() { + return this.#enabled; + } + + fillClientCapabilities(capabilities: ClientCapabilities): void { + const experimental: { testingApi?: boolean } = capabilities.experimental ?? + {}; + experimental.testingApi = true; + capabilities.experimental = experimental; + } + + initialize( + capabilities: ServerCapabilities<{ testingApi?: boolean }>, + _documentSelector: DocumentSelector | undefined, + ): void { + this.#enabled = capabilities.experimental?.testingApi ?? false; + } + + dispose(): void {} +} + +function asStringOrMarkdown( + content: MarkupContent, +): string | vscode.MarkdownString { + switch (content.kind) { + case MarkupKind.Markdown: + return new vscode.MarkdownString(content.value); + case MarkupKind.PlainText: + return content.value; + } +} + +/** Resolve the test that a test item belongs to. If the test item is a test, + * the result will be itself, but if the test item is a step, the result will + * be the owning test. */ +function getTest(testItem: vscode.TestItem): vscode.TestItem { + let item = testItem; + while (item.parent && item.parent.parent) { + item = item.parent; + } + return item; +} + +/** Return the test identifier for a given test item. */ +function asTestIdentifier(testItem: vscode.TestItem): TestIdentifier { + if (testItem.parent) { + const test = getTest(testItem); + if (test.id === testItem.id) { + return { textDocument: { uri: testItem.parent.id }, id: testItem.id }; + } else { + return { + textDocument: { uri: test.parent!.id }, + id: test.id, + stepId: testItem.id, + }; + } + } else { + return { textDocument: { uri: testItem.id } }; + } +} + +/** Recursively search a test item for a test step, returning it if found, + * otherwise returning undefined. */ +function getTestStep( + test: vscode.TestItem, + id: string, +): vscode.TestItem | undefined { + let step: vscode.TestItem | undefined; + test.children.forEach((child) => { + if (!step) { + if (child.id === id) { + step = child; + } else if (child.children.size) { + step = getTestStep(child, id); + } + } + }); + return step; +} + +function getTestItem( + testController: vscode.TestController, + { textDocument: { uri }, id, stepId }: TestIdentifier, +): vscode.TestItem | undefined { + const testModule = testController.items.get(uri); + if (!testModule) { + return undefined; + } + if (id) { + const test = testModule.children.get(id); + if (test && stepId) { + return getTestStep(test, stepId); + } else { + return test; + } + } else { + return testModule; + } +} + +export class DenoTestController implements vscode.Disposable { + #runCount = 0; + #runs = new Map(); + #subscriptions: vscode.Disposable[] = []; + #testController: vscode.TestController; + + constructor(extensionContext: DenoExtensionContext) { + const testController = extensionContext.testController = this + .#testController = vscode.tests + .createTestController("denoTestController", "Deno"); + this.#subscriptions.push(testController); + + const { client } = extensionContext; + assert(client); + + const runHandler = async ( + request: vscode.TestRunRequest, + cancellation: vscode.CancellationToken, + ) => { + const run = testController.createTestRun(request); + const id = ++this.#runCount; + this.#runs.set(id, run); + // currently on "run" is implemented and exposed + let kind: "run" | "coverage" | "debug" = "run"; + switch (request.profile?.kind) { + case vscode.TestRunProfileKind.Coverage: + kind = "coverage"; + break; + case vscode.TestRunProfileKind.Debug: + kind = "debug"; + break; + } + const include = request.include + ? request.include.map(asTestIdentifier) + : undefined; + const exclude = request.exclude + ? request.exclude.map(asTestIdentifier) + : undefined; + const { enqueued } = await client.sendRequest(testRun, { + id, + kind, + include, + exclude, + }); + + cancellation.onCancellationRequested(async () => { + await client.sendRequest(testRunCancel, { id }); + run.end(); + this.#runs.delete(id); + }); + + for (const { textDocument, ids } of enqueued) { + for (const id of ids) { + const item = getTestItem(testController, { textDocument, id }); + if (!item) { + continue; + } + run.enqueued(item); + } + } + }; + + testController.createRunProfile( + "Run Tests", + vscode.TestRunProfileKind.Run, + runHandler, + true, + ); + // TODO(@kitsonk) add debug run profile + // TODO(@kitsonk) add coverage run profile + + const p2c = client.protocol2CodeConverter; + + function asTestMessage({ + message, + expectedOutput, + actualOutput, + location, + }: TestMessage) { + const msg = asStringOrMarkdown(message); + const testMessage = expectedOutput && actualOutput + ? vscode.TestMessage.diff( + msg, + expectedOutput, + actualOutput, + ) + : new vscode.TestMessage(msg); + + if (location) { + testMessage.location = p2c.asLocation(location); + } + return testMessage; + } + + function mergeSteps( + parentSteps: TestData[], + uri: vscode.Uri, + parent: vscode.TestItem, + ): vscode.TestItem[] { + const items: vscode.TestItem[] = []; + parent.children.forEach((item) => items.push(item)); + for (const { id, label, range, steps } of parentSteps) { + let testItem = parent.children.get(id); + if (!testItem) { + testItem = testController.createTestItem(id, label, uri); + items.push(testItem); + } else { + testItem.label = label; + } + testItem.range = p2c.asRange(range); + const children = steps ? mergeSteps(steps, uri, testItem) : undefined; + if (children) { + testItem.children.replace(children); + } + } + return items; + } + + client.onNotification( + testModule, + ({ textDocument: { uri: uriStr }, kind, label, tests }) => { + const uri = p2c.asUri(uriStr); + let testModule = testController.items.get(uriStr); + if (!testModule) { + testModule = testController.createTestItem(uriStr, label, uri); + testController.items.add(testModule); + } + const testItems = tests.map(({ id, label, steps, range }) => { + let test = testModule!.children.get(id); + if (!test) { + test = testController.createTestItem(id, label, uri); + } else { + test.label = label; + } + test.range = p2c.asRange(range); + const items = steps ? mergeSteps(steps, uri, test) : undefined; + if (items) { + test.children.replace(items); + } + return test; + }); + if (kind === "replace") { + testModule.children.replace(testItems); + } else { + for (const testItem of testItems) { + testModule.children.add(testItem); + } + } + }, + ); + + client.onNotification( + testModuleDelete, + ({ textDocument: { uri } }) => testController.items.delete(uri), + ); + + client.onNotification(testRunProgress, ({ id, message }) => { + const run = this.#runs.get(id); + if (!run) { + return; + } + switch (message.type) { + case "enqueued": + case "started": + case "skipped": { + const { test } = message; + const item = getTestItem(testController, test); + if (item) { + run[message.type](item); + } + break; + } + case "passed": { + const { test, duration } = message; + const item = getTestItem(testController, test); + if (item) { + run.passed(item, duration); + } + break; + } + case "errored": + case "failed": { + const { test, messages, duration } = message; + const item = getTestItem(testController, test); + if (item) { + const errorMessages = messages.map(asTestMessage); + run[message.type](item, errorMessages, duration); + } + break; + } + case "output": { + const { test, location, value } = message; + const item = test ? getTestItem(testController, test) : undefined; + const loc = location ? p2c.asLocation(location) : undefined; + run.appendOutput(value, loc, item); + break; + } + case "end": { + run.end(); + this.#runs.delete(id); + break; + } + } + }); + } + + dispose() { + for (const disposable of this.#subscriptions) { + disposable.dispose(); + } + } +} diff --git a/client/src/ts_api.ts b/client/src/ts_api.ts index bea50e52..a1d3f9aa 100644 --- a/client/src/ts_api.ts +++ b/client/src/ts_api.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import { EXTENSION_TS_PLUGIN, diff --git a/client/src/types.d.ts b/client/src/types.d.ts index 7eb90aef..12d49b05 100644 --- a/client/src/types.d.ts +++ b/client/src/types.d.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import type { LanguageClient, @@ -7,6 +7,7 @@ import type { import type { DenoServerInfo } from "./server_info"; import type { DocumentSettings, EnabledPaths, Settings } from "./shared_types"; import type { DenoStatusBar } from "./status_bar"; +import type * as vscode from "vscode"; import type { ServerCapabilities } from "vscode-languageclient"; @@ -35,6 +36,7 @@ export interface DenoExtensionContext { | ServerCapabilities | undefined; statusBar: DenoStatusBar; + testController: vscode.TestController | undefined; tsApi: TsApi; /** The current workspace settings. */ workspaceSettings: Settings; diff --git a/client/src/util.ts b/client/src/util.ts index 26ba6e5a..db487838 100644 --- a/client/src/util.ts +++ b/client/src/util.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import { EXTENSION_NS } from "./constants"; diff --git a/client/src/welcome.ts b/client/src/welcome.ts index 629b926b..f22988cb 100644 --- a/client/src/welcome.ts +++ b/client/src/welcome.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import { EXTENSION_ID } from "./constants"; diff --git a/media/welcome.css b/media/welcome.css index 61dd51dc..c5d1579f 100644 --- a/media/welcome.css +++ b/media/welcome.css @@ -1,4 +1,4 @@ -/* Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. */ +/* Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. */ .Content { font-size: 1rem; diff --git a/media/welcome.js b/media/welcome.js index 620f5308..e616f9fc 100644 --- a/media/welcome.js +++ b/media/welcome.js @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. (function () { const vscode = acquireVsCodeApi(); diff --git a/package-lock.json b/package-lock.json index eb1086c1..509d813d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,8 +14,8 @@ }, "devDependencies": { "@types/node": "^14.14.25", - "esbuild": "^0.12.24", - "typescript": "^4.4.2" + "esbuild": "^0.14.23", + "typescript": "^4.5.5" }, "engines": { "vscode": "^1.60.0" @@ -23,25 +23,368 @@ }, "node_modules/@types/node": { "version": "14.17.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.16.tgz", - "integrity": "sha512-WiFf2izl01P1CpeY8WqFAeKWwByMueBEkND38EcN8N68qb0aDG3oIS1P5MhAX5kUdr469qRyqsY/MjanLjsFbQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/esbuild": { - "version": "0.12.28", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.28.tgz", - "integrity": "sha512-pZ0FrWZXlvQOATlp14lRSk1N9GkeJ3vLIwOcUoo3ICQn9WNR4rWoNi81pbn6sC1iYUy7QPqNzI3+AEzokwyVcA==", + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.27.tgz", + "integrity": "sha512-MZQt5SywZS3hA9fXnMhR22dv0oPGh6QtjJRIYbgL1AeqAoQZE+Qn5ppGYQAoHv/vq827flj4tIJ79Mrdiwk46Q==", "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "esbuild-android-64": "0.14.27", + "esbuild-android-arm64": "0.14.27", + "esbuild-darwin-64": "0.14.27", + "esbuild-darwin-arm64": "0.14.27", + "esbuild-freebsd-64": "0.14.27", + "esbuild-freebsd-arm64": "0.14.27", + "esbuild-linux-32": "0.14.27", + "esbuild-linux-64": "0.14.27", + "esbuild-linux-arm": "0.14.27", + "esbuild-linux-arm64": "0.14.27", + "esbuild-linux-mips64le": "0.14.27", + "esbuild-linux-ppc64le": "0.14.27", + "esbuild-linux-riscv64": "0.14.27", + "esbuild-linux-s390x": "0.14.27", + "esbuild-netbsd-64": "0.14.27", + "esbuild-openbsd-64": "0.14.27", + "esbuild-sunos-64": "0.14.27", + "esbuild-windows-32": "0.14.27", + "esbuild-windows-64": "0.14.27", + "esbuild-windows-arm64": "0.14.27" + } + }, + "node_modules/esbuild-android-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.27.tgz", + "integrity": "sha512-LuEd4uPuj/16Y8j6kqy3Z2E9vNY9logfq8Tq+oTE2PZVuNs3M1kj5Qd4O95ee66yDGb3isaOCV7sOLDwtMfGaQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-android-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.27.tgz", + "integrity": "sha512-E8Ktwwa6vX8q7QeJmg8yepBYXaee50OdQS3BFtEHKrzbV45H4foMOeEE7uqdjGQZFBap5VAqo7pvjlyA92wznQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.27.tgz", + "integrity": "sha512-czw/kXl/1ZdenPWfw9jDc5iuIYxqUxgQ/Q+hRd4/3udyGGVI31r29LCViN2bAJgGvQkqyLGVcG03PJPEXQ5i2g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.27.tgz", + "integrity": "sha512-BEsv2U2U4o672oV8+xpXNxN9bgqRCtddQC6WBh4YhXKDcSZcdNh7+6nS+DM2vu7qWIWNA4JbRG24LUUYXysimQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.27.tgz", + "integrity": "sha512-7FeiFPGBo+ga+kOkDxtPmdPZdayrSzsV9pmfHxcyLKxu+3oTcajeZlOO1y9HW+t5aFZPiv7czOHM4KNd0tNwCA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.27.tgz", + "integrity": "sha512-8CK3++foRZJluOWXpllG5zwAVlxtv36NpHfsbWS7TYlD8S+QruXltKlXToc/5ZNzBK++l6rvRKELu/puCLc7jA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-32": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.27.tgz", + "integrity": "sha512-qhNYIcT+EsYSBClZ5QhLzFzV5iVsP1YsITqblSaztr3+ZJUI+GoK8aXHyzKd7/CKKuK93cxEMJPpfi1dfsOfdw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.27.tgz", + "integrity": "sha512-ESjck9+EsHoTaKWlFKJpPZRN26uiav5gkI16RuI8WBxUdLrrAlYuYSndxxKgEn1csd968BX/8yQZATYf/9+/qg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.27.tgz", + "integrity": "sha512-JnnmgUBdqLQO9hoNZQqNHFWlNpSX82vzB3rYuCJMhtkuaWQEmQz6Lec1UIxJdC38ifEghNTBsF9bbe8dFilnCw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.27.tgz", + "integrity": "sha512-no6Mi17eV2tHlJnqBHRLekpZ2/VYx+NfGxKcBE/2xOMYwctsanCaXxw4zapvNrGE9X38vefVXLz6YCF8b1EHiQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-mips64le": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.27.tgz", + "integrity": "sha512-NolWP2uOvIJpbwpsDbwfeExZOY1bZNlWE/kVfkzLMsSgqeVcl5YMen/cedRe9mKnpfLli+i0uSp7N+fkKNU27A==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-ppc64le": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.27.tgz", + "integrity": "sha512-/7dTjDvXMdRKmsSxKXeWyonuGgblnYDn0MI1xDC7J1VQXny8k1qgNp6VmrlsawwnsymSUUiThhkJsI+rx0taNA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-riscv64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.27.tgz", + "integrity": "sha512-D+aFiUzOJG13RhrSmZgrcFaF4UUHpqj7XSKrIiCXIj1dkIkFqdrmqMSOtSs78dOtObWiOrFCDDzB24UyeEiNGg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-s390x": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.27.tgz", + "integrity": "sha512-CD/D4tj0U4UQjELkdNlZhQ8nDHU5rBn6NGp47Hiz0Y7/akAY5i0oGadhEIg0WCY/HYVXFb3CsSPPwaKcTOW3bg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-netbsd-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.27.tgz", + "integrity": "sha512-h3mAld69SrO1VoaMpYl3a5FNdGRE/Nqc+E8VtHOag4tyBwhCQXxtvDDOAKOUQexBGca0IuR6UayQ4ntSX5ij1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-openbsd-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.27.tgz", + "integrity": "sha512-xwSje6qIZaDHXWoPpIgvL+7fC6WeubHHv18tusLYMwL+Z6bEa4Pbfs5IWDtQdHkArtfxEkIZz77944z8MgDxGw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-sunos-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.27.tgz", + "integrity": "sha512-/nBVpWIDjYiyMhuqIqbXXsxBc58cBVH9uztAOIfWShStxq9BNBik92oPQPJ57nzWXRNKQUEFWr4Q98utDWz7jg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-32": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.27.tgz", + "integrity": "sha512-Q9/zEjhZJ4trtWhFWIZvS/7RUzzi8rvkoaS9oiizkHTTKd8UxFwn/Mm2OywsAfYymgUYm8+y2b+BKTNEFxUekw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.27.tgz", + "integrity": "sha512-b3y3vTSl5aEhWHK66ngtiS/c6byLf6y/ZBvODH1YkBM+MGtVL6jN38FdHUsZasCz9gFwYs/lJMVY9u7GL6wfYg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.27.tgz", + "integrity": "sha512-I/reTxr6TFMcR5qbIkwRGvldMIaiBu2+MP0LlD7sOlNXrfqIl9uNjsuxFPGEG4IRomjfQ5q8WT+xlF/ySVkqKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" } }, "node_modules/typescript": { "version": "4.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz", - "integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -63,31 +406,207 @@ "engines": { "vscode": "^1.53.0" } + }, + "typescript-deno-plugin/node_modules/typescript": { + "version": "4.6.2", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } } }, "dependencies": { "@types/node": { "version": "14.17.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.16.tgz", - "integrity": "sha512-WiFf2izl01P1CpeY8WqFAeKWwByMueBEkND38EcN8N68qb0aDG3oIS1P5MhAX5kUdr469qRyqsY/MjanLjsFbQ==", "dev": true }, "esbuild": { - "version": "0.12.28", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.28.tgz", - "integrity": "sha512-pZ0FrWZXlvQOATlp14lRSk1N9GkeJ3vLIwOcUoo3ICQn9WNR4rWoNi81pbn6sC1iYUy7QPqNzI3+AEzokwyVcA==", - "dev": true + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.27.tgz", + "integrity": "sha512-MZQt5SywZS3hA9fXnMhR22dv0oPGh6QtjJRIYbgL1AeqAoQZE+Qn5ppGYQAoHv/vq827flj4tIJ79Mrdiwk46Q==", + "dev": true, + "requires": { + "esbuild-android-64": "0.14.27", + "esbuild-android-arm64": "0.14.27", + "esbuild-darwin-64": "0.14.27", + "esbuild-darwin-arm64": "0.14.27", + "esbuild-freebsd-64": "0.14.27", + "esbuild-freebsd-arm64": "0.14.27", + "esbuild-linux-32": "0.14.27", + "esbuild-linux-64": "0.14.27", + "esbuild-linux-arm": "0.14.27", + "esbuild-linux-arm64": "0.14.27", + "esbuild-linux-mips64le": "0.14.27", + "esbuild-linux-ppc64le": "0.14.27", + "esbuild-linux-riscv64": "0.14.27", + "esbuild-linux-s390x": "0.14.27", + "esbuild-netbsd-64": "0.14.27", + "esbuild-openbsd-64": "0.14.27", + "esbuild-sunos-64": "0.14.27", + "esbuild-windows-32": "0.14.27", + "esbuild-windows-64": "0.14.27", + "esbuild-windows-arm64": "0.14.27" + } + }, + "esbuild-android-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.27.tgz", + "integrity": "sha512-LuEd4uPuj/16Y8j6kqy3Z2E9vNY9logfq8Tq+oTE2PZVuNs3M1kj5Qd4O95ee66yDGb3isaOCV7sOLDwtMfGaQ==", + "dev": true, + "optional": true + }, + "esbuild-android-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.27.tgz", + "integrity": "sha512-E8Ktwwa6vX8q7QeJmg8yepBYXaee50OdQS3BFtEHKrzbV45H4foMOeEE7uqdjGQZFBap5VAqo7pvjlyA92wznQ==", + "dev": true, + "optional": true + }, + "esbuild-darwin-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.27.tgz", + "integrity": "sha512-czw/kXl/1ZdenPWfw9jDc5iuIYxqUxgQ/Q+hRd4/3udyGGVI31r29LCViN2bAJgGvQkqyLGVcG03PJPEXQ5i2g==", + "dev": true, + "optional": true + }, + "esbuild-darwin-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.27.tgz", + "integrity": "sha512-BEsv2U2U4o672oV8+xpXNxN9bgqRCtddQC6WBh4YhXKDcSZcdNh7+6nS+DM2vu7qWIWNA4JbRG24LUUYXysimQ==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.27.tgz", + "integrity": "sha512-7FeiFPGBo+ga+kOkDxtPmdPZdayrSzsV9pmfHxcyLKxu+3oTcajeZlOO1y9HW+t5aFZPiv7czOHM4KNd0tNwCA==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.27.tgz", + "integrity": "sha512-8CK3++foRZJluOWXpllG5zwAVlxtv36NpHfsbWS7TYlD8S+QruXltKlXToc/5ZNzBK++l6rvRKELu/puCLc7jA==", + "dev": true, + "optional": true + }, + "esbuild-linux-32": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.27.tgz", + "integrity": "sha512-qhNYIcT+EsYSBClZ5QhLzFzV5iVsP1YsITqblSaztr3+ZJUI+GoK8aXHyzKd7/CKKuK93cxEMJPpfi1dfsOfdw==", + "dev": true, + "optional": true + }, + "esbuild-linux-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.27.tgz", + "integrity": "sha512-ESjck9+EsHoTaKWlFKJpPZRN26uiav5gkI16RuI8WBxUdLrrAlYuYSndxxKgEn1csd968BX/8yQZATYf/9+/qg==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.27.tgz", + "integrity": "sha512-JnnmgUBdqLQO9hoNZQqNHFWlNpSX82vzB3rYuCJMhtkuaWQEmQz6Lec1UIxJdC38ifEghNTBsF9bbe8dFilnCw==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.27.tgz", + "integrity": "sha512-no6Mi17eV2tHlJnqBHRLekpZ2/VYx+NfGxKcBE/2xOMYwctsanCaXxw4zapvNrGE9X38vefVXLz6YCF8b1EHiQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-mips64le": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.27.tgz", + "integrity": "sha512-NolWP2uOvIJpbwpsDbwfeExZOY1bZNlWE/kVfkzLMsSgqeVcl5YMen/cedRe9mKnpfLli+i0uSp7N+fkKNU27A==", + "dev": true, + "optional": true + }, + "esbuild-linux-ppc64le": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.27.tgz", + "integrity": "sha512-/7dTjDvXMdRKmsSxKXeWyonuGgblnYDn0MI1xDC7J1VQXny8k1qgNp6VmrlsawwnsymSUUiThhkJsI+rx0taNA==", + "dev": true, + "optional": true + }, + "esbuild-linux-riscv64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.27.tgz", + "integrity": "sha512-D+aFiUzOJG13RhrSmZgrcFaF4UUHpqj7XSKrIiCXIj1dkIkFqdrmqMSOtSs78dOtObWiOrFCDDzB24UyeEiNGg==", + "dev": true, + "optional": true + }, + "esbuild-linux-s390x": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.27.tgz", + "integrity": "sha512-CD/D4tj0U4UQjELkdNlZhQ8nDHU5rBn6NGp47Hiz0Y7/akAY5i0oGadhEIg0WCY/HYVXFb3CsSPPwaKcTOW3bg==", + "dev": true, + "optional": true + }, + "esbuild-netbsd-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.27.tgz", + "integrity": "sha512-h3mAld69SrO1VoaMpYl3a5FNdGRE/Nqc+E8VtHOag4tyBwhCQXxtvDDOAKOUQexBGca0IuR6UayQ4ntSX5ij1Q==", + "dev": true, + "optional": true + }, + "esbuild-openbsd-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.27.tgz", + "integrity": "sha512-xwSje6qIZaDHXWoPpIgvL+7fC6WeubHHv18tusLYMwL+Z6bEa4Pbfs5IWDtQdHkArtfxEkIZz77944z8MgDxGw==", + "dev": true, + "optional": true + }, + "esbuild-sunos-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.27.tgz", + "integrity": "sha512-/nBVpWIDjYiyMhuqIqbXXsxBc58cBVH9uztAOIfWShStxq9BNBik92oPQPJ57nzWXRNKQUEFWr4Q98utDWz7jg==", + "dev": true, + "optional": true + }, + "esbuild-windows-32": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.27.tgz", + "integrity": "sha512-Q9/zEjhZJ4trtWhFWIZvS/7RUzzi8rvkoaS9oiizkHTTKd8UxFwn/Mm2OywsAfYymgUYm8+y2b+BKTNEFxUekw==", + "dev": true, + "optional": true + }, + "esbuild-windows-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.27.tgz", + "integrity": "sha512-b3y3vTSl5aEhWHK66ngtiS/c6byLf6y/ZBvODH1YkBM+MGtVL6jN38FdHUsZasCz9gFwYs/lJMVY9u7GL6wfYg==", + "dev": true, + "optional": true + }, + "esbuild-windows-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.27.tgz", + "integrity": "sha512-I/reTxr6TFMcR5qbIkwRGvldMIaiBu2+MP0LlD7sOlNXrfqIl9uNjsuxFPGEG4IRomjfQ5q8WT+xlF/ySVkqKg==", + "dev": true, + "optional": true }, "typescript": { "version": "4.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz", - "integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==", "dev": true }, "typescript-deno-plugin": { "version": "file:typescript-deno-plugin", "requires": { "typescript": "^4.6.2" + }, + "dependencies": { + "typescript": { + "version": "4.6.2", + "dev": true + } } } } diff --git a/package.json b/package.json index f7e4bb14..5be20595 100644 --- a/package.json +++ b/package.json @@ -204,7 +204,7 @@ }, "deno.codeLens.test": { "type": "boolean", - "default": true, + "default": false, "markdownDescription": "Enables or disables the display of code lenses that allow running of individual tests in the code.", "scope": "resource" }, @@ -214,9 +214,10 @@ "type": "string" }, "default": [ - "--allow-all" + "--allow-all", + "--no-check" ], - "markdownDescription": "Additional arguments to use with the run test code lens. Defaults to `[ \"--allow-all\" ]`.", + "markdownDescription": "Additional arguments to use with the run test code lens. Defaults to `[ \"--allow-all\", \"--no-check\" ]`.", "scope": "resource" }, "deno.config": { @@ -280,6 +281,24 @@ "https://deno.land": true } }, + "deno.testing.args": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "--allow-all", + "--no-check" + ], + "markdownDescription": "Arguments to use when running tests via the Test Explorer. Defaults to `[ \"--allow-all\" ]`.", + "scope": "window" + }, + "deno.testing.enable": { + "type": "boolean", + "default": true, + "markdownDescription": "Enable the testing API for the language server. When folder is Deno enabled, tests will be available in the Test Explorer view.", + "scope": "window" + }, "deno.tlsCertificate": { "type": "string", "default": null, @@ -491,7 +510,7 @@ }, "devDependencies": { "@types/node": "^14.14.25", - "esbuild": "^0.12.24", - "typescript": "^4.4.2" + "esbuild": "^0.14.23", + "typescript": "^4.5.5" } } diff --git a/typescript-deno-plugin/src/index.ts b/typescript-deno-plugin/src/index.ts index 415f92b0..679a1e6e 100644 --- a/typescript-deno-plugin/src/index.ts +++ b/typescript-deno-plugin/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. import type { PluginSettings, Settings } from "../../client/src/shared_types"; import type * as ts from "../node_modules/typescript/lib/tsserverlibrary"; @@ -48,6 +48,7 @@ const defaultSettings: Settings = { hosts: {}, }, }, + testing: null, tlsCertificate: null, unsafelyIgnoreCertificateErrors: null, unstable: false,