-
Notifications
You must be signed in to change notification settings - Fork 35
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
lsp: Provide data ref completions in rules #769
Conversation
Fixes: StyraInc#753 Signed-off-by: Charlie Egan <charlie@styra.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! 👏
// we are not interested in packages here, only the rules | ||
for uri, refs := range c.GetAllFileRefs() { | ||
for _, ref := range refs { | ||
// we are not interested in packages here, only rules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there are a few cases where you might want to refer to a package even in a rule body, like when doing dynamic policy composition:
some policy
some decision in data.policies[policy].deny
and so on... but I guess that's uncommon enough that it's still better to only suggest rules as a default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that is a thought. I guess this provide is called rulers and is already quite complex. I'd like to consider that for a new provider.
Issue here: #771
symbol = completion.Function | ||
detail = "Function" | ||
case ref.Description == "Partial": | ||
detail = "Partial path suggestion, continue typing for more suggestions." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool!
Fixes: StyraInc#753 Signed-off-by: Charlie Egan <charlie@styra.com>
Fixes: #753
Screen.Recording.2024-05-29.at.12.17.08.mov