Commit Graph
203 Commits
Author SHA1 Message Date
0bfc1dbb62 # Add partial accept kind to inline completion handle (#202668)
* # Add partial accept kind to inline completion handle

---------

Co-authored-by: Henning Dieterichs <hdieterichs@microsoft.com>
2024-03-04 16:05:28 +00:00
ad35b73352 Inline Edits (#204158)
* implementation of inline edits

---------

Co-authored-by: Krzysztof Cieslak <krzysztof_cieslak@windowslive.com>
Co-authored-by: Andrew Rice <acr31@github.com>
2024-02-16 16:16:05 +01:00
Ulugbek Abdullaev 8bec045945 rename suggestions: migrate to using list widget 2024-02-14 00:48:29 +01:00
Ulugbek Abdullaev 14770d1197 feat: add proposed API newSymbolNamesProvider that allows extensions to suggest new names for symbols that are being renamed 2024-02-08 12:16:36 +01:00
Johannes RiekenandGitHub 8adf59fc00 fix https://github.com/microsoft/vscode/issues/193124 (#202061) 2024-01-09 11:19:35 +01:00
Matt BiernerandGitHub 88a6ed6d9b Only show paste as html when it is explicitly requested (#202039)
Fixes #202013
2024-01-08 13:32:02 -07:00
Michael LivelyandGitHub e33219dde3 Add multi-document highlight provider feature (#198467)
* multi-doc api + text provider editor feature + extHost hookup + typescript semantic multi-doc

* fix disposable leak, wasn't setting providers to the disposableMap

* filter unnecessary models to fix errors with typescript provider

* fix nits (todo - doc filter)

* fix typo from merge conflict

* expose LanguageSelector in multi-doc provider, filter out 0 score models
2023-11-22 10:07:20 -08:00
Michael LivelyandGitHub f21178ba84 x-doc highlight. If no semantic occurences, don't search for textual occurrences (#197683)
promise is never falsy, check data in callback
2023-11-13 09:25:14 +01:00
Aaron MungerandAaron Munger fcf7d14571 remove unnecessary disposed check 2023-11-06 12:13:34 -08:00
Michael LivelyandGitHub 59f9d4ceff mainThreadLangFeat isDisposed check (#197395)
* mainThreadLangFeat isDisposed check

* check focused model isDisposed()

* extra dipose check addressing async cell disposal

* get the word pre model disposal, avoid checking disposed TextModels
2023-11-03 22:25:58 +01:00
Michael LivelyandGitHub 7dff07893a Support Multi Editor/Model Highlighting (#196024)
* support multi-editor highlighting

* Add experimental multi-document occurrences highlighting option

* highlight accross notebook cells even without multi-doc setting

* otherModels helper + ResourceMap + fixed removeDecorations

* combine textual to just `TextualOccurenceRequest`

* fix aggressive dispose/decoration clearing, introduce query interface
2023-10-24 06:27:02 +02:00
Ulugbek Abdullaev 2c9e2b85b2 use LanguageFeaturesService to support MappedEditsProviders instead of creating a new MappedEditsService 2023-08-22 15:46:44 +02:00
Matt BiernerandGitHub 8c7747252e Move drop/paste ids onto providers (#189961)
For #179430, #30066

This lets us call just the provider we are interested in
2023-08-08 14:44:03 -07:00
Diego ColomboandGitHub 8e1ae0da75 Add proposed api to support auto closing pairs on langauge configuration (#186567)
* adding support for auto closing pair
2023-07-14 13:19:13 +00:00
Henning DieterichsandGitHub d1ae8a6ecc Inline Completions: Implements yieldsTo (#187156)
Fixes #https://github.com/microsoft/vscode-internalbacklog/issues/4055
2023-07-07 16:29:09 +02:00
Johannes RiekenandGitHub 7288d304c9 make sure extension completion item provider have their extension identifier set correctly (#185685) 2023-06-20 17:52:23 +02:00
Matt BiernerandGitHub 9b6b547d2d Fix range when copying empty selection (#182227)
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
2023-05-11 17:31:11 -07:00
Matt BiernerandGitHub 945077a032 Fix paste edit providers incorrectly overwriting data transfer values (#182169)
At present, copy providers on the ext host side return the full data transfer object passed to them (which includes any additions they make). We then use this to construct a new data transfer that is passed on to paste providers

There are a few bugs with this approach:

- If there are multiple copy providers, they can incorrectly end up overwriting each other. For example if the initial data transfer contains `text/plain` and there are two providers, the first of which tries writing a new `text/plain`, the second provider will overwrite this with the initial `text/plain` value

- If the original data transfer contains multiple entries for a mime, these always end up being overwritten with a single value

- We shouldn't waste type transferring value back to the main thread if the main thread already has them

This PR tries to fix this by skipping ext host to main thread transfer of non-modified data transfer items. As part of this work, I reworked a few internal structures and introduced a new `IReadonlyVSDataTransfer` interface to make it more clear when a internal data transfer is or is not expected to be modified
2023-05-11 15:26:42 +02:00
Matt BiernerandGitHub 4d38422afe Add priority to paste / drop apis (#182109)
* Add priority to paste / drop apis

Fixes #181886

Replacement for #181453

* Make notebooks prefer text over creating attachments
2023-05-10 14:18:05 -07:00
Matt BiernerandGitHub ca51a4b04c Add paste as command (#181959)
For #30066

This command shows a quick pick that lets you select how to paste content
2023-05-10 06:17:42 -07:00
Matt BiernerandGitHub 1a29d4c064 Add better fall backs to standard pasting logic (#181585)
Fixes #181489

This tries to avoid having copy paste provider mess up normal text copy and paste by doing the following:

- When copy paste providers are used but non end up handling the paste,  compute the `PastePayload` more correctly

- If only a single provider is used and it's the default text provider, fall back to the editor's paste handler instead or using it

- Be more aggressive about avoiding invoking providers. Before deciding to override paste, we now check a list of possible mime types on the clipboard. We can then use this list to filter out providers which we know will not handle any of these types
2023-05-05 07:58:45 +10:00
Matt BiernerandGitHub 11ca8d75a1 Add widget to change how content is pasted (#181290)
* 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
2023-05-02 09:40:04 +02:00
Henning DieterichsandGitHub b2cddf3e64 Fixes #153754. (#180490)
* Fixes #153754.

* Fixes #159479
2023-04-21 11:27:20 +02:00
Matt BiernerandGitHub 739b93cce8 Update drop metadata proposal (#179918)
- Makes `dropMimeTypes` required
- Prefix the actual `id` used internally with the extension id
- Allow wildcard mime types, such as `image/*`
2023-04-14 07:59:38 +10:00
Matt BiernerandGitHub 830d534e27 Allow passing in a DataTransferFile to workspace edit (#175809)
* 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
2023-04-13 14:08:08 -07:00
Matt BiernerandGitHub e9262678fa Add drop feedback UX (#179434)
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
2023-04-11 13:48:24 -07:00
Johannes RiekenandGitHub ab6087f090 update format ranges API proposal based on feedback (#179166)
https://github.com/microsoft/vscode/issues/158776
2023-04-04 19:19:15 +02:00
Johannes f6d3226ade remove inactive remains of Range | Range[] 2023-03-30 16:57:19 +02:00
Johannes RiekenandGitHub a47c78516c Merge branch 'main' into multirange-formatting 2023-03-30 16:33:11 +02:00
Matt BiernerandGitHub ce00cd7812 Add initial prototype for JS/TS move to file refactoring (#178535)
Add initial support for move to file

Fixes #176705
For https://github.com/microsoft/TypeScript/pull/53542
2023-03-28 16:49:50 -07:00
Johannes ab81ed0b35 fix breakage 2023-02-24 18:06:28 +01:00
Johannes 9a6bf40e40 fix https://github.com/microsoft/vscode/issues/173501 2023-02-24 17:10:07 +01:00
Cristopher Claeys 636dd226c6 Address PR comments 2023-02-16 19:43:29 +01:00
Cristopher Claeys 17f5d8b168 Add support for multiRange formatting 2023-02-16 19:43:29 +01:00
Henning Dieterichs c3bf0fb83c Fixes #172384 2023-01-30 14:35:39 +01:00
Matt BiernerandGitHub a8c16a0d82 Try to reduce size of completions DTO (#164087)
JS/TS can return a lot of completions. I noticed that just parsing this was taking a bit of time, so I tried to reduce the message size with the following changes:

- Inline the command properties on `ISuggestDataDto`
- Drop the `title` and `tooltip` from the command since we don't use these
- Shorten the delegate command name
- If using an `$ident` command, don't send over the command arguments since the arguments are always `[$ident]`
- Make commit characters a string instead of an array

Here's an example of a dto for a completion item before:

```
{"x":[2,0],"a":"$","b":4,"e":"15","i":0,"k":[".",",",";","("],"m":{"$ident":867,"id":"_vscode_delegate_cmd_l9g7z48t","title":"","arguments":[867]}}
```

And after:

```
{"x":[1,0],"a":"$","b":4,"e":"15","i":0,"k":".,;(","n":11,"o":"__vsl9g7vfno"}
```

For global completions in a JS/TS file, this makes the completion response a little over 40% smaller.
2022-10-24 14:16:52 -07:00
6e76e0e1b7 feat: select the folding provider to use (#157434)
* feat: support extension id in property `editor.foldingStrategy`

* work in progress

* use new setting 'editor.defaultFoldingRangeProvider' defined in workspace

* revert editorOptions changes

Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
2022-10-23 15:45:34 +02:00
Matt BiernerandGitHub 1d45633795 Add DisposableMap helper (#163006)
Adds `DisposableMap` to help manage the lifecycle of maps of  disposable values. This is useful for a few reasons:

- `DisposableMap` is itself disposable, so you can use it with `_register` or add it to a `DisposableStore`
- The implementation of `set` on `DisposableMap` prevents leaking values on override
- The `delete` implementation also makes sure it disposes of the deleted values
2022-10-07 15:28:36 -07:00
Matt BiernerandGitHub f86ceb6749 Use ids instead of indexes for resolving data transfer files (#160349)
When an extension needs to read a data transfer file, we were previously using the index of the item. This is unreliable as it means we have to ensure the array of data transfer items never changes order

With this PR, i've switched us to use a unique `id` instead
2022-09-07 13:18:49 -07:00
Johannes RiekenandGitHub e0ccceeb04 Use canonical uris when applying bulk edits (#159067)
* Use canonical uris when applying bulk edits

* move `reviveWorkspaceEditDto` into mainThreadBulkEdit
* make `reviveWorkspaceEditDto` require the uri ident service
* add test

fixes https://github.com/microsoft/vscode/issues/158845

* revive first, otherwise the `is` checks don't work

* fix tests
2022-09-06 14:51:11 +02:00
Matt BiernerandGitHub 7f6984e71b Fix copy paste for files (#155915)
This fixes the copy paste proposed api to correctly support pasting of files and file data
2022-07-21 16:49:25 -07:00
Matt BiernerandGitHub f17b33faf2 Use .?method() in more places (#152112)
Switches simple patterns like:

```ts
if (some.thing) {
    some.thing.method();
}
```

to:

```ts
some.thing?.method()
```

This is more concise and avoids having to repeat the `some.thing` part
2022-06-15 16:28:31 +00:00
Johannes 3622010b64 Merge branch 'main' into joh/voluminous-lobster 2022-06-09 09:08:20 +02:00
Matt BiernerandGitHub d7c90c2b2b Update text editor drop proposal (#151552)
This updates the text editor drop proposal (#142990). This change introduces `DocumentDropEdit` which removes the need for `SnippetTextEdit`. This interface may also be extended in the future with additional metadata
2022-06-08 17:44:28 -04:00
Matt BiernerandGitHub 370dfd5fee Iterate on paste edit provider api (#151477)
* Iterate on paste edit provider api

For #30066

- Pass all selections to paste providers. For #151326
- Introduce `DocumentPasteEdit` as return type. This new type uses an `insertText` that is applied to every paste location (for multicursor), plus an optional additional edit
-  Add `DocumentPasteProviderMetadata`. This lets extensions tell us which types of mimetypes they are interested in, letting us avoid round trips if no extensions care about the pasted data

* Correctly batch insertText
2022-06-08 15:06:55 -04:00
Johannes 0656d21d11 auto-fixed prefer-const violation 2022-06-08 17:49:21 +02:00
Matt BiernerandGitHub 528ee1ae3d Allow multiple entries with the same mimetype in dataTransfer (#150425)
Currently our data transfer implementation only allows a single entry of each mimeType. There can only be a single `image/gif` file for example.

However this doesn't match how the DOM apis work. If you drop multiple gifs into VS Code for example, the DataTransfer you get contains entries for each of the gifs.

This change allows us to also support DataTransfers that have multiple entries with the same mime type. Just like with the DOM, we support constructing these duplicate mime data transfers internally, but do not allow extensions to create them

As part of this change, I've also made a few clean ups:

- Add helpers for creating dataTransfer items
- Clarify when adding a data transfer item should `append` or `replace`
- Adopt some helper functions in a few more places
2022-05-25 18:29:28 -07:00
Matt BiernerandGitHub e4f7f6a9da Add PasteEditProvider (#107283)
For #30066

This adds a new `documentPaste` api proposal that lets extensions hook into copy and paste.

This can be used to do things such as:

- Create link when pasting an image
- Bring along imports when copy and pasting code
2022-05-25 12:27:58 +02:00
Matt BiernerandGitHub 91923bab48 Cleanup data transfer types (#149774)
This change attempts to clean up our internal data transfer types

- Replace `IDataTransfer` (which was just an alias for map) with a `VSDataTransfer` helper class.

    This lets us add helpers and also restrict what you can do on a datatransfer

- Move `DataTransferDTO` types into `protocol`

- Move `DataTransferTypeConverter` into `typeConvert`

- Don't return internal types to ext host callers

     For example, previously we leaked `IDataTransfer` out into providers / controllers. Instead we should always return an instance of `vscode.DataTransfer` to extensions
2022-05-23 23:28:02 +00:00
Matt BiernerandGitHub 116c10e0ee Add drop into editor option (#147049)
* Add drop into editor option

This change adds a new `enableDropIntoEditor` editor option that enables/disables dropping an extermal resources into an editor

Previously this option was exposed `IEditorConstructionOptions`, however this did not correctly disable drop into editor when dragging and dropping unknown types (such as dragging emoji from the MacOS emoji panel)

With this change, disabling `workbench.editor.dropIntoEditor.enabled` should fully disable the new drop into behavior

* Move drop into editor from workbench to editor

This moves the `dropIntoEditorContribution` from the workbench layer to the platform layer

As part of this change, I also add to move `extractEditorsDropData` up to `platform` so that it could be used from the `editor` layer

This change also enables drop into for the SCM message box

* Fixing monaco errors

* Revert id change
2022-05-17 11:35:04 -07:00