-
Notifications
You must be signed in to change notification settings - Fork 132
Configuring shfmt
#1246
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
Comments
I found out I could use settings = {
bashIde = {
shfmt = {
languageDialect = "auto",
simplifyCode = true,
caseIndent = true,
},
},
}, But indentation is not set correctly: I have my editor set to use 4 spaces for indentation, and my scripts get reformatted to use 8 spaces instead... |
Yes, setting options via LSP server config options would be my recommendation as it is the most configurable. The exception is indentation. Indentation always comes from the client via the language server. If you're seeing 8-space indents, then that is what the client is sending through when requesting document formatting (the default is to use tabs, so the client must have explicitly requested 8-space indents). Perhaps some experimentation to understand behaviour might be a good place to start? For example, what if you set your editor to 3-space indents - does that result in 6-space indents, or do you get 8-space regardless? I think I'd need to see a capture of the messages between your client and the server in order to see where the problem lies, and I'm not sure I can help you with how to do that for your particular client. |
It looks like the server must be sending tabs, and my editor is expending them to spaces:
|
I think it might actually be an issue with the format-on-save plug-in that I've been using, see lukas-reineke/lsp-format.nvim/issues/94. |
Code editor
NeoVim
Platform
Linux (NixOS)
Version
5.4.0
What steps will reproduce the bug?
There's no "Discussion" template, this isn't really a bug, just a question.
The documentation states:
I'm not sure I understand how I can configure
shfmt
the way I used to when I ran it standalone in my editor (-i 4 -s -ci
). The README mentions EditorConfig, but that doesn't give me a global configuration, and is less convenient than relying on my default configuration for random files.How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
No response
What do you see instead?
N/A
Additional information
No response
The text was updated successfully, but these errors were encountered: