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

[feature request] linter plugin matches the file name when using domatch #3156

Open
taconi opened this issue Feb 28, 2024 · 0 comments · May be fixed by #3159
Open

[feature request] linter plugin matches the file name when using domatch #3156

taconi opened this issue Feb 28, 2024 · 0 comments · May be fixed by #3159

Comments

@taconi
Copy link
Contributor

taconi commented Feb 28, 2024

The default linter plugin has the domatch option:

should the filetype be interpreted as a lua pattern to match with the actual filetype ...

However, the default is based on the file type.

For example, if I wanted to create a lua pattern for files that end with .nelua I wouldn't be able to do so because there is no syntax for files with that extension and its buf:FileType() will be unknown. In this scenario, the match would be ('unknown'):match(v.filetype).

The suggestion would be to change the match to pattern lua to use regex using the regexp.MatchString function.
And that this match is already made in the name of the complete file.

I believe that the change in the code would be the import of the regex local regex = import(regex) and it is on line 118:

if v.domatch then
  ftmatch = regex.MatchString(v.filetype, buf.AbsPath)
end
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 a pull request may close this issue.

1 participant