-
Notifications
You must be signed in to change notification settings - Fork 187
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
feat: add path in ConformInfo #244
Conversation
Adding extra options for such niche setting doesn't sound right. How about using conceal? |
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.
Not sure what you mean with your question about formatter.type
I think it's fine to include the binary path all the time. No need for an option. The info panel should only be used for debugging, so it's fine if it's a little visually busy.
Couple changes requested, but generally on board with the approach
lua/conform/init.lua
Outdated
@@ -3,6 +3,7 @@ local M = {} | |||
---@class (exact) conform.FormatterInfo | |||
---@field name string | |||
---@field command string | |||
---@field path? string |
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.
We don't really need to add the path here, do we? We can just run exepath
from the info window where we need the full path
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.
Sorry made a mistake, I meant formatter.path
instead of type
but here you're answering my question.
Yeah, I think we don't. We only use path
in the info panel, so it can be produced there.
lua/conform/health.lua
Outdated
table.insert(highlights, { | ||
"DiagnosticInfo", | ||
#lines, | ||
formatter.name:len() + 7 + table.concat(filetypes, ", "):len() + 3, |
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.
Let's pull the table.concat(filetypes, ", ")
into a variable so we don't have to run it twice
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.
Will do
@stevearc I just squashed the requested changes into my commit. |
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.
One nit then LGTM!
lua/conform/health.lua
Outdated
table.insert(lines, line) | ||
table.insert( | ||
highlights, | ||
{ "DiagnosticInfo", #lines, formatter.name:len(), formatter.name:len() + 6 } | ||
) | ||
if path ~= nil then |
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.
vim.fn.exepath
never returns nil. If the executable is missing, it will return an empty string
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.
Oh right! Thanks for taking the time to review thoroughly
Great, thanks for the PR! |
Here is my draft for #225
2 questions:
formatter.type
being astring?
set asnil
when initialized?Any thoughts?