-
Couldn't load subscription status.
- Fork 9
feat: Adding support for formatting #17
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
Conversation
WalkthroughThe changes integrate document formatting support into the LSP server. The server’s initialization now advertises formatting capabilities. New types have been introduced to handle formatting requests and responses, and a new method is added to process these requests. Additionally, some helper functions and function renames standardize responses. Finally, the message handler in the main file has been extended to parse and dispatch formatting requests. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Main
participant State
participant Formatter
Client->>Main: Send textDocument/formatting request (FormatRequest)
Main->>State: Call TextDocumentFormatting(logger, id, docURI)
State->>State: Retrieve configuration for the document
alt Configuration is valid
State->>Formatter: Format document (using hclwrite.Format)
else Configuration is nil
State->>State: Return an empty FormatResponse
end
State-->>Main: Return FormatResponse (with TextEdit result)
Main->>Client: Write response back
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🔇 Additional comments (9)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Closes #16
Summary by CodeRabbit