Skip to content

Commit

Permalink
Merge pull request #14 from Rudxain/lsp
Browse files Browse the repository at this point in the history
`hx` LSP changes
  • Loading branch information
Rudxain authored Jul 16, 2024
2 parents cebd77b + 14042b2 commit eedad88
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 30 deletions.
76 changes: 46 additions & 30 deletions .config/helix/languages.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
[[language]]
name = "bash" # and POSIX sh
name = "toml"
formatter = { command = "taplo", args = ["fmt", "-"] }
auto-format = true

[[language]]
# um, actually 🤓,
# I'd just like to interject for a moment.
# What you're refering to as "Bash", is in fact, POSIX/Ksh/Dash/Bash/Zsh/Fish,
# or as I've recently taken to calling it, *sh.
# Bash is a shell, but it's just one of many shells supported by "Bash-LSP",
#
# Many computer users run a modified version of the POSIX shell (such as Dash)
# every day, without realizing it.
# Through a peculiar turn of events,
# the version of POSIX-sh which is widely used today is often called "Bash",
# and many of its users are not aware that it is basically the POSIX-sh.
#
# There really is a Bash, and some people are using it,
# but it is just one shell among many.
name = "bash"
indent = { tab-width = 4, unit = "\t" }

[[language]]
name = "python"
language-servers = [ "pyright" ]
language-servers = ["pyright"]

[[language]]
name = "markdown"
Expand All @@ -13,54 +32,51 @@ indent = { tab-width = 4, unit = "\t" }

[[language]]
name = "html"
indent = { tab-width = 4, unit = "\t" }
indent = { tab-width = 3, unit = "\t" }

[[language]]
name = "css"
indent = { tab-width = 4, unit = "\t" }
indent = { tab-width = 3, unit = "\t" }

[[language]]
name = "json"
indent = { tab-width = 3, unit = "\t" }
auto-format = false

[language-server.vscode-json-language-server.config]
provideFormatter = true
[language-server.vscode-json-language-server.config.json]
validate.enable = true
format.enable = true
keepLines.enable = true

[[language]]
name = "javascript"
language-servers = ["typescript-language-server", "eslint"]
language-servers = [
"typescript-language-server",
"vscode-eslint-language-server",
]
indent = { tab-width = 4, unit = "\t" }
auto-format = true

[[language]]
name = "typescript"
language-servers = ["typescript-language-server", "eslint"]
language-servers = [
"typescript-language-server",
"vscode-eslint-language-server",
]
indent = { tab-width = 4, unit = "\t" }
auto-format = true

[language-server.eslint]
command = "vscode-eslint-language-server"
args = ["--stdio"]
[language-server.eslint.config]
validate = "on"
experimental = { useFlatConfig = false }
rulesCustomizations = []
run = "onType" # is there `onSave`?
problems = { shortenToSingleLine = false }
nodePath = ""
[language-server.eslint.config.codeAction]
[language-server.eslint.config.codeAction.disableRuleComment]
enable = true
location = "separateLine"
[language-server.eslint.config.codeAction.showDocumentation]
enable = true
[language-server.eslint.config.codeActionOnSave]
[language-server.vscode-eslint-language-server.config.codeActionOnSave]
enable = true
mode = "fixAll"
[language-server.eslint.config.workingDirectory]
mode = "location"

# `indent` controlled by `rustfmt`
[language-server.rust-analyzer.config.check]
command = "clippy"

[[language]]
name = "toml"
formatter = { command = "taplo", args = ["fmt", "-"] }

[[language]]
name = "go"
formatter.command = "goimports"
auto-format = true
formatter = { command = "goimports" }
2 changes: 2 additions & 0 deletions .config/taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[formatting]
align_comments = false
2 changes: 2 additions & 0 deletions .sh/exports
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ export NODE_REPL_MODE=strict
# Helix
export EDITOR=hx
#export VISUAL= # ???

export TAPLO_CONFIG="$HOME/.config/taplo.toml"

0 comments on commit eedad88

Please sign in to comment.