Commit Graph

12119 Commits

Author SHA1 Message Date
Johannes b1cbc57c61 Merge branch 'main' into joh/swc 2022-05-25 12:29:28 +02:00
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 0226ad3aa7 Fix drop data transfer overwriting everything with uri-list mime (#150319) 2022-05-24 23:02:04 +00:00
Logan Ramos d937389358 Add owners to all telemetry events (#150296) 2022-05-24 14:58:08 -04:00
Johannes dea356fa9c Merge branch 'main' into joh/swc 2022-05-24 16:10:18 +02: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
Johannes 8c1a962c4c Merge branch 'main' into joh/swc 2022-05-24 14:19:06 +02:00
Henning Dieterichs 753fc8a044 Fixes bracket fixing bug for inline completions. 2022-05-24 13:16:43 +02:00
Alexandru Dima faa736ed0e Fixes #150177: Extract LinePartMetadata to a separate file (#150259) 2022-05-24 12:22:02 +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
Johannes Rieken bd3977bec8 Merge pull request #150118 from pksunkara/main 2022-05-23 18:39:54 +02:00
Pavan Kumar Sunkara 89bff206a4 feat: inlay hints padding option 2022-05-23 16:28:24 +01:00
João Moreno ee7e39b672 Merge pull request #150004 from microsoft/sandy081/policy
Implement policies in VS Code
2022-05-23 16:15:01 +02:00
Johannes 8a27b48cff when temporarily showing/hiding inlay hints use the same "redraw range" that was used to compute inlays
We would get all inlay hints but update the visible ranges. This duplicates all inlays that are outside the ranges, fixes https://github.com/microsoft/vscode/issues/149572
2022-05-23 11:52:26 +02:00
Johannes 17f192d853 a bunch of ugly hacks to
1) remove cycling dependencies
2) avoid `export import`
2022-05-20 15:41:12 +02:00
Sandeep Somavarapu 078c77cf49 Merge branch 'main' into sandy081/policy 2022-05-20 10:15:27 +02:00
Alex Dima 0db3cee2a4 let -> const 2022-05-19 16:15:50 +02:00
Alexandru Dima 14925e336d Add a basic check (#149832)
* Add a basic check

* Fix yaml error

* Another attempt to fix the yaml

* update actions versions

* let -> const

* Add hygiene and layering check

* update name
2022-05-19 11:18:22 +02:00
Joao Moreno ffb7b00100 Merge commit 'ae2202631366eea0aaed6f881f87c2b44ae1b647' into sandy081/policy 2022-05-18 20:12:22 +02: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
Johannes 30f5b296ab make getWordAtText-config configurable and use lower budget for speedy tests 2022-05-17 16:53:50 +02: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 c77e9a64e9 Fixes #149412: Validate that semantic tokens edits reference valid offsets (#149448) 2022-05-13 13:10:19 +02:00
Johannes Rieken 8bbbbc2e3e Merge pull request #149430 from microsoft/joh/fashionable-worm 2022-05-13 12:42:55 +02:00
Johannes b25b6dade8 snippet completion provide shouldn't rely on word at position but use actual choice range, fixes https://github.com/microsoft/vscode/issues/148976 2022-05-13 10:17:59 +02:00
Johannes aa706918c1 only match against notebook uri when document selector specificies notebook type, fixes https://github.com/microsoft/vscode/issues/149363 2022-05-13 09:29:57 +02:00
Sandeep Somavarapu 5eb8bee367 Merge branch 'main' into sandy081/policy 2022-05-13 08:39:05 +02:00
Johannes Rieken 4aa56a627e Merge pull request #149375 from microsoft/joh/notable-chinchilla 2022-05-12 22:16:51 +02:00
Johannes 7f3b000833 * make ILayoutService#offset return general top and specific quickPickTop
* improve ergonomics of `ILayoutService#offset`
* Use new `quickPickTop` to overlay title bar part when title menu is enabled
* hide title menu whenever quick pick shows to avoid unwanted overlap
* extract title menu into its own file
2022-05-12 17:50:15 +02:00
Alexandru Dima 517d9cfc30 Fixes #148349: Extract viewport start properties to a separate class (#149350) 2022-05-12 14:49:55 +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
Alexandru Dima 8fb2dc9c2a Add high contrast light theme on monaco editor (#149165)
* Register light HC theme

* Do not always use black HC theme

Co-authored-by: Loïc Mangeonjean <loic@codingame.com>
2022-05-10 08:21:55 -07:00
Alexandru Dima e5b5dc2417 Merge pull request #148777 from CodinGame/add-get-editors-api
Add editor monitoring methods in monaco api
2022-05-10 16:24:45 +02:00
Alexandru Dima 9a1e8d12fb Fixes #148256: \t should jump to next indent tab stop and not just add the tab width (#149164) 2022-05-10 16:18:43 +02:00
Alexandru Dima ae7d4f417a Fixes #148893: Use the change accessor pattern to avoid leaking decorations via deltaDecorations (#149161) 2022-05-10 13:08:07 +00:00
Alexandru Dima 14feeed565 Add logging when deltaDecorations ends up recursing (#148423 #148893) (#149160) 2022-05-10 15:04:47 +02:00
Sandeep Somavarapu e4c04ea2e9 - Introduce policy model with file policy
- Introduce policy configuration using policy model
- Use policy configuration while reading, inspecting and writing configuration
- Adopt json settings editor
2022-05-10 13:49:31 +02:00
Connor Peet a365dbaf5c feat: allow using formatting parts in the workplace suffix (#148850)
* feat: allow using formatting parts in the workplace suffix

* Revert "feat: allow using formatting parts in the workplace suffix"

This reverts commit a228e03ad6.

* feat: cache label formatters

* fix: tests
2022-05-09 13:11:24 -07:00
Alexandru Dima ca48cde75b Fix inefficient regular expression (#149099) 2022-05-09 15:46:00 +00:00
Alex Ross 02b59c6e3a Comments widget doesn't reveal nicely (#148897)
Fixes #148774
2022-05-06 15:18:01 +02:00
Johannes Rieken 643c64e7b9 Merge branch 'main' into joh/primitiveContext 2022-05-05 16:26:07 +02:00
Alexandru Dima 1494660693 Merge pull request #148772 from microsoft/alex/148651
More strict validation for semantic tokens
2022-05-05 16:00:02 +02:00
Johannes Rieken 7d98054e0c Merge pull request #148773 from microsoft/joh/quickSuggestConfig 2022-05-05 15:07:25 +02:00
Alex Dima 539a0003bc let -> const 2022-05-05 11:11:24 +02:00