Dart lsp Server Configuration Bug or Help #7969
-
I'm trying to change the default dart lsp formatter line length from 80 (default) to 120. Sources:
Would lead me to believe that I can change the default I know my My [[language]]
name = "dart"
# formatter = { command = "format", args = [ "-l", "120"] } # I tried changing the format command, didn't work either
config = { lineLength = 120 }
# I tried all of these, refreshing the config each time, to no avail.
# config = { dart.lineLength = 120 }
# config = { "dart.lineLength" = 120 }
# config = { dartls.settings.dart.lineLength = 120 }
# config = { dart = { lineLength = 120 } }
# config = { settings = { dart = { lineLength = 120 } } }
# config = { dartls = { settings = { dart = { lineLength = 120 } } } } |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Only relevant Stack Overflow I could find, gave me the idea to try those other variations: link |
Beta Was this translation helpful? Give feedback.
-
Saw this, and there is a special |
Beta Was this translation helpful? Give feedback.
-
@nathananderson98 Late answer sorry, but in case it helps someone: The [language-server.dart]
config = { dart.lineLength = 120 } I may be wrong, but it seems to me that the formatting is faster when using the LSP rather than the custom |
Beta Was this translation helpful? Give feedback.
So I have achieved custom line length in dart using helix by specifying custom formatter that is actually
dart format
. I also couldn't force dart lsp to format with custom line length.I have added following text to my
~/.config/helix/languages.toml
:Funny thing is that
-l
or--line-length
is actually hidden parameter ofdart format
https://github.com/dart-lang/dart_style/pull/1147/files#diff-81a62ea70b958516746798f662af162668e50464f0faf9d076cc17e2c6e73bd3 and is not printed whendart format --help -v
.