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

Unusable when lib in subdir #9

Open
digicowsoftware opened this issue Feb 23, 2021 · 2 comments
Open

Unusable when lib in subdir #9

digicowsoftware opened this issue Feb 23, 2021 · 2 comments

Comments

@digicowsoftware
Copy link

digicowsoftware commented Feb 23, 2021

When the perl lib directory is in a subdirectory of the project (e.g., <root>/mojo/lib/...) this extension is not usable for inserting the package, even with a correct "before" regex.

I've tried:

"before": "^.*lib/{{name}}\\.pm"
"before": "^mojo/lib/{{name}}\\.pm"

And dozens of other permutations. In fact, I could even use something like "before": "ojo/lib/{{name}}\\.pm" and the extension inserts a package name that's correct, but with the unmatched leading "m" intact. However, when I add the "m" to the regex, or use any other regex that should work, the extension's replacement disappears entirely (no "package" entry on ctl-space, no package autocomplete)

@utgwkk
Copy link
Owner

utgwkk commented Mar 21, 2021

I couldn't reproduce the bug with perl-insert-package version 1.10.2. package Hoge::Fuga; is inserted for mojo/lib/Hoge/Fuga.pm

image

The content of .vscode/settings.json is following:

{
    "perl-insert-package.replaceRules": [
        {
            "before": "^mojo/lib/{{name}}\\.pm",
            "after": "{{package}}",
            "separator": "/"
        },
        {
            "before": "lib/{{name}}\\.pm",
            "after": "{{package}}",
            "separator": "/"
        },
    ]
}

@digicowsoftware
Copy link
Author

Thank you. Based on your investigation I did further testing and discovered that the problem only occurs when invoked remotely via the "Remote - SSH" extension of the "Remote Development" extension pack

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

No branches or pull requests

2 participants