-
Notifications
You must be signed in to change notification settings - Fork 4
Add WARNING block code completion for Asciidoc #47
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
Add WARNING block code completion for Asciidoc #47
Conversation
Added code completion template for WARNING admonition blocks in the AsciiDoc LSP server. When users type "WA" and press CTRL+Space, they will now see a completion option that inserts: [WARNING] ==== *CURSOR HERE* ==== The cursor will be positioned inside the block for immediate content entry.
Summary of ChangesHello @vogella, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the AsciiDoc Language Server Protocol (LSP) by introducing a convenient code completion snippet for Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request adds a code completion snippet for Asciidoc's [WARNING] admonition block. The implementation is straightforward and follows existing patterns in the file. My review identifies one issue where the completion may not be triggered as described in the pull request. I've provided a suggestion to align the implementation with the intended behavior.
| items.add(include); | ||
|
|
||
| // WARNING admonition block | ||
| CompletionItem warning = new CompletionItem("[WARNING]"); |
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.
The completion item label "[WARNING]" does not align with the goal of triggering this completion by typing WA, as described in the pull request. The server filters completions by checking if the label starts with the typed text. With "[WARNING]" as the label, a user would need to type [ or [W to trigger this completion, not WA.
To fix this and match the intended behavior, the label should be "WARNING". The insertText property will still correctly insert the full [WARNING] block.
| CompletionItem warning = new CompletionItem("[WARNING]"); | |
| CompletionItem warning = new CompletionItem("WARNING"); |
Changed the completion item label from "[WARNING]" to "WARNING" so that typing "WA" will correctly trigger the completion. The insertText still contains the full [WARNING] block syntax, but the label is now properly filtered by the prefix matching logic.
Added code completion template for WARNING admonition blocks in the AsciiDoc LSP server. When users type "WA" and press CTRL+Space, they will now see a completion option that inserts:
[WARNING]
CURSOR HERE
The cursor will be positioned inside the block for immediate content entry.