Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Bierner <matb@microsoft.com>2022-06-09 00:44:28 +0300
committerGitHub <noreply@github.com>2022-06-09 00:44:28 +0300
commitd7c90c2b2b82df0325cd8e947f7395510b632882 (patch)
tree8c4746b3161e27fc14390a0a609cf1165a6c9b79 /extensions
parent83b94a5c0303163f13516b8e13ce2261c00830d6 (diff)
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
Diffstat (limited to 'extensions')
-rw-r--r--extensions/markdown-language-features/src/languageFeatures/dropIntoEditor.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/extensions/markdown-language-features/src/languageFeatures/dropIntoEditor.ts b/extensions/markdown-language-features/src/languageFeatures/dropIntoEditor.ts
index b451ea40a4e..01daa70085f 100644
--- a/extensions/markdown-language-features/src/languageFeatures/dropIntoEditor.ts
+++ b/extensions/markdown-language-features/src/languageFeatures/dropIntoEditor.ts
@@ -25,16 +25,15 @@ const imageFileExtensions = new Set<string>([
export function registerDropIntoEditor(selector: vscode.DocumentSelector) {
return vscode.languages.registerDocumentOnDropEditProvider(selector, new class implements vscode.DocumentOnDropEditProvider {
- async provideDocumentOnDropEdits(document: vscode.TextDocument, position: vscode.Position, dataTransfer: vscode.DataTransfer, token: vscode.CancellationToken): Promise<vscode.SnippetTextEdit | undefined> {
+ async provideDocumentOnDropEdits(document: vscode.TextDocument, _position: vscode.Position, dataTransfer: vscode.DataTransfer, token: vscode.CancellationToken): Promise<vscode.DocumentDropEdit | undefined> {
const enabled = vscode.workspace.getConfiguration('markdown', document).get('editor.drop.enabled', true);
if (!enabled) {
return undefined;
}
- const replacementRange = new vscode.Range(position, position);
const snippet = await tryGetUriListSnippet(document, dataTransfer, token);
if (snippet) {
- return new vscode.SnippetTextEdit(replacementRange, snippet);
+ return { insertText: snippet };
}
return undefined;
}