Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple cursors and tab stops in snippets #212794

Closed
oddjones opened this issue May 15, 2024 · 3 comments
Closed

Multiple cursors and tab stops in snippets #212794

oddjones opened this issue May 15, 2024 · 3 comments
Assignees
Labels
info-needed Issue requires more information from poster snippets

Comments

@oddjones
Copy link

oddjones commented May 15, 2024

If I create a code snippet where I have the same field to be filled in at multiple locations, Like this example:

	"EAdisplayIf": {
		"scope": "json",
		"prefix": "EAdisplayIf",
		"body": [
			"\t\"displayIf\": {",
			"\t\t\"conditions\": [",
			"\t\t{",
			"\t\t\t\"name\": \"${1}\",",
			"\t\t\t\"journey\": \"${2}\",",
			"\t\t\t\"section\": \"${3}\",",
			"\t\t\t\"page\": \"${4}\",",
			"\t\t\t\"questionName\": \"${5}\",",
			"\t\t\t\"comparator\": \"${6}==\",",
			"\t\t\t\"value\": \"${7}\"",
			"\t\t\t},",
			"\t\t{",
			"\t\t\t\"name\": \"${8}\",",
			"\t\t\t\"journey\": \"${2}\",",
			"\t\t\t\"section\": \"${3}\",",
			"\t\t\t\"page\": \"${9}\",",
			"\t\t\t\"questionName\": \"${10}\",",
			"\t\t\t\"comparator\": \"${11}==\",",
			"\t\t\t\"value\": \"${12}\"",
			"\t\t\t},",
			"\t\t],",
			"\t\t\t\"operation\": \"${1} ${13}&& ${8}\"",
			"}",
		],
		"description": "DisplayIf snippet"
	},${0}

I'd like for the cursor to move through the snippet top-to-bottom. When it encounters multiple instances of the same tab stop (ie ${1}, ${2}, ${3}, ${8}) then it should create multiple cursors and allow text entry to complete each. When tab is next pressed, the editor should establish if there are one or more instances of the next tab-stop and either move a single cursor to the tab-stop or create multiple cursors.

At the moment what happens is that the cursor splits into multi cursors at ${1} and completes them correctly. Pressing tab moves the multi-cursors to ${2} and completes that correctly, however pressing tab at this point causes the cursors to simply move forwards a tab stop, breaking the code snippet

@VSCodeTriageBot
Copy link
Collaborator

Please diagnose the root cause of the issue by running the command F1 > Help: Troubleshoot Issue and following the instructions. Once you have done that, please update the issue with the results.

Happy Coding!

@VSCodeTriageBot VSCodeTriageBot added info-needed Issue requires more information from poster and removed ~confirmation-needed labels May 15, 2024
@jrieken
Copy link
Member

jrieken commented May 15, 2024

This work fine for me. Please with an empty profile to make sure no setting/extension is influencing this. Or update your steps with precise item outlining what you are doing

Screen.Recording.2024-05-15.at.13.49.18.mov

@VSCodeTriageBot
Copy link
Collaborator

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@VSCodeTriageBot VSCodeTriageBot closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster snippets
Projects
None yet
Development

No branches or pull requests

3 participants