Commit Graph

2616 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
Logan Ramos d937389358 Add owners to all telemetry events (#150296) 2022-05-24 14:58:08 -04:00
Alexandru Dima 339c3a9b60 Fixes #150176: Extract code related to encoded token attributes to a separate file (#150275) 2022-05-24 13:51:23 +00:00
Alexandru Dima ba59882f71 Reduce usages of editor.deltaDecorations (#149768) 2022-05-17 15:08:27 -07: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
Alexandru Dima 8463cd27b3 Reduce usages of editor.deltaDecorations (#149718) 2022-05-17 10:06:59 -04:00
Alexandru Dima 33b4013ecb Avoid using deltaDecorations in cases where it could recurse (#149644)
* Add a safer alternative to `editor.deltaDecorations` (#148423)

* Adopt `IEditorDecorationsCollection` in `wordHighlighter` (fixes #149636)

* Adopt `IEditorDecorationsCollection` in `contentHover` (fixes #149640)

* Go through a change accessor to change decorations (fixes #149642)

* Adopt `IEditorDecorationsCollection` in `goToDefinitionAtPosition`
2022-05-16 17:41:44 +02:00
Alexandru Dima 2bf6f8e55f Fixes #146444: Call setPointerCapture with all pointer types, to match the previous mouse drag behavior (#149281) 2022-05-11 11:26:05 -07:00
Alexandru Dima 66fccc7ebf Merge pull request #146866 from dlech/patch-9
allow null in ICodeEditor.restoreViewState()
2022-05-11 16:59:29 +02:00
Alexandru Dima 0175770dc3 Fixes #147978: Remove throttling from mouse move listeners (#149252) 2022-05-11 07:47:11 -07:00
David Lechner 816047831e more instances 2022-05-11 15:09:16 +02:00
David Lechner 8bfeb84fe0 allow null in ICodeEditor.restoreViewState()
This changes the state parameter type of `ICodeEditor.restoreViewState()` to match the return type of `ICodeEditor.saveViewState()` ([source](https://github.com/microsoft/vscode/blob/3698a0b247d7c252b31bd25631647911328ae513/src/vs/monaco.d.ts#L2354)). 

The implementing function allows null as seen in [the source](https://github.com/microsoft/vscode/blob/b57db0fc49ee5777a4e02e8936f5b8cb9fb6182d/src/vs/editor/browser/widget/codeEditorWidget.ts#L995).
2022-05-11 15:09:16 +02:00
Johannes 9c44dba7b0 make quickSuggestions settings just an object, no more anyOf, add editor-specific migration logic for this setting 2022-05-04 16:10:46 +02:00
Henning Dieterichs 66f12dd64e Fixes #148354 by only calling this._mouseDownOperation.start(...) when shouldHandle is set. 2022-04-28 16:18:34 +02:00
Alex Dima 155389030c Fixes #148154: When there is selection in the editor, make sure to have something selected in the textarea too to get context menu cut and copy working 2022-04-28 16:12:15 +02:00
Alex Dima 7c542ab78e Fixes #146770: If no text is pasted, but there are files in the clipboard data, generate text from the file names 2022-04-27 23:10:11 +02:00
Henning Dieterichs 1ccee4ae21 Fixes #143484 2022-04-21 13:28:26 +02:00
Alexandru Dima 65ac7bde2a Merge pull request #146552 from microsoft/hediet/tokenization
Moves tokenization logic from text model to its own text model part.
2022-04-06 10:12:42 +02:00
Alex Dima ddf70921cd Fixes #146486: Add a eager pointerup listener which shouldn't miss any events 2022-04-06 00:37:04 +02:00
Alex Dima b99fd99594 Use word related methods always through ITextModel 2022-04-05 21:16:20 +02:00
Henning Dieterichs 6e1e0b1d89 Moves tokenization logic from text model to its own text model part. 2022-04-01 17:37:52 +02:00
Henning Dieterichs 78cb0b490a Fixes #136474, fixes #136475. Rewrites bracket guides. 2022-04-01 09:27:18 +02:00
Johannes f86e056a2a Merge branch 'main' into joh/bulkEditSave 2022-03-31 12:28:57 +02:00
Johannes f029d57ab4 add generic files.refactoring.autoSave and let users of the bulk edit service say if the setting should be honored 2022-03-31 12:22:28 +02:00
Alex Dima 5eb302c438 Do not overwrite new settings (#141026) 2022-03-30 17:31:47 +02:00
Alex Dima 410bd84502 Represent each option migration as an EditorSettingMigration 2022-03-30 17:31:47 +02:00
Alex Dima 72ffb4689f Add tests for migrateOptions 2022-03-30 17:31:46 +02:00
Johannes 79e49b2667 add saveWhenDone option to bulk edit service, adds ResourceSet as sibling to ResourceMap 2022-03-30 14:43:50 +02:00
rebornix 93aad560e1 Revert "Nulling dom node refs to prevent leaks on detached dom nodes."
This reverts commit 0f5c997b1d.
2022-03-29 17:27:42 -07:00
rebornix 0f5c997b1d Nulling dom node refs to prevent leaks on detached dom nodes. 2022-03-29 16:26:44 -07:00
Alexandru Dima b57db0fc49 Merge pull request #146209 from microsoft/alex/shared-emitter-delivery-queue
Deliver all outgoing editor events in order
2022-03-29 22:29:46 +02:00
Matt Bierner 46abb2bd3c Pick up latest TS for building VS Code
Also adds fixes for https://github.com/microsoft/TypeScript/issues/48468
2022-03-29 10:14:42 -07:00
Alex Dima 557c620c8d Deliver all outgoing editor events in order (#146174) 2022-03-28 17:51:36 +02:00
Alex Dima 00b43acca3 Fixes #145872: Emit model events using the view model outgoing queue 2022-03-23 15:58:57 +01:00
Matt Bierner 69cb3df6e3 Restrict which editors support drop into
Fixes #145644
2022-03-22 18:15:00 -07:00
Matt Bierner 77d9be7a45 Use text/uri-list for drop into editor
For #145713
2022-03-22 17:36:32 -07:00
Matt Bierner bfc026b97a Drop into text editor api proposal (#143334)
* Add drop into editor api proposal

For #142990

* Use AsyncEmitter
2022-03-18 11:32:11 -07:00
Martin Aeschlimann 02e8bd149c Merge pull request #144759 from microsoft/aeschli/hcLightThemeKind
Add high contrast light theme kind
2022-03-16 16:41:22 +01:00
Alex Dima 947da6006f Add a .code property to undo redo elements (that is not localized) 2022-03-16 14:27:46 +01:00
Martin Aeschlimann 596181cb26 Merge branch 'main' into aeschli/hcLightThemeKind 2022-03-15 14:20:31 +01:00
David Dossett 0487dab71e Add .hc-light rules 2022-03-14 09:45:50 -07:00
Martin Aeschlimann 069f2085d8 fix tests 2022-03-09 15:20:15 +01:00
Alex Dima 41d5806cbf Fixes #144612: Avoid potentially unreliable offsetHeight 2022-03-08 21:43:35 +01:00
Alex Dima a2e8cd7f1c Allow passing in strings 2022-03-08 21:16:21 +01:00
Martin Aeschlimann 9245f60f40 Add hc light theme kind 2022-03-08 17:05:33 +01:00
Alex Dima b07d32cbe1 Adopt setPointerCapture in the editor content (#140101) 2022-03-04 15:57:46 +01:00
Alex Dima 888b21718a Adopt setPointerCapture in the minimap (#140101) 2022-03-02 20:18:00 +01:00
Alex Dima 3345f477f7 Adopt setPointerCapture in the scrollbar (#140101) 2022-03-02 18:32:43 +01:00
Alex Dima ed57930901 Debt: replace ViewLinesChangedEvent.toLineNumber with .count 2022-03-02 16:19:15 +01:00
Henning Dieterichs 6e624ded74 Fixes #132021 by introducing position affinity for widgets. 2022-02-28 14:11:21 +01:00