Closed javoscript closed 2 weeks ago
Open the branch in Web Editor • VS Code • Insiders
Open Preview
Your free trial has expired. To keep using Ellipsis, sign up at https://app.ellipsis.dev for $20/seat/month or reach us at help@ellipsis.dev
Latest commit: a94408cd675bae7141d89c2f20ed5daed4560ff0
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The changes enhance the XML formatting capabilities in the Neovim plugin setup using hurl.nvim
. New configurations for XML formatting using the tidy
command were introduced, along with adjustments to the response handling logic to include XML responses. This improvement allows for better handling and formatting of XML content within the Neovim editor.
Files | Change Summaries |
---|---|
README.md | Added XML formatting configuration using tidy with options '-xml' , '-i' , '-q' . |
doc/hurl.nvim.txt | Added XML configuration block with formatting options using tidy . |
lua/hurl/history.lua | Added conditional branch to check and handle XML content type separately. |
lua/hurl/init.lua | Introduced new configuration option for XML with specific tidy arguments. |
lua/hurl/main.lua | Updated logic to handle XML responses separately based on content type. |
lua/hurl/popup.lua | Expanded type parameter options in M.show function to include 'xml' . |
lua/hurl/split.lua | Expanded type parameter options in M.show function to include 'xml' . |
lua/hurl/utils.lua | Added XML handling to util.format and new function util.is_xml_response . |
sequenceDiagram
participant User
participant Neovim
participant Plugin as hurl.nvim
participant Formatter as tidy
User->>Neovim: Open XML file
Neovim->>Plugin: Request to format XML
Plugin->>Formatter: Execute tidy with -xml, -i, -q
Formatter->>Plugin: Formatted XML
Plugin->>Neovim: Display formatted XML
Neovim->>User: Show formatted XML
In Neovim's quiet night,
XML shines so bright,
Withtidy
's gentle touch,
Formatting we love so much.
hurl
now so wise and spry,
Handles XML on the fly.
Coders cheer, reaching high! 🌟🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@all-contributors add @javoscript for code.
@jellydn
I've put up a pull request to add @javoscript! :tada:
WHAT
Add support for XML response content types.
WHY
Though not as common as HTML or JSON APIs, XML is still widely used.
Handling it as generic
text
works currently, but no response formatting or syntax highlighting is being done.HOW
Adding the relevant function
utils.is_xml_response(content_type)
and type handling for formatting (withtidy
command) and syntax highlighting the response.Probably a more generic and extensible way of allowing plugin users to configure custom formatting commands for different response types would be better. But, in this case I didn't want to change too much the internal logic of the plugin, just add support for XML.
Screenshots (if appropriate):
A formatted and syntax highlighted response example:
Types of changes
Checklist:
Summary by CodeRabbit
New Features
tidy
for improved XML parsing and display.Improvements
show
function to support displaying XML responses alongside existing JSON, HTML, and text formats.