Fixes#182526
The chat panel changes the language of a document. This revealed a bug in JS/TS about language changes.
Normally changing a language should close and reopen a text document. However we added an optimization to not do this full flow if the open then close happens quickly
However this causes issues if the file changes languages as TS gets into a state where its doc language id does not match VS Code's language id. To fix this, I've limited the optimization to only apply when the expected script kinds match
Allow copying files in the workspace on markdown drop / paste
Fixes#157043
Also:
- Renames the markdown paste settings and makes them no longer experimental
- Makes the copyFiles setting no longer experimental
- Adds a `markdown.copyFiles.overwriteBehavior` which lets you control if/how existing files are overwritten
These tests fail occasionally in CI, seemingly only on linux. This tries to fix this by:
- Adding retries
- Switching back to use `teardown` to disposed of things. `usingDisposable` may not clean up properly if the test times out
* monokai-color-theme.json: treat Python comment string blocks
...as comments too
* Update *all* themes to consider Python block string comments as comments
modified: extensions/theme-abyss/themes/abyss-color-theme.json
modified: extensions/theme-defaults/themes/dark_vs.json
modified: extensions/theme-defaults/themes/hc_black.json
modified: extensions/theme-defaults/themes/hc_light.json
modified: extensions/theme-defaults/themes/light_vs.json
modified: extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json
modified: extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json
modified: extensions/theme-monokai/themes/monokai-color-theme.json
modified: extensions/theme-quietlight/themes/quietlight-color-theme.json
modified: extensions/theme-red/themes/Red-color-theme.json
modified: extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json
modified: extensions/theme-solarized-light/themes/solarized-light-color-theme.json
modified: extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-color-theme.json
* Update all changes to use "string.quoted.docstring"
...instead of "string.quoted.docstring.multi.python", per
@aeschli's request here:
https://github.com/microsoft/vscode/pull/182162#issuecomment-1545296640
This way the comment formatting applies to *all* language quoted
docstrings, instead of just to Python.
* bring back python colorize tests
---------
Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
This fixes the range extensions get when copying an empty selection. As part of this, I've also:
- Added tests for this change
- Made the paste parts of the api optional. This is useful when a test provider only wants to add data on copy
For copy paste, I added logic to prefer using the text content if there's both `image/*` and `text/*` content in the clipboard
This however I also incorrectly applied this logic when dropping. In those cases, we instead want to prefer the image data (at least we do in the case of dragging and dropping from VS Code's explorer)
We don't need to fetch the user details when the Auth Session already has the info we need. This PR removes that extraneous web request.
I've also changed the `User-Agent` that we pass to be more specific so we can narrow down any future issues with spamming web requests.
Fixes#173645
* Add widget to change how content is pasted
For #30066
This adds a widget that lets you change how content is pasted if there are multiple ways it could be pasted
To do this, I've made the post drop widget generic and reused it for pasting too
* Update types
* More code deduplication
* Organize Errors in GitHub Auth and make sure no double prompting happens
This mostly just moves some strings into variables... but this also fixes the GH Auth side of https://github.com/microsoft/vscode/issues/180697 so you should only be asked once if you want to try a different way to log in.
* add comments
* Support copying non-pngs and wait for focus to avoid race conditions
* Remove the temporary canvas element after copying
* Update to place entire canvas creation inside promise.
* Increasing to 5 retries 20ms apart
* WIP - switching to use repository ruleset information
* Handle includes
* Refactor to add support for exclusion
* Fix exclude condition
* Fix request string
* Add logging
* Update setting description
* Allow dropping images into notebook to create attachments
Fixes#157577
This allows you to drag and drop image files or image data into a notebook cell to create an attachment
As part of this work, I also updated the paste attachment logic so that we can:
- Create multiple attachments in a single operation
- Create attachments of other mime types besides `image/png`
- Create attachments for images that have spaces in the filename
* Also allow pasting uri lists to create attachments
* Fix indent
* Add id
Allow copying image from image preview
Fixes#171616
Lets you cmd+c / right click to copy images from the image preview
Also disables the copy/paste options in the other media previews since they don't currently support copying
For web, it seems the most feasible direction for resolvers as we make
existing remote extensions 'web enabled' is to allow them to run in the
extension host. However, in no case will there just be a simple
websocket we can connect to ordinarily.
This PR implements a first cut at 'inline' resolvers where messaging is
done in the extension host. I have not yet tested them on web, where I
think some more wiring is needed to mirror desktop. Also, resolution of
URLs is not in yet. I think for this we'd want to do some service-worker
-based 'loopback' approach to run requests inline in the remote
connection, similar to what I did for tunnels...
Resolvers are not yet run in a dedicated extension host, but I think
that should happen, at least on web where resolvers
will always(?) be 'inline'.
Most of the actual changes are genericizing places where we specified
the "host" and "port" previously into an enum. Additionally, instead of
having a single ISocketFactory, there's now a collection of them, which
the extension host manager registers into when a managed resolution
happens.
* Allow passing in a `DataTransferItem` to workspace edit
Fixes#175800
Allows you to pass a file `DataTransferItem` to `WorkspaceEdit.createFile`. This lets us avoid transferring the data back and forth to the extension host, and also avoid having to base64 encode and decode it, significantly improving performance for large files
* Take data transfer file instead of data transfer item
For #179430
Adds two new UX components:
- An inline progress icon shown when a drop operation takes over 500ms. This replaces the notification. You can click on it to cancel the drop
- Post drop, a drop feedback icon that lets you drop the file in a different way. This lets you drop the file as plain text for instance instead of as a markdown link
* Add preference for replacing Go to Definition with Go to Source Definition
* Support replacing Go to Definition with Go to Source Definition by preference
* Predicate call on TS version