Commit Graph

586 Commits

Author SHA1 Message Date
Connor Peet
45eea1f87b testing: initial api side of test coverage
For https://github.com/microsoft/vscode/issues/123713
2021-06-25 12:58:04 -07:00
João Moreno
8d7db6955d remove proposal check
closes #124263
2021-06-25 11:49:37 +02:00
Connor Peet
df5cd47784 testing: update test item async resolving
See https://github.com/microsoft/vscode/issues/126987#issuecomment-867031454
This commit makes the following changes:

- Keep the `resolveChildrenHandler`, and remove the CancellationToken parameter
- Remove `TestITem.status` and instead have `TestItem.canResolveChildren?: boolean`
- Add `TestItem.busy?: boolean`. Note that the UI would implicitly show
  the item as busy while `resolve` is being called. (This is a new feature)

Upgrading to account for these changes should take around 10 to 20 minutes:

1. Where you previously set `item.status = vscode.TestItemStatus.Pending`,
   instead set `item.canResolveChildren = true`.
2. If you used the cancellation token in resolveChildrenHandler, you no
   longer need to do so. What you do here instead is up to you:

	 - If you set up global workspace watchers, add those to `context.subscriptions`
	 - You _probably_ don't need to set up watchers for "file" test items,
	   since you will receive updates via `vscode.workspace.onDidChangeTextDocument`
		 and/or any FileWatcher you have set up.

Example of an update: 7287c64bf7
2021-06-23 12:50:06 -07:00
Connor Peet
fc0ee4e4bc testing: pass test item in context menu actions
Fixes #126646
2021-06-22 18:47:25 -07:00
Connor Peet
186e565ec0 refactor: update to new testing API
Previously in the testing API, you called `registerTestProvider` with
your own instance of a TestController, and VS Code would request
workspace or document tests. This has been changed: now, you call
`createTestController`, which returns an object, and call
`createTestItem` to insert test nodes under the `controller.root`.

Extensions should generally decide themselves when to publish tests. For
example, when a file is opened in an editor, test extensions will want
to make sure tests for that file are available so that inline
decorations can be shown. This is pretty similar to what the editor
API does in diagnostics.

There is still a `resolveChildrenHandler` on the controller (rather than
the TestItem directly), which you should _set_ if the test extension
supports lazy discovery. Additionally, if you support running tests,
you'll also want a `runHandler` (migrating from the old `runTests` method).

Some of the existing test providers have been updated, you can check
them out here:

- https://github.com/microsoft/vscode-extension-samples/tree/main/test-provider-sample
- https://github.com/microsoft/vscode-selfhost-test-provider

In summary, to update to the new API:

- Call `vscode.test.createTestController` instead of `registerTestController`
- Move the contents of your `runTests` method to `controller.runHandler`
- Move your `TestItem.resolveHandler` to `controller.resolveChildrenHandler`,
  which may involve adding some `instanceof` checks.
- If you lazily discovered tests in `createDocumentTestRoot`, you'll want
  to trigger that logic based on `vscode.workspace.onDidOpenTextDocument`.
- If your test runner can deal with showing locations of unsaved changes,
  listen for `vscode.workspace.onDidChangeTextDocument` to trigger those
  changes in the tree.
2021-06-21 12:14:24 -07:00
Connor Peet
3e0c442a8e testing: avoid duplicated calls to workspace root if document tests are not provided
Fixes #126290
2021-06-15 18:29:02 -07:00
Megan Rogge
0c7223c475 finalize terminal iconPath (#125783) 2021-06-15 05:31:23 -07:00
Daniel Imms
50652b93db Merge pull request #126053 from microsoft/tyriar/126040
Convert TerminalLink to class, add TerminalProfile validation
2021-06-15 03:50:23 -07:00
Connor Peet
ec65867a75 testing: improve cancellation, and allow test runs to be individually cancelled
Fixes #125712
2021-06-14 16:46:03 -07:00
Daniel Imms
eb6825e071 Convert TerminalLink to class, add TerminalProfile validation
Fixes #126040
2021-06-11 07:28:24 -07:00
Daniel Imms
465759bc58 Prevent other extensions registering terminal profiles 2021-06-11 06:45:36 -07:00
Daniel Imms
0a9a394a63 Use a class for TerminalProfile 2021-06-11 05:01:40 -07:00
Johannes Rieken
a31c6c3550 extract ExtHostNotebookDocumentsShape into its own thing 2021-06-07 17:41:12 +02:00
Johannes Rieken
10442e00b4 extract ExtHostNotebookEditorShape into its own thing 2021-06-07 16:25:03 +02:00
rebornix
b098b10a77 Merge branch 'notebook/dev' into main 2021-06-04 10:32:13 -07:00
Johannes Rieken
f207b38307 inline NotebookExecuteHandler type 2021-06-04 11:32:25 +02:00
João Moreno
f99e1c358f fixes issue with asExternalUri API 2021-06-04 10:38:59 +02:00
Johannes Rieken
073c4ffd7d remove deprecated notebook-namespace, notebooks is the future 2021-06-02 15:54:31 +02:00
Johannes Rieken
ac05ae7b6f move file'ish things into workspace namespace 2021-06-02 09:43:07 +02:00
Henning Dieterichs
b81aebe5d7 Forwards the isUndoing/isRedoing flags to the extension host and introduces TextDocumentChangeReason. 2021-06-01 17:45:58 +02:00
Johannes Rieken
545b931b96 remove dedicated types for notebook and cell metadata 2021-06-01 14:50:53 +02:00
Johannes Rieken
f2fb2b8cbe rename viewType to notebookType, https://github.com/microsoft/vscode/issues/122922 2021-05-31 15:55:15 +02:00
Johannes Rieken
e1928efbb6 notebook API finalization part1
there is still a bunch of todos which are required because extensions get a tiny bit to adopt, https://github.com/microsoft/vscode/issues/122922
2021-05-31 15:06:05 +02:00
Johannes Rieken
355df0eccb move renderer script and IPC into proposed and merge with general renderer IPC, https://github.com/microsoft/vscode/issues/123601 2021-05-31 13:38:17 +02:00
Johannes Rieken
83d5e2bda0 rename namespace to notebooks, https://github.com/microsoft/vscode/issues/122922 2021-05-31 13:06:14 +02:00
Megan Rogge
29cad8fb5e Merge pull request #124754 from microsoft/tyriar/profile_api
Terminal profile contributions
2021-05-27 19:01:23 -05:00
rebornix
866ecdd45a Merge branch 'notebook/dev' into main 2021-05-27 14:04:55 -07:00
Connor Peet
902bb43b3b testing: move back to proposed
Deferring finalization for an iteration.

This reverts commit df3c2c4875.
2021-05-27 12:52:29 -07:00
Alex Dima
f523f65f39 Add a description field to decorations to be able to find leaks 2021-05-27 15:50:04 +02:00
Johannes Rieken
4c5a061df6 rename NotebookKernelPreload to NotebookRendererScript 2021-05-27 15:21:48 +02:00
Alexandru Dima
641c2b175c Merge pull request #124707 from microsoft/alex/ghost-text
ghost text updates
2021-05-26 23:14:24 +02:00
Henning Dieterichs
d1ed9c8bf3 Adds proposed API for window.getInlineCompletionItemController(...).onDidShowCompletionItem. 2021-05-26 20:34:04 +02:00
Daniel Imms
3ff91e7621 Merge remote-tracking branch 'origin/main' into tyriar/profile_api 2021-05-26 11:09:35 -07:00
Daniel Imms
e29194ad0d Activation event, register api 2021-05-26 07:41:16 -07:00
João Moreno
14f61093f4 fixes #124507 2021-05-26 10:03:25 +02:00
João Moreno
44b470c99f fixes #124576 2021-05-26 09:41:59 +02:00
Matt Bierner
24a23a8ea0 Mark array params in vscode.d.ts readonly (#124599)
I recently ran into an issue where I was trying to call showQuickPick with a readonly array. This is currently not allowed, even though `showQuickPick` never mutates the input

This change marks a few places in `vscode.d.ts` where we take arrays as parameters as `readonly []`. It also caught a potential bug with`getSession` modifying the input array
2021-05-25 18:18:47 -07:00
Connor Peet
df3c2c4875 testing: move apis to stable
Closes #122208 🎉
2021-05-24 10:22:53 -07:00
Alex Dima
91fdd52d17 Merge remote-tracking branch 'origin/main' into alex/ghost-text 2021-05-21 19:57:53 +02:00
Alex Dima
c650993dd3 Add ResolvedOptions.isTrusted 2021-05-21 16:48:14 +02:00
Henning Dieterichs
9086ecd9f0 Renames Suggestion to Completion and cleans up API 2021-05-21 11:29:08 +02:00
João Moreno
a6f7aa5e4c handle workspace uris
related to #124263
2021-05-21 11:26:09 +02:00
rebornix
894b7782cc Merge branch 'notebook/dev' into main 2021-05-20 14:17:28 -07:00
Megan Rogge
6f2381e33d Terminal tab icon API (#124004) 2021-05-20 18:17:33 +00:00
rebornix
f583b4b336 Merge branch 'main' into notebook/dev 2021-05-19 19:02:13 -07:00
Matt Bierner
1ddc623e58 Simplify logic for webview resource uris (#123740)
* Simplify logic for webview resource uris

This change attempts to simplify the logic around webview resource uris by doing the following:

- Hard code the resource origin. We always will be hitting a service worker for these paths so they don't need to be dynamic (although in the future we may want to pull them from `product.json`)

    This lets us remove these properties from the environment service

- Move remote handling from the resource loader in `asWebviewUri`.

- Remove the handling of http and https paths from the resource loader.

    I don't think these cases can be hit any longer (although I need to confirm this with more testing for the web case). Instead I added a check to `asWebviewUri` so that we return the original uri if a http(s) uri is passed in

* Restore normalizeResourcePath

We still need to convert between a remote uri and one that our remote file system can read

* Fix test

* Restore passing in remote on extension side

* Remove only
2021-05-19 17:26:51 -07:00
Connor Peet
46a1ca7824 notebook: initial renderer communication 2021-05-19 17:08:13 -07:00
rebornix
5b3cf7cc2a Merge branch 'notebook/dev' into main 2021-05-19 14:12:17 -07:00
Henning Dieterichs
09ab8ad202 wip 2021-05-19 17:05:31 +02:00
Johannes Rieken
53352a2954 add API to open an untitled notebook, https://github.com/microsoft/vscode/issues/121974 2021-05-19 15:27:23 +02:00