Commit Graph

49 Commits

Author SHA1 Message Date
Matt Bierner
649dd18019 Try to encode authority for asWebviewUri
Fixes #123494

This change attempts to address issues where `asWebviewUri` could create an valid uri but an invalid http uri. This issue appears to be when the host contains a forbidden character (even if it is percent encoded): https://url.spec.whatwg.org/#forbidden-host-code-point

Having one of these characters in the host causes the url to become invalid, resulting in network requests never being made

To fix this, I've added a very simple (poor) encoding mechanism for the authority. I went with my own mechanism over something like base64 because base64 can output `/` and it's also not easy to use across both node and browsers. I also considered base62 and punycode, but both of these would be best to pull in libraries for
2021-08-09 11:24:35 -07:00
Alex Ross
3d5b13265d Re-add task default API with fixes (#129397)
Part of #79188
2021-07-26 15:30:46 +02:00
Alex Ross
8f774f132e Tree data transfer dnd (#128666) 2021-07-16 14:22:54 +02:00
Alex Ross
cbde02b886 Failing test: Revert "Add isDefault to TaskGroup API (#128596)"
This reverts commit 48975dc080.
2021-07-16 10:16:16 +02:00
headerjson
48975dc080 Add isDefault to TaskGroup API (#128596)
* first pass at adding api

(cherry picked from commit 8a583c52ee)

* add task2 remaining changes

* remove unnecessary changes

* modify tasks.json directly for test

* reset tasks in test

* Fix compilation errors

Co-authored-by: Alex Ross <alros@microsoft.com>
2021-07-15 15:42:12 +02:00
Matt Bierner
021071ff74 Avoid double encoding authority 2021-05-21 12:16:49 -07:00
Matt Bierner
9847783f62 Remove uuid from webview resource uris
This is no longer be needed. We still serve the webview code itself from a unique subdomain

This also removes the need for `serviceWorkerFetchIgnoreSubdomain`
2021-05-21 09:28:43 -07:00
Matt Bierner
79dea51e79 Rewrite webview urls to be more url-ish
## Problem

Webview uris currently have the form:

```
https://uuid.vscode-webview.net/vscode-resource/scheme/authority/path...
```

We have this syntax because we need to be able to recover the original scheme and authority of the resource in order to load it from disk

However this syntax means that absolute urls don't behave as you'd expect. For example, if you have a webview that sets a `<base>` to a document in the workspace, an absolute url `/abs/path.png` ends up being resolved to:

```
https://uuid.vscode-webview.net/abs/path.png
```

This drops the original scheme and authority, which prevents us from loading the resource

## Fix
With this change, I've moved the original scheme and authority into the authority of the webview uri instead of the path:

```
https://scheme+authority.vscode-resource.uuid.vscode-webview.net/path...
```

With this change, absolute paths should correctly be resolved
2021-05-21 09:28:43 -07:00
Matt Bierner
9e04a67d12 Switch to use vscode-webview.net as default webview endpoint
This moves us off of `vscode-webview-test` to instead use `vscode-webview.net` for loading webview resources. We now also pick this up from the product.json instead of hardcoding it
2021-05-20 17:38:18 -07:00
Matt Bierner
07a2aab8f2 Remove duplication around checking isRemote 2021-05-20 16:00:40 -07:00
Matt Bierner
18ea5ac15e Use isRemote instead of remote authority to determine where to load from 2021-05-20 11:30:43 -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
Matt Bierner
b847eb35e7 Add remote-authority to webview uri 2021-05-11 18:14:13 -07:00
Matt Bierner
4177014a1c Revert "Put authority into webview resource uri"
This reverts commit 3d978d4dde.
2021-05-10 23:01:26 -07:00
Matt Bierner
3d978d4dde Put authority into webview resource uri
This lets us handle the case where a webview needs to load both local and remote resources
2021-05-10 20:40:07 -07:00
Alex Ross
7a92985cde Add "close" presentation option to tasks
Fixes #112230
2021-05-04 14:52:29 +02:00
Alexandru Dima
f101028176 Fixes #114299: Add commands for invoking semantic tokens provider 2021-01-18 17:05:47 +01:00
Rob Lourens
3283ade764 Don't use 'expandPatterns' for workspaceContains search
Fix #110510
2020-12-31 11:10:10 -08:00
David Sanders
76a8ea640e Add undefined to TaskProcessEndedDTO.exitCode (#110508) 2020-11-13 10:26:02 +01:00
Benjamin Pasero
630e706ad2 Add open context to certain commands (#110475)
* editor commands - move API commands to workbench core

* rename EditorViewColumn => EditorGroupColumn

* mixin context to open commands

* address some feedback

* add comment
2020-11-12 17:01:13 +01:00
Alex Dima
87dd7d6a9c Move deltaExtensions related methods up to AbstractExtensionService 2020-09-25 22:25:10 +02:00
Alex Dima
3c77120d88 Fixes #75284: Run a real search when enabling/installing an extension with workspaceContains 2020-07-06 23:35:08 +02:00
Alex Dima
d432126ecf Extract workspaceContains related logic to a separate file (#75284) 2020-07-06 23:15:52 +02:00
Alex Dima
8918d05cb5 Fixes issue #94521: Make sure to always specify Uint32Array length in ctor 2020-04-06 17:06:00 +02:00
Alex Dima
2da34cd2dd Fetch and set semantic tokens in the viewport 2020-03-25 23:13:44 +01:00
Alex Dima
153a1ba3d8 Simplify encoding / decoding code 2020-03-24 11:55:04 +01:00
Alex Dima
c0f2ad1dcd Use subarrays if the platform is little endian 2020-03-24 10:57:36 +01:00
Alex Dima
c952ac25a9 Use little endian encoding for uint32 in semantic tokens dto 2020-03-24 10:18:24 +01:00
Alex Dima
7320a04ba0 Add tests to encode/decode SemanticTokensDto 2020-03-24 10:08:14 +01:00
Alex Ross
2c1ad8e921 Fix task user task exeuction through AP.
Fixes #90820
2020-02-21 10:58:54 +01:00
Matt Bierner
1b70625f8c Use import type when importing vscode under src
When the core references `vscode`, we only want to import the types and never generate a real import (which will fail to load). Use `import type` to better enforce this
2020-01-10 14:25:21 -08:00
Alex Dima
d6dae16f40 Remove areas from the semantic tokens API 2019-12-02 10:41:32 +01:00
Alex Dima
5eaf74f52d Delta encode single semantic coloring areas 2019-11-08 12:07:06 +01:00
Alexandru Dima
013433992a Semantic tokenization 2019-11-05 17:17:28 +01:00
Alexandru Dima
308ff31f95 Merge remote-tracking branch 'origin/master' into alex/semantic-exploration 2019-11-05 09:44:55 +01:00
Alex Ross
87998af618 Add task detail property and adopt in npm extension
Fixes #69785
2019-10-22 15:56:21 +02:00
Alex Ross
dc4b1c231c Rename CustomExecution2 to CustomExecution
Part of #80375
2019-10-11 14:43:23 +02:00
Matt Bierner
e904a5f646 Warn development webview extensions that use vscode-resource uris directly
Fixes #81685
2019-09-30 14:22:47 -07:00
Alexandru Dima
45a92a4937 wip 2019-09-30 15:19:07 +02:00
Matt Bierner
6b947b14ed Fix image preview extension for remote
Fixes #81434

- Make image preview a ui exension

- Add logic so that `asWebviewUri` supports preserving the scheme of the requested resource. This is important as we know where to load the resource from
2019-09-25 16:25:40 -07:00
Matt Bierner
1ee616d802 Don't duplicate external webview commit in so many places 2019-09-16 14:19:16 -07:00
Matt Bierner
54ac29790e Make sure asWebviewUri also handles replacing commit 2019-09-12 16:07:47 -07:00
Matt Bierner
c5dc9d16be Finalize asWebviewUri api
Fixes #79242

As discussed, renames `toWebviewResource` to `asWebviewUri` to be consistent with the `asAbsolutePath` api naming
2019-08-19 20:18:26 -07:00
Alex Ross
a98faa4454 Remove CustomExecution
Fixes #78540
2019-08-06 13:48:37 +02:00
Alex Ross
e84fc7021b Adopt TerminalVirtualProcess for Custom task execution (#76852)
* Adopt TerminalVirtualProcess for Custom task execution

* Update Custom task execution API to return TerminalVirtualProcess in callback

This also required the addtion of a start on the virtual terminal process

* Clarify start API

Fixes #76492
2019-07-10 09:31:40 +02:00
Matt Bierner
c01a3a718d Use clearer name for csp webview element
#76489
2019-07-09 11:45:20 -07:00
Matt Bierner
f963c9a2a8 Adding tests and changing how toWebviewResource works
- Allow placeholders in the webviewEndpoint. This is required to support serving each webview from its own origin
- Add tests for toWebviewResource
2019-07-09 11:45:10 -07:00
Matt Bierner
a558a9504a Adding toWebviewResource api
For #76489
2019-07-08 18:38:47 -07:00
Johannes Rieken
c92ce4014f move extHost.protocol to common, #70319 2019-03-19 15:46:01 +01:00