Commit Graph

156 Commits

Author SHA1 Message Date
Matt Bierner 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 Bierner 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 Bierner 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
Matt Bierner 1c7ab35761 Rename to DocumentOnDropEditProvider (#149730)
This change renames `DocumentOnDropProvider` to `DocumentOnDropEditProvider`. This new name aligns with the existing `DocumentFormattingEditProvider`
2022-05-17 09:26:54 -07:00
Henning Dieterichs f98ae66391 Merge pull request #148767 from microsoft/hediet/inline-completion-update
Updates inlineCompletions proposal from inlineCompletionsNew proposal.
2022-05-05 13:51:21 +02:00
Henning Dieterichs bae40168ae Fixes issues from code review 2022-05-05 09:54:41 +02:00
Matt Bierner 93fd393a0e Add API proposal for reading files in data transfer (#148596)
* Add experimental support for reading files in data transfer

Adds a new `DataTransfer.asFile` method which lets you get file objects from a `DataTransfer`. This is currently only hooked up for drop into editors.

A few follow ups:

- Right now the file data is also read eagerly when it is transfered to the extension host. Before shipping this we would make this happen lazily instead
- The drop into editor api does not provide a nice way to do anything with the dropped files.

    We should at least support returning a `WorkspaceEdit`. However `WorkspaceEdit` only supports text files, so we would also need to add an API that lets it deal with binary files

* Make `asFile` return a value instead of a promise

`asFile().data()` already returns a promise so `asFile` doesn't also need to be async

* Trying resolving data files transfer lazily

* Cleaning up code for lazy drop

* Remove testing code

* Remove unneeded buffer serialize

* 💄
2022-05-04 12:59:27 -07:00
Johannes c4dd43dd79 💄 2022-04-14 14:53:24 +02:00
Matt Bierner 23c7781b9f Create drop into editor contribition
Will use this to add a default implementation and other features for drop into editor
2022-04-04 15:56:27 -07:00
Matt Bierner ae0f691839 _codeEditorService is optional in tests 2022-04-01 16:32:53 -07:00
Matt Bierner 44ffeba237 Switch to provider based model for on drop
This simplifies implementing the provider and also give potentially gives us more control over how the drop happens
2022-04-01 15:51:38 -07:00
Alex Dima 8c9663f461 Remove the static LanguageConfigurationRegistry 2022-03-31 16:25:57 +02:00
Alex Dima 6136c815bc Renames 2022-02-04 15:01:44 +01:00
Johannes Rieken 4a130c40ed enable @typescript-eslint/member-delimiter-style, https://github.com/microsoft/vscode/issues/140391 2022-02-02 14:35:33 +01:00
Johannes Rieken 54dec24a4d Merge pull request #141872 from microsoft/joh/langFeatures 2022-02-01 10:40:19 +01:00
Alex Dima e2541e9263 Move extHostCustomers.ts to workbench/services (#141003) 2022-01-31 19:57:21 +01:00
Johannes Rieken 1ad8719a2f replace CodeActionProviderRegistry with service property 2022-01-31 18:17:56 +01:00
Johannes Rieken 56a52eea57 replace DocumentSemanticTokensProviderRegistry with service property 2022-01-31 18:02:25 +01:00
Johannes Rieken b9686f35a3 replace DocumentRangeSemanticTokensProviderRegistry with service property 2022-01-31 17:48:44 +01:00
Johannes Rieken 530f762d14 replace EvaluatableExpressionProviderRegistry with service property 2022-01-31 17:29:36 +01:00
Johannes Rieken fe103b623e replace InlineValuesProviderRegistry with service property 2022-01-31 17:26:56 +01:00
Johannes Rieken 672633f825 replace LinkedEditingRangeProviderRegistry with service property 2022-01-31 17:17:04 +01:00
Johannes Rieken dd79e3fcbd replace CompletionProviderRegistry with service property 2022-01-31 16:45:30 +01:00
Johannes Rieken f42bd599c4 replace InlineCompletionsProviderRegistry with service property 2022-01-31 16:10:04 +01:00
Johannes Rieken ff47d8fd85 replace LinkProviderRegistry with service property 2022-01-31 15:27:02 +01:00
Johannes Rieken 9308c64386 replace ColorProviderRegistry with service property 2022-01-31 14:16:32 +01:00
Johannes Rieken 6374172cb6 replace FoldingRangeProviderRegistry with service property 2022-01-31 14:10:27 +01:00
Johannes Rieken 05a6debf18 replace SelectionRangeRegistry with service property 2022-01-31 14:07:00 +01:00
Johannes Rieken aa5e35f7f2 Merge branch 'main' into joh/langFeatures 2022-01-31 12:47:42 +01:00
Alex Dima 7c1c530051 Move ILanguageService to editor/languages (#141174) 2022-01-31 12:38:00 +01:00
Johannes Rieken 60f4d07d01 replace DocumentHighlightProviderRegistry with service property 2022-01-31 12:37:29 +01:00
Johannes Rieken 40e3684c11 replace HoverProviderRegistry with service property 2022-01-31 12:25:59 +01:00
Johannes Rieken 1f46724290 replace SignatureHelpProviderRegistry with service property 2022-01-31 12:12:25 +01:00
Johannes Rieken dfe1ebf8c9 replace ImplementationProviderRegistry with service property 2022-01-31 11:57:22 +01:00
Johannes Rieken 60bf54dcd9 replace DeclarationProviderRegistry with service property 2022-01-31 10:43:54 +01:00
Johannes Rieken 98ed6e1eb4 replace TypeDefinitionProviderRegistry with service property 2022-01-31 10:37:19 +01:00
Johannes Rieken 56f0932539 replace DefinitionProviderRegistry with service property 2022-01-31 10:31:39 +01:00
Johannes Rieken ecbdbffde2 replace formatting registries for service properties 2022-01-31 10:01:17 +01:00
Johannes Rieken 89a498f820 replace CodeLensProviderRegistry with service property 2022-01-31 09:37:08 +01:00
Johannes Rieken 888170e18e replace InlayHintsProviderRegistry with service property 2022-01-31 09:31:16 +01:00
Johannes Rieken 57a7184820 replace DocumentSymbolProviderRegistry with service property 2022-01-31 09:23:16 +01:00
Johannes Rieken 9276e615a3 onboard rename to language feature service 2022-01-28 18:31:21 +01:00
Johannes Rieken 5dc873f464 move ReferenceProviderRegistry into new ILanguageFeaturesService service 2022-01-28 18:19:52 +01:00
Johannes Rieken ffdeff7b55 show error when inlay hints command fails, annotate error with source (e.g extension name), fixes https://github.com/microsoft/vscode/issues/141588 2022-01-27 10:47:15 +01:00
Alex Dima d8ca757f2b Move ISingleEditOperation to /core/ (#141174) 2022-01-21 20:35:35 +01:00
Johannes Rieken 15db136c3c use Dto<T> util in more places, some clean-up/alignment of caching logic 2022-01-19 15:12:22 +01:00
Johannes Rieken e5703c8405 allow to race against cancellation when invoking _withAdapter, never log cancellation errors, https://github.com/microsoft/vscode/issues/140557 2022-01-12 16:17:39 +01:00
Johannes Rieken 62bae334d5 properly propagte cancellation, https://github.com/microsoft/vscode/issues/129528 2022-01-10 15:03:12 +01:00
Johannes Rieken 2586299c42 experiment with InlayHintLabelPart and source location as "anchor action",
https://github.com/microsoft/vscode/issues/129528
2022-01-07 20:47:33 +01:00
Johannes Rieken 3677cc48a8 support to resolve inlay hints for hover and for future display parts, https://github.com/microsoft/vscode/issues/129528 2022-01-06 16:30:04 +01:00