Skip to content

Is there a way to create a snippet with an auto generated package path? #636

Answered by ylazy
ylazy asked this question in Q&A
Discussion options

You must be logged in to vote

Edit: 22/10/2024: The better solution:

	"New Public Class (Super Class)":
	{
		"prefix": "public.class",
		"body":
		[
			"package ${TM_DIRECTORY/(?:.*\\\\(?:src|root|packages|topLevel\\\\\\w+)(?:\\\\)?)|(\\\\)/${1:+.}/g}",
			"{",
				"\tpublic class ${TM_FILENAME_BASE}",
				"\t{${1}",
					"\t\tpublic function ${TM_FILENAME_BASE}(${2}):void",
					"\t\t{",
						"\t\t\t${3}",
					"\t\t}$0",
				"\t}",
			"}"
		],
		"description": "AS3: Create a new Public Class (Super Class)"
	},

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ylazy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant