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

Add an option to use regular expressions for keywords #100

Merged
merged 3 commits into from
Jun 29, 2020
Merged

Add an option to use regular expressions for keywords #100

merged 3 commits into from
Jun 29, 2020

Conversation

ouuan
Copy link
Contributor

@ouuan ouuan commented Jun 28, 2020

It's useful for some complicated syntax.

It's optional and disabled by default so that it's compatible with old voice packages.

@SaekiRaku
Copy link
Owner

Hi, thanks for your PR! The property of regexpchanges the whole keywords behaviour, it will cause some duplicated configuration if someone wants to use both regexp and the regular way. I'm thinking it may be better to use regexp as keywords too, like this:

{
    "keywords": [  "...", "..."  ],
    "regexp": [ "...", "..." ]
}

Could you please change this?

@ouuan
Copy link
Contributor Author

ouuan commented Jun 29, 2020

Hi, thanks for your PR! The property of regexpchanges the whole keywords behaviour, it will cause some duplicated configuration if someone wants to use both regexp and the regular way. I'm thinking it may be better to use regexp as keywords too, like this:

{
    "keywords": [  "...", "..."  ],
    "regexp": [ "...", "..." ]
}

Could you please change this?

OK.

@ouuan
Copy link
Contributor Author

ouuan commented Jun 29, 2020

I found that if there are more matches, there will be more candidates, is this expected? Or was the keywords expected to be unique so that only one keyword is matched each time?

@SaekiRaku
Copy link
Owner

SaekiRaku commented Jun 29, 2020

It's unexpected and it seems like a BUG, but on other hands, the more candidates mean the more keywords were matched. And the right voice will have a greater probability to be played. It's harmless for users, so we can leave it be and see what is going. If it leads to a new BUG, we can fix it later.

@ouuan
Copy link
Contributor Author

ouuan commented Jun 29, 2020

Now the margin is incorrect if there are only regexps 🤔

@SaekiRaku SaekiRaku merged commit 77f69a8 into SaekiRaku:master Jun 29, 2020
@SaekiRaku
Copy link
Owner

SaekiRaku commented Jun 29, 2020

Thanks for your contributes!

@SaekiRaku
Copy link
Owner

A new version has released to VSCode Marketplace. Thanks again!

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.

2 participants