Skip to content

feat: add replace action to default Vale.Terms rule#993

Closed
wbh1 wants to merge 1 commit intovale-cli:v3from
wbh1:feat/vale-terms-replace
Closed

feat: add replace action to default Vale.Terms rule#993
wbh1 wants to merge 1 commit intovale-cli:v3from
wbh1:feat/vale-terms-replace

Conversation

@wbh1
Copy link

@wbh1 wbh1 commented Apr 7, 2025

This is useful for ensuring that Vocab terms get populated as quick fix/code action suggestions by the Vale Language Server.

This is useful for ensuring that Vocab terms get populated as quick
fix/code action suggestions by the Vale Language Server.
@jdkato
Copy link
Member

jdkato commented Apr 11, 2025

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.

@ccoVeille
Copy link
Contributor

ccoVeille commented Apr 11, 2025

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.
So maybe the feature idea could be kept by moving it somewhere else, no?

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".

@jdkato
Copy link
Member

jdkato commented Jun 4, 2025

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.
So maybe the feature idea could be kept by moving it somewhere else, no?

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).

@ccoVeille
Copy link
Contributor

I would love that, yes

@jdkato jdkato mentioned this pull request Jan 23, 2026
1 task
@jdkato
Copy link
Member

jdkato commented Jan 23, 2026

I'm going to try to get support for YAML-formatted vocabularies into the next release.

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.

3 participants