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

feat: allow using : or = as a delimiter #1

Merged
merged 1 commit into from Nov 9, 2022

Conversation

pgarciacamou
Copy link
Contributor

@pgarciacamou pgarciacamou commented Nov 8, 2022

This might not be what you want to do for this specific module, but I figured I would ask.

I changed the regular expression to look for anything that is not a space or ":" or "=", basically would work the same way but also would take into account keys that have dots or any other type of characters in the key, not only words:

Screenshots

BEFORE AFTER
Screen Shot 2022-11-08 at 1 13 29 PM Screen Shot 2022-11-08 at 1 11 07 PM
Screen Shot 2022-11-08 at 1 13 43 PM Screen Shot 2022-11-08 at 1 11 20 PM

Important

My only question is if patterns are applied as FIFO, in other words, if the first pattern matched a comment, will it just skip the rest, or will it also match for keyword.

This is because with my regular expression ^\s*([^\\s:=]+), this also matches a comment. It basically matches any characters after spaces and then stops if a space or ":" or "=" is found.

Edge cases

The only problem I see is edge cases like these where there is some manual word-wrap:

Screen Shot 2022-11-08 at 1 20 16 PM

@icetbr
Copy link
Owner

icetbr commented Nov 9, 2022

Hi, I think it makes sense for vscode to use FIFO, but it's just my guess. My config files are somewhat simple, your edge case doesn't seem to affect me.

If you or anyone come up with a better regex I'm all for it. And since your is more complete then mine, this seems a nice addition.

Thanks for your effort! I'll accept it and update tomorrow.

@icetbr icetbr merged commit e971382 into icetbr:main Nov 9, 2022
@pgarciacamou pgarciacamou deleted the feat-allow-delimiters-3 branch November 9, 2022 22:56
@pgarciacamou
Copy link
Contributor Author

Thanks @icetbr. I look forward to seeing the update live 🙌

@icetbr
Copy link
Owner

icetbr commented Nov 9, 2022

It's on!

@pgarciacamou
Copy link
Contributor Author

Works!

Screen Shot 2022-11-10 at 7 59 36 AM

Thanks!

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.

None yet

2 participants