Skip to content

Move completion handler into Rego router#1699

Merged
anderseknert merged 1 commit intoopen-policy-agent:mainfrom
anderseknert:integrate-completions
Sep 29, 2025
Merged

Move completion handler into Rego router#1699
anderseknert merged 1 commit intoopen-policy-agent:mainfrom
anderseknert:integrate-completions

Conversation

@anderseknert
Copy link
Copy Markdown
Member

Although many completion providers have been Rego based since a long time back, these providers used their own input format, and a separate prepared query — not at all integrated with other Rego handlers. No more! All completion providers are now 100% Rego-based, and use the same Rego router entrypoint as all other Rego handlers. Since the input format now mirrors what the LSP client sends, a whole lot of tests had to be updated.

Also the usual style fixes here and there.. although I tried to show some restraint :)

Comment thread internal/lsp/server.go
return inlayhint.FromModule(module, bis), nil
}

func (l *LanguageServer) handleTextDocumentCompletion(ctx context.Context, params types.CompletionParams) (any, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Copy link
Copy Markdown
Member Author

@anderseknert anderseknert Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up next is the rest of the text document handlers. But first, we feast! 🎉

Although many completion providers have been Rego based since
a long time back, these providers used their own input format,
and a separate prepared query — not at all integrated with other Rego
handlers. No more! All completion providers are now 100%
Rego-based, and use the same Rego router entrypoint as all other
Rego handlers. Since the input format now mirrors what the LSP
client sends, a whole lot of tests had to be updated.

Also the usual style fixes here and there.. although I tried to
show some restrain :)

Signed-off-by: Anders Eknert <anders@eknert.com>
@anderseknert anderseknert enabled auto-merge (squash) September 29, 2025 16:31
@anderseknert anderseknert merged commit 1685bb8 into open-policy-agent:main Sep 29, 2025
8 checks passed
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