Skip to content

Commit

Permalink
fix (hx --health): Don't print headers in white (helix-editor#12355)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanas authored and julianbieber committed Feb 25, 2025
1 parent 35575b0 commit 4eed548
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ rustflags = ["--cfg", "tokio_unstable", "-C", "target-feature=-crt-static"]
xtask = "run --package xtask --"
integration-test = "test --features integration --profile integration --workspace --test integration"

[target.x86_64-unknown-linux-gnu]
rustflags = ["-Ctarget-cpu=native"]
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ lto = "fat"
codegen-units = 1
strip = true
opt-level = 3
cargo-features = ["build-std"]

[profile.integration]
inherits = "test"
Expand Down
1 change: 1 addition & 0 deletions helix-lsp/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ impl Client {
let cmd = helix_stdx::env::which(cmd)?;

let process = Command::new(cmd)
.current_dir(std::env::current_dir().unwrap())
.envs(server_environment)
.args(args)
.stdin(Stdio::piped())
Expand Down
63 changes: 31 additions & 32 deletions helix-term/src/keymap/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use helix_core::hashmap;

pub fn default() -> HashMap<Mode, KeyTrie> {
let normal = keymap!({ "Normal mode"
"h" | "left" => move_char_left,
"j" | "down" => move_visual_line_down,
"k" | "up" => move_visual_line_up,
"l" | "right" => move_char_right,
"ö" => move_char_left,
"ä" => move_visual_line_down,
"ü" => move_visual_line_up,
"#" => move_char_right,

"t" => find_till_char,
"f" => find_next_char,
Expand All @@ -20,8 +20,8 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
"A-." => repeat_last_motion,

"~" => switch_case,
"`" => switch_to_lowercase,
"A-`" => switch_to_uppercase,
"=" => switch_to_lowercase,
"A-=" => switch_to_uppercase,

"home" => goto_line_start,
"end" => goto_line_end,
Expand Down Expand Up @@ -85,14 +85,13 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
"S" => split_selection,
";" => collapse_selection,
"A-;" => flip_selections,
"A-o" | "A-up" => expand_selection,
"A-i" | "A-down" => shrink_selection,
"A-I" | "A-S-down" => select_all_children,
"A-p" | "A-left" => select_prev_sibling,
"A-n" | "A-right" => select_next_sibling,
"A-e" => move_parent_node_end,
"A-b" => move_parent_node_start,
"A-a" => select_all_siblings,
"up" => expand_selection,
"down" => shrink_selection,
"left" => select_prev_sibling,
"right" => select_next_sibling,

"%" => select_all,
"x" => extend_line_below,
Expand All @@ -107,7 +106,7 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
"a" => select_textobject_around,
"i" => select_textobject_inner,
},
"[" => { "Left bracket"
"j" => { "Left bracket"
"d" => goto_prev_diag,
"D" => goto_first_diag,
"g" => goto_prev_change,
Expand All @@ -121,7 +120,7 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
"p" => goto_prev_paragraph,
"space" => add_newline_above,
},
"]" => { "Right bracket"
"k" => { "Right bracket"
"d" => goto_next_diag,
"D" => goto_last_diag,
"g" => goto_next_change,
Expand Down Expand Up @@ -159,7 +158,7 @@ pub fn default() -> HashMap<Mode, KeyTrie> {

">" => indent,
"<" => unindent,
"=" => format_selections,
"`" => format_selections,
"J" => join_selections,
"A-J" => join_selections_space,
"K" => keep_selections,
Expand Down Expand Up @@ -196,10 +195,10 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
"F" => goto_file_vsplit,
"C-q" | "q" => wclose,
"C-o" | "o" => wonly,
"C-h" | "h" | "left" => jump_view_left,
"C-j" | "j" | "down" => jump_view_down,
"C-k" | "k" | "up" => jump_view_up,
"C-l" | "l" | "right" => jump_view_right,
"C-h" | "ö" | "left" => jump_view_left,
"C-j" | "ä" | "down" => jump_view_down,
"C-k" | "ü" | "up" => jump_view_up,
"C-l" | "#" | "right" => jump_view_right,
"L" => swap_view_right,
"K" => swap_view_up,
"H" => swap_view_left,
Expand Down Expand Up @@ -263,10 +262,10 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
"F" => goto_file_vsplit,
"C-q" | "q" => wclose,
"C-o" | "o" => wonly,
"C-h" | "h" | "left" => jump_view_left,
"C-j" | "j" | "down" => jump_view_down,
"C-k" | "k" | "up" => jump_view_up,
"C-l" | "l" | "right" => jump_view_right,
"C-ö" | "ö" | "left" => jump_view_left,
"C-ä" | "ä" | "down" => jump_view_down,
"C-ü" | "ü" | "up" => jump_view_up,
"C-#" | "#" | "right" => jump_view_right,
"H" => swap_view_left,
"J" => swap_view_down,
"K" => swap_view_up,
Expand Down Expand Up @@ -295,8 +294,8 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
"t" => align_view_top,
"b" => align_view_bottom,
"m" => align_view_middle,
"k" | "up" => scroll_up,
"j" | "down" => scroll_down,
"ü" => scroll_up,
"ä" => scroll_down,
"C-b" | "pageup" => page_up,
"C-f" | "pagedown" => page_down,
"C-u" | "backspace" => page_cursor_half_up,
Expand All @@ -312,8 +311,8 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
"t" => align_view_top,
"b" => align_view_bottom,
"m" => align_view_middle,
"k" | "up" => scroll_up,
"j" | "down" => scroll_down,
"ü" => scroll_up,
"ä" => scroll_down,
"C-b" | "pageup" => page_up,
"C-f" | "pagedown" => page_down,
"C-u" | "backspace" => page_cursor_half_up,
Expand All @@ -338,10 +337,10 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
});
let mut select = normal.clone();
select.merge_nodes(keymap!({ "Select mode"
"h" | "left" => extend_char_left,
"j" | "down" => extend_visual_line_down,
"k" | "up" => extend_visual_line_up,
"l" | "right" => extend_char_right,
"ö" => extend_char_left,
"ä" => extend_visual_line_down,
"ü" => extend_visual_line_up,
"#" => extend_char_right,

"w" => extend_next_word_start,
"b" => extend_prev_word_start,
Expand Down Expand Up @@ -389,8 +388,8 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
"tab" => smart_tab,
"S-tab" => insert_tab,

"up" => move_visual_line_up,
"down" => move_visual_line_down,
"A-ü" => move_visual_line_up,
"A-ä" => move_visual_line_down,
"left" => move_char_left,
"right" => move_char_right,
"pageup" => page_up,
Expand Down
49 changes: 42 additions & 7 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ glsl_analyzer = { command = "glsl_analyzer" }
graphql-language-service = { command = "graphql-lsp", args = ["server", "-m", "stream"] }
haskell-language-server = { command = "haskell-language-server-wrapper", args = ["--lsp"] }
hyprls = { command = "hyprls" }
glslls = { command = "glsl_analyzer", args = [] }
glslls-symbols = { command = "glsl_lsp", args = [] }
path-relative = { command = "path_lsp", args = [] }
idris2-lsp = { command = "idris2-lsp" }
intelephense = { command = "intelephense", args = ["--stdio"] }
jdtls = { command = "jdtls" }
Expand All @@ -65,8 +68,8 @@ ltex-ls-plus = { command = "ltex-ls-plus" }
markdoc-ls = { command = "markdoc-ls", args = ["--stdio"] }
markdown-oxide = { command = "markdown-oxide" }
marksman = { command = "marksman", args = ["server"] }
metals = { command = "metals", config = { "isHttpEnabled" = true, metals = { inlayHints = { typeParameters = {enable = true} , hintsInPatternMatch = {enable = true} } } } }
mesonlsp = { command = "mesonlsp", args = ["--lsp"] }
metals = { command = "run-metals", config = { "isHttpEnabled" = true, metals = { inlayHints = { typeParameters = {enable = true} , hintsInPatternMatch = {enable = true} } } } }
mint = { command = "mint", args = ["ls"] }
mojo-lsp = { command = "magic", args = ["run", "mojo-lsp-server"] }
nil = { command = "nil" }
Expand All @@ -85,7 +88,7 @@ perlnavigator = { command = "perlnavigator", args= ["--stdio"] }
pest-language-server = { command = "pest-language-server" }
prisma-language-server = { command = "prisma-language-server", args = ["--stdio"] }
purescript-language-server = { command = "purescript-language-server", args = ["--stdio"] }
pylsp = { command = "pylsp" }
pylsp = { command = "pylsp", args = ["-v", "--log-file", "pylsp.log"] }
pyright = { command = "pyright-langserver", args = ["--stdio"], config = {} }
basedpyright = { command = "basedpyright-langserver", args = ["--stdio"], config = {} }
pylyzer = { command = "pylyzer", args = ["--server"] }
Expand Down Expand Up @@ -133,6 +136,8 @@ helm_ls = { command = "helm_ls", args = ["serve"] }
ember-language-server = { command = "ember-language-server", args = ["--stdio"] }
teal-language-server = { command = "teal-language-server" }
wasm-language-tools = { command = "wat_server" }
latex_ls = { command = "/home/jbieber/.ltex-ls/bin/ltex-ls" }
gpt = { command = "helix-gpt", args = ["--handler", "copilot"] }

[language-server.ansible-language-server]
command = "ansible-language-server"
Expand Down Expand Up @@ -178,7 +183,8 @@ inlayHints.closureReturnTypeHints.enable = "with_block"
inlayHints.discriminantHints.enable = "fieldless"
inlayHints.lifetimeElisionHints.enable = "skip_trivial"
inlayHints.typeHints.hideClosureInitialization = false

workspace.symbol.search.limit = 256
workspace.symbol.search.kind = "all_symbols"

[language-server.typescript-language-server]
command = "typescript-language-server"
Expand Down Expand Up @@ -245,6 +251,23 @@ enable = true
[language-server.vscode-eslint-language-server.config.workingDirectory]
mode = "location"

[language-server.scls]
command = "simple-completion-language-server"

[language-server.scls.config]
max_completion_items = 20 # set max completion results len for each group: words, snippets, unicode-input
snippets_first = true # completions will return before snippets by default
feature_words = true # enable completion by word
feature_snippets = true # enable snippets
feature_unicode_input = true # enable "unicode input"
feature_paths = true # enable path completion


# write logs to /tmp/completion.log
[language-server.scls.environment]
RUST_LOG = "info,simple-completion-language-server=info"
LOG_FILE = "/tmp/completion.log"

[[language]]
name = "rust"
scope = "source.rust"
Expand All @@ -259,7 +282,7 @@ block-comment-tokens = [
{ start = "/**", end = "*/" },
{ start = "/*!", end = "*/" },
]
language-servers = [ "rust-analyzer" ]
language-servers = [ "rust-analyzer" ]
indent = { tab-width = 4, unit = " " }
persistent-diagnostic-sources = ["rustc", "clippy"]

Expand All @@ -269,6 +292,7 @@ persistent-diagnostic-sources = ["rustc", "clippy"]
'[' = ']'
'"' = '"'
'`' = '`'
'<' = '>'

[language.debugger]
name = "lldb-dap"
Expand Down Expand Up @@ -1116,7 +1140,7 @@ scope = "source.tex"
injection-regex = "tex"
file-types = ["tex", "sty", "cls", "Rd", "bbx", "cbx"]
comment-token = "%"
language-servers = [ "texlab" ]
language-servers = [ "texlab", "scls" ]
indent = { tab-width = 4, unit = "\t" }

[[grammar]]
Expand Down Expand Up @@ -1543,8 +1567,8 @@ file-types = ["glsl", "vert", "tesc", "tese", "geom", "frag", "comp" ]
comment-token = "//"
block-comment-tokens = { start = "/*", end = "*/" }
indent = { tab-width = 4, unit = " " }
language-servers = [ "glsl_analyzer" ]
injection-regex = "glsl"
language-servers = ["glslls", "glslls-symbols", "glsl_analyzer"]

[[grammar]]
name = "glsl"
Expand Down Expand Up @@ -1676,7 +1700,7 @@ scope = "source.md"
injection-regex = "md|markdown"
file-types = ["md", "livemd", "markdown", "mdx", "mkd", "mkdn", "mdwn", "mdown", "markdn", "mdtxt", "mdtext", "workbook", { glob = "PULLREQ_EDITMSG" }]
roots = [".marksman.toml"]
language-servers = [ "marksman", "markdown-oxide" ]
language-servers = [ "marksman", "markdown-oxide", "latex_ls", "scls" ]
indent = { tab-width = 2, unit = " " }
block-comment-tokens = { start = "<!--", end = "-->" }

Expand Down Expand Up @@ -1781,6 +1805,7 @@ comment-token = "#"
indent = { tab-width = 2, unit = " " }
rulers = [51, 73]
text-width = 72
language-servers = [ "scls" ]

[[grammar]]
name = "git-commit"
Expand Down Expand Up @@ -4164,6 +4189,16 @@ scope = "source.csv"
name = "csv"
source = { git = "https://github.com/weartist/rainbow-csv-tree-sitter", rev = "d3dbf916446131417e4c2ea9eb8591b23b466d27" }


[[language]]
name = "stub"
scope = "text.stub"
file-types = []
shebangs = []
roots = []
auto-format = false
language-servers = [ "scls" ]

[[language]]
name = "yara"
scope = "source.yara"
Expand Down
1 change: 1 addition & 0 deletions runtime/queries/scala/textobjects.scm
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@

; Test queries
; Not supported

63 changes: 63 additions & 0 deletions runtime/themes/my.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Author: NNB <nnbnh@protonmail.com>

"ui.menu" = { fg = "light-gray", bg = "gray" }
"ui.menu.selected" = { modifiers = ["reversed"] }
"ui.linenr" = { fg = "light-gray", bg = "black" }
"ui.popup" = { bg = "black" }
"ui.window" = { bg = "black" }
"ui.linenr.selected" = { fg = "white", bg = "black", modifiers = ["bold"] }
"ui.selection" = { fg = "gray", modifiers = ["reversed"] }
"comment" = { fg = "light-gray", modifiers = ["italic"] }
"ui.statusline" = { fg = "white", bg = "black" }
"ui.statusline.inactive" = { fg = "gray", bg = "black" }

"ui.help" = { fg = "white", bg = "black" }
"ui.cursor" = { fg = "white", modifiers = ["reversed"] }
"ui.cursor.primary" = { fg = "white", modifiers = ["reversed"] }
"ui.virtual" = "light-gray"
"variable" = "light-red"
"constant.numeric" = "yellow"
"constant" = "yellow"
"attributes" = "yellow"
"type" = "light-yellow"
"ui.cursor.match" = { fg = "light-yellow", modifiers = ["underlined"] }
"string" = "light-green"
"variable.other.member" = "light-green"
"constant.character.escape" = "light-cyan"
"function" = "light-blue"
"constructor" = "light-blue"
"special" = "light-blue"
"keyword" = "light-magenta"
"label" = "light-magenta"
"namespace" = "light-magenta"

"ui.statusline.normal" = { fg = "black", bg = "aqua" }
"ui.statusline.insert" = { fg = "black", bg = "orange" }
"ui.statusline.select" = { fg = "black", bg = "purple" }

"markup.heading" = "light-blue"
"markup.list" = "light-red"
"markup.bold" = { fg = "light-yellow", modifiers = ["bold"] }
"markup.italic" = { fg = "light-magenta", modifiers = ["italic"] }
"markup.link.url" = { fg = "yellow", modifiers = ["underlined"] }
"markup.link.text" = "light-red"
"markup.quote" = "light-cyan"
"markup.raw" = "light-green"

"diff.plus" = "light-green"
"diff.delta" = "yellow"
"diff.minus" = "light-red"

"diagnostic" = { modifiers = ["underlined"] }
"ui.gutter" = { bg = "black" }
"info" = "light-blue"
"hint" = "gray"
"debug" = "gray"
"warning" = "yellow"
"error" = "light-red"


[palette]
aqua = "#6fc3df"
purple = "#c586c0"
orange = "#f38518"
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.76.0"
channel = "1.81.0"
components = ["rustfmt", "rust-src", "clippy"]

0 comments on commit 4eed548

Please sign in to comment.