mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
@@ -84,6 +84,7 @@ function createInsertLinkEdit(activeEditor: vscode.TextEditor, selectedFiles: vs
|
|||||||
insertAsImage: insertAsImage,
|
insertAsImage: insertAsImage,
|
||||||
placeholderText: selectionText,
|
placeholderText: selectionText,
|
||||||
placeholderStartIndex: (i + 1) * selectedFiles.length,
|
placeholderStartIndex: (i + 1) * selectedFiles.length,
|
||||||
|
separator: insertAsImage ? '\n' : ' ',
|
||||||
});
|
});
|
||||||
|
|
||||||
return snippet ? new vscode.SnippetTextEdit(selection, snippet) : undefined;
|
return snippet ? new vscode.SnippetTextEdit(selection, snippet) : undefined;
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ interface UriListSnippetOptions {
|
|||||||
* If `undefined`, tries to infer this from the uri.
|
* If `undefined`, tries to infer this from the uri.
|
||||||
*/
|
*/
|
||||||
readonly insertAsImage?: boolean;
|
readonly insertAsImage?: boolean;
|
||||||
|
|
||||||
|
readonly separator?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createUriListSnippet(document: vscode.TextDocument, uris: readonly vscode.Uri[], options?: UriListSnippetOptions): vscode.SnippetString | undefined {
|
export function createUriListSnippet(document: vscode.TextDocument, uris: readonly vscode.Uri[], options?: UriListSnippetOptions): vscode.SnippetString | undefined {
|
||||||
@@ -93,8 +95,8 @@ export function createUriListSnippet(document: vscode.TextDocument, uris: readon
|
|||||||
|
|
||||||
snippet.appendText(`](${mdPath})`);
|
snippet.appendText(`](${mdPath})`);
|
||||||
|
|
||||||
if (i <= uris.length - 1 && uris.length > 1) {
|
if (i < uris.length - 1 && uris.length > 1) {
|
||||||
snippet.appendText(' ');
|
snippet.appendText(options?.separator ?? ' ');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return snippet;
|
return snippet;
|
||||||
|
|||||||
Reference in New Issue
Block a user