If the user opens a ts file outside of any workspace, currently we may not send along a project root path to TS. This can result in extra projects being loaded
Instead we should tell TS about the current workspace we have opened
Fixes#235959
When pasting across files, sometimes users can see a spinner while we wait to see if TS has a `paste with imports` edit. This needs to be done even if we insert plain text by default so that we can then show the paste widget and user can select `paste with imports`
This change makes it so that if TS takes over 200ms, we assume that a paste operation may be available and return an unresolved edit for it. Only when the edit then actually needs to be applied, we wait for TS to respond
In most cases we won't need to wait because plain text will be pasted by default. Users will then only see the spinner after selecting `paste with imports`
Fixes#30066
This finalizes the documentPaste api. This api allows extensions to attach metadata on text copy and change how content is pasted. Some examples:
- Updating imports for pasted code
- Inserting an image as an attachment in notebooks
- Pasting files converts them to relative text paths
Currently `@example` produces Markdown code blocks for code examples,
but they are not annotated with a programming language. This commit
annotates those code blocks as `typescript`, allowing for better
highlighting for JS/TS when using Markdown renderers that recognize
these languages.
Makes it a simple array of kinds for now. We can add the mime type variation later if needed
Also makes the paste with imports have a better hierarchy. This lets you setup a keybinding for `text.updateImports` that will work across all languages that support it
Fixes#184871
For #30066
Adds new settings that let you configure the default way to paste/drop.
Also enables js/ts paste with imports by default for 5.7+. However will not apply by default. Instead it will be shown as an option after pasting. You can then use the `editor.pasteAs.preferences` setting to make it apply automatically or use the `javascript.updateImportsOnPaste.enabled` settings to disable the feature entirely
Almost none of the issues that come in through our `report issue` button are actionable. Previously more people were filling in the template and following up, but now very few do
So instead, I'm changing this to open a guide about the common causes of crashes and how to file a good issue report. This guide also focuses on helping people self-diagnose and fix problems