Skip to content

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

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

You must be logged in to vote

Edit 13/01/2025: A little change at backslash character to support multiple platform:

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

n…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
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