Skip to content

Conversation

@dirkrob78
Copy link

@dirkrob78 dirkrob78 commented Oct 28, 2025

At my work I'm working with a lot of custom EDA tools that have redundant filename patterns. So, backrefs in the file names would useful, at least for me! Please let me know what you think. I did a few manual tests to check for navigating and completion working on both Windows and Linux.

For paths with redundancy, capture the repeating part of the path. Any * or ** in the pattern creates a capture group, which can be repeated with {1}, {2}, {3}, etc. Also, adds support for multiple single * groups, and for * before **. Can support up to one **, and it groups all extra matches into it like "x/y/z".

Example .projections.json:

{
    "src/config/*/{1}.cfg": {
        "type": "config",
        "template": "# Configuration for {}\n# Add your config settings here\n"
    },
    "*/{1}/**/*/{3}.abc": {
        "type": "abc",
        "template": "# Abc for {}"
    },
    "**/*/{2}/*/{3}.bcd": {
        "type": "bcd",
        "template": "# Bcd for {}"
    }
}

Examples:
:Econfig tmp -> src/config/tmp/tmp.cfg
:Eabc a/c -> a/a/c/c.abc
:Eabc a/x/y/z/c -> a/a/x/y/z/c/c.abc

For paths with redundancy, capture the repeating part of the path. Any
* or ** in the pattern creates a capture group, which can be repeated with
{1}, {2}, {3}, etc.  Also, adds support for multiple single * groups, and for
* before **. Can support up to one **, and it groups all extra matches into it
like "x/y/z".

Examples
"*/{1}/**/*/{3}.abc" - matches a/a/c/c.abc, a/a/b/c/c.abc
"**/*/{2}/*/{3}.bcd" - matches c/c/d/d.bcd, x/y/z/c/c/d/d.bcd
"*/{1}/*/{2}/**/cde" - matches c/c/d/d/cde, c/c/d/d/x/y/z/cde
For paths with redundancy, capture the repeating part of the path. Any
* or ** in the pattern creates a capture group, which can be repeated with
{1}, {2}, {3}, etc.  Also, adds support for multiple single * groups, and for
* before **. Can support up to one **, and it groups all extra matches into it
like "x/y/z".

Examples
"*/{1}/**/*/{3}.abc" - matches a/a/c/c.abc, a/a/b/c/c.abc
"**/*/{2}/*/{3}.bcd" - matches c/c/d/d.bcd, x/y/z/c/c/d/d.bcd
"*/{1}/*/{2}/**/cde" - matches c/c/d/d/cde, c/c/d/d/x/y/z/cde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant