Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
findMatchingSnippetDefinitionStrict,
transformSnippetVariables,
} from "../snippetsLegacy/snippet";
import { showLegacySnippetsNotification } from "./legacySnippetsNotification";
import { textFormatters, type TextFormatterName } from "./textFormatters";

export default class InsertSnippetLegacy {
Expand Down Expand Up @@ -95,6 +96,8 @@ export default class InsertSnippetLegacy {
destinations: Destination[],
snippetDescription: NamedInsertSnippetArg,
): Promise<ActionReturnValue> {
showLegacySnippetsNotification();

const editor = ide().getEditableTextEditor(
ensureSingleEditor(destinations),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
findMatchingSnippetDefinitionStrict,
transformSnippetVariables,
} from "../snippetsLegacy/snippet";
import { showLegacySnippetsNotification } from "./legacySnippetsNotification";

export default class WrapWithSnippetLegacy {
private snippetParser = new SnippetParser();
Expand Down Expand Up @@ -81,6 +82,8 @@ export default class WrapWithSnippetLegacy {
targets: Target[],
snippetDescription: NamedWrapWithSnippetArg,
): Promise<ActionReturnValue> {
showLegacySnippetsNotification();

const editor = ide().getEditableTextEditor(ensureSingleEditor(targets));

const body = this.getBody(snippetDescription, targets);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { showWarning } from "@cursorless/common";
import { ide } from "../../singletons/ide.singleton";

// Show only once per vscode instance
let wasShown = false;

export function showLegacySnippetsNotification() {
if (wasShown) {
return;
}

void showWarning(
ide().messages,
"legacySnippets",
"Talon community snippets are now fully supported in Cursorless! Cursorless's experimental snippets are now deprecated, but in most cases we can help you migrate automatically. Update cursorless-talon and say 'cursorless migrate snippets'.",
);

wasShown = true;
}
Loading