8000 feat(repl): Autocomplete for REPL directives, and a small fix for filenames by tcolgate · Pull Request #2169 · cerbos/cerbos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(repl): Autocomplete for REPL directives, and a small fix for filenames #2169

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

Merged
merged 2 commits into from
May 31, 2024

Conversation

tcolgate
Copy link
Contributor

Description

There are two commits here, but one is a simple one liner.

  • fix :load with a plain filename, these were rejected by the parser as they were treated as identifiers
  • adds some autocomplete support for : directives:
    • :... get completed with directives
    • :load completes filenames
    • :let completes variables
    • :exec completes rule numbers

@tcolgate tcolgate changed the title feat(repl): autocomplete for repl directives, and a small fix for filenames feat(repl): Autocomplete for REPL directives, and a small fix for filenames May 29, 2024
Signed-off-by: Tristan Colgate-McFarlane <tristan@cerbos.dev>
@tcolgate tcolgate force-pushed the replfun branch 2 times, most recently from 51cd52d to 3bb654c Compare May 30, 2024 12:54
@tcolgate tcolgate marked this pull request as ready for review May 30, 2024 12:54
@tcolgate
Copy link
Contributor Author

Added tests

@tcolgate tcolgate requested review from oguzhand95 and charithe May 30, 2024 13:24
Copy link
Contributor
@charithe charithe left a comment

Choose a reason for hiding this comment

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

Very cool! Left a couple of suggestions below. LGTM otherwise.

charithe
charithe previously approved these changes May 31, 2024
This PR adds some basic autocompletion for the `:` CLI directives
It does not attempt to autocomplete vanilla expressions.

Signed-off-by: Tristan Colgate-McFarlane <tristan@cerbos.dev>
@oguzhand95 oguzhand95 self-requested a review May 31, 2024 12:41
@tcolgate tcolgate merged commit f2ad52f into cerbos:main May 31, 2024
22 checks passed
@tcolgate tcolgate deleted the replfun branch June 3, 2024 08:27
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
0