fix: make code actions follow formatter tag spacing#1089
Conversation
Code Review Summary✅ Overall AssessmentThis PR introduces a new 🔍 Issues Found1. Potential Breaking Change for Existing Users
2. Inconsistent Fallback Logic
3. Missing Test for Null Fallback
4. Documentation Ambiguity
✅ Positive Aspects
📋 SummaryThe changes are well-implemented and address a real user need. The main concerns are minor documentation clarity and test completeness. No security vulnerabilities or critical bugs were found. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new format.insertSpace configuration option and updates codeAction.insertSpace to be optional, allowing it to fall back to the global formatting setting. The built-in formatter now utilizes this configuration to determine whether to keep a space between --- and annotation tags. Additionally, the JSON schema and documentation have been updated to reflect these changes, and unit tests were added to ensure correct fallback logic and formatting behavior. I have no feedback to provide.
|
What is the difference between this option and space_between_tag_columns? Maybe my name isn't very appropriate, but it should be for this function. Edit: I reviewed the code again. If this configuration option is placed here, it seems it cannot be used with the external formatter, so is it really appropriate? |
16d2540 to
00a060c
Compare
|
You're right, sorry. I didn't look closely enough at what already existed.
I've revised the PR to remove the new formatter option. The remaining change only makes |
00a060c to
ef0bd2a
Compare
Make codeAction.insertSpace optional so generated diagnostic comments use the existing formatter tag spacing config unless explicitly overridden. Assisted-by: Codex
ef0bd2a to
9c1da2a
Compare
Problem
codeAction.insertSpaceis currently a boolean defaulting to false, so generated diagnostic comments cannot follow the formatter configured EmmyLua tag spacing.Solution
Make
codeAction.insertSpaceoptional. When omitted, generated diagnostic comments resolve the formatter config for the current file and useemmy_doc.space_between_tag_columns. ExplicitcodeAction.insertSpacestill overrides the formatter setting.Update the generated schema and config docs.