feat: add replace action to default Vale.Terms rule#993
feat: add replace action to default Vale.Terms rule#993wbh1 wants to merge 1 commit intovale-cli:v3from
Conversation
This is useful for ensuring that Vocab terms get populated as quick fix/code action suggestions by the Vale Language Server.
|
The reason why this wasn't added before is because vocabularies can (and often do) contain regex instead of words or phrases. In these cases, the suggestions won't make sense. |
|
Good point, indeed. This is the default rule, right? Would it be possible to add the replace action on some condition only? Like the words is only Unicode letters (naive idea for detection) for example. But then, I assume it wouldn't be there, but where the code detects the words is invalid. Another question, you said the vocabulary contains (often) regexp so it cannot be done with the way the author of the PR did. But I see the message field of the rule saying "use %s instead of %s" so I assume the word provided for the first %s is a valid word, that people would expect to see used with a "quick action". |
Yes -- honestly, I'd like to move vocabularies to YAML files as well. This would make them much more robust in many ways (comment handling, feature additions, conditional entries, etc). |
|
I would love that, yes |
|
I'm going to try to get support for YAML-formatted vocabularies into the next release. |
This is useful for ensuring that Vocab terms get populated as quick fix/code action suggestions by the Vale Language Server.