Merge branch 'helix-editor:master' into scroll_preview_fixed

pull/11441/head
Shaun_Sheep 2 months ago committed by GitHub
commit de73b1accf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install nix - name: Install nix
uses: cachix/install-nix-action@V27 uses: cachix/install-nix-action@V28
- name: Authenticate with Cachix - name: Authenticate with Cachix
uses: cachix/cachix-action@v15 uses: cachix/cachix-action@v15

16
Cargo.lock generated

@ -68,9 +68,9 @@ dependencies = [
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.87" version = "1.0.89"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6"
[[package]] [[package]]
name = "arc-swap" name = "arc-swap"
@ -136,9 +136,9 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.1.18" version = "1.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" checksum = "2d74707dde2ba56f86ae90effb3b43ddd369504387e718014de010cec7959800"
dependencies = [ dependencies = [
"shlex", "shlex",
] ]
@ -1972,9 +1972,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "0.38.36" version = "0.38.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"errno", "errno",
@ -2401,9 +2401,9 @@ dependencies = [
[[package]] [[package]]
name = "unicode-segmentation" name = "unicode-segmentation"
version = "1.11.0" version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
[[package]] [[package]]
name = "unicode-width" name = "unicode-width"

@ -163,7 +163,7 @@
| protobuf | ✓ | ✓ | ✓ | `bufls`, `pb` | | protobuf | ✓ | ✓ | ✓ | `bufls`, `pb` |
| prql | ✓ | | | | | prql | ✓ | | | |
| purescript | ✓ | ✓ | | `purescript-language-server` | | purescript | ✓ | ✓ | | `purescript-language-server` |
| python | ✓ | ✓ | ✓ | `pylsp` | | python | ✓ | ✓ | ✓ | `ruff`, `jedi-language-server`, `pylsp` |
| qml | ✓ | | ✓ | `qmlls` | | qml | ✓ | | ✓ | `qmlls` |
| r | ✓ | | | `R` | | r | ✓ | | | `R` |
| racket | ✓ | | ✓ | `racket` | | racket | ✓ | | ✓ | `racket` |

@ -22,7 +22,7 @@ helix-loader = { path = "../helix-loader" }
ropey = { version = "1.6.1", default-features = false, features = ["simd"] } ropey = { version = "1.6.1", default-features = false, features = ["simd"] }
smallvec = "1.13" smallvec = "1.13"
smartstring = "1.0.1" smartstring = "1.0.1"
unicode-segmentation = "1.11" unicode-segmentation = "1.12"
# unicode-width is changing width definitions # unicode-width is changing width definitions
# that both break our logic and disagree with common # that both break our logic and disagree with common
# width definitions in terminals, we need to replace it. # width definitions in terminals, we need to replace it.

@ -846,7 +846,15 @@ impl Application {
} }
} }
Notification::ShowMessage(params) => { Notification::ShowMessage(params) => {
log::warn!("unhandled window/showMessage: {:?}", params); if self.config.load().editor.lsp.display_messages {
match params.typ {
lsp::MessageType::ERROR => self.editor.set_error(params.message),
lsp::MessageType::WARNING => {
self.editor.set_warning(params.message)
}
_ => self.editor.set_status(params.message),
}
}
} }
Notification::LogMessage(params) => { Notification::LogMessage(params) => {
log::info!("window/logMessage: {:?}", params); log::info!("window/logMessage: {:?}", params);
@ -930,7 +938,7 @@ impl Application {
self.lsp_progress.update(server_id, token, work); self.lsp_progress.update(server_id, token, work);
} }
if self.config.load().editor.lsp.display_messages { if self.config.load().editor.lsp.display_progress_messages {
self.editor.set_status(status); self.editor.set_status(status);
} }
} }

@ -20,7 +20,7 @@ helix-core = { path = "../helix-core" }
bitflags = "2.6" bitflags = "2.6"
cassowary = "0.3" cassowary = "0.3"
unicode-segmentation = "1.11" unicode-segmentation = "1.12"
crossterm = { version = "0.28", optional = true } crossterm = { version = "0.28", optional = true }
termini = "1.0" termini = "1.0"
serde = { version = "1", "optional" = true, features = ["derive"]} serde = { version = "1", "optional" = true, features = ["derive"]}

@ -421,7 +421,9 @@ pub fn get_terminal_provider() -> Option<TerminalConfig> {
pub struct LspConfig { pub struct LspConfig {
/// Enables LSP /// Enables LSP
pub enable: bool, pub enable: bool,
/// Display LSP progress messages below statusline /// Display LSP messagess from $/progress below statusline
pub display_progress_messages: bool,
/// Display LSP messages from window/showMessage below statusline
pub display_messages: bool, pub display_messages: bool,
/// Enable automatic pop up of signature help (parameter hints) /// Enable automatic pop up of signature help (parameter hints)
pub auto_signature_help: bool, pub auto_signature_help: bool,
@ -439,7 +441,8 @@ impl Default for LspConfig {
fn default() -> Self { fn default() -> Self {
Self { Self {
enable: true, enable: true,
display_messages: false, display_progress_messages: false,
display_messages: true,
auto_signature_help: true, auto_signature_help: true,
display_signature_help_docs: true, display_signature_help_docs: true,
display_inlay_hints: false, display_inlay_hints: false,
@ -1271,6 +1274,13 @@ impl Editor {
self.status_msg = Some((error, Severity::Error)); self.status_msg = Some((error, Severity::Error));
} }
#[inline]
pub fn set_warning<T: Into<Cow<'static, str>>>(&mut self, warning: T) {
let warning = warning.into();
log::warn!("editor warning: {}", warning);
self.status_msg = Some((warning, Severity::Warning));
}
#[inline] #[inline]
pub fn get_status(&self) -> Option<(&Cow<'static, str>, &Severity)> { pub fn get_status(&self) -> Option<(&Cow<'static, str>, &Severity)> {
self.status_msg.as_ref().map(|(status, sev)| (status, sev)) self.status_msg.as_ref().map(|(status, sev)| (status, sev))

@ -44,12 +44,13 @@ haskell-language-server = { command = "haskell-language-server-wrapper", args =
idris2-lsp = { command = "idris2-lsp" } idris2-lsp = { command = "idris2-lsp" }
intelephense = { command = "intelephense", args = ["--stdio"] } intelephense = { command = "intelephense", args = ["--stdio"] }
jdtls = { command = "jdtls" } jdtls = { command = "jdtls" }
jedi = { command = "jedi-language-server" }
jq-lsp = { command = "jq-lsp" } jq-lsp = { command = "jq-lsp" }
jsonnet-language-server = { command = "jsonnet-language-server", args= ["-t", "--lint"] } jsonnet-language-server = { command = "jsonnet-language-server", args= ["-t", "--lint"] }
julia = { command = "julia", timeout = 60, args = [ "--startup-file=no", "--history-file=no", "--quiet", "-e", "using LanguageServer; runserver()", ] } julia = { command = "julia", timeout = 60, args = [ "--startup-file=no", "--history-file=no", "--quiet", "-e", "using LanguageServer; runserver()", ] }
koka = { command = "koka", args = ["--language-server", "--lsstdio"] } koka = { command = "koka", args = ["--language-server", "--lsstdio"] }
kotlin-language-server = { command = "kotlin-language-server" } kotlin-language-server = { command = "kotlin-language-server" }
lean = { command = "lean", args = [ "--server" ] } lean = { command = "lean", args = [ "--server", "--memory=1024" ] }
ltex-ls = { command = "ltex-ls" } ltex-ls = { command = "ltex-ls" }
markdoc-ls = { command = "markdoc-ls", args = ["--stdio"] } markdoc-ls = { command = "markdoc-ls", args = ["--stdio"] }
markdown-oxide = { command = "markdown-oxide" } markdown-oxide = { command = "markdown-oxide" }
@ -84,6 +85,7 @@ racket = { command = "racket", args = ["-l", "racket-langserver"] }
regols = { command = "regols" } regols = { command = "regols" }
rescript-language-server = { command = "rescript-language-server", args = ["--stdio"] } rescript-language-server = { command = "rescript-language-server", args = ["--stdio"] }
robotframework_ls = { command = "robotframework_ls" } robotframework_ls = { command = "robotframework_ls" }
ruff = { command = "ruff", args = ["server"] }
serve-d = { command = "serve-d" } serve-d = { command = "serve-d" }
slint-lsp = { command = "slint-lsp", args = [] } slint-lsp = { command = "slint-lsp", args = [] }
solargraph = { command = "solargraph", args = ["stdio"] } solargraph = { command = "solargraph", args = ["stdio"] }
@ -852,7 +854,7 @@ file-types = ["py", "pyi", "py3", "pyw", "ptl", "rpy", "cpy", "ipy", "pyt", { gl
shebangs = ["python"] shebangs = ["python"]
roots = ["pyproject.toml", "setup.py", "poetry.lock", "pyrightconfig.json"] roots = ["pyproject.toml", "setup.py", "poetry.lock", "pyrightconfig.json"]
comment-token = "#" comment-token = "#"
language-servers = [ "pylsp" ] language-servers = ["ruff", "jedi", "pylsp"]
# TODO: pyls needs utf-8 offsets # TODO: pyls needs utf-8 offsets
indent = { tab-width = 4, unit = " " } indent = { tab-width = 4, unit = " " }

@ -28,6 +28,8 @@
"ui.virtual.jump-label" = { fg = "lightblue", modifiers = ["italic", "bold"] } "ui.virtual.jump-label" = { fg = "lightblue", modifiers = ["italic", "bold"] }
"ui.bufferline" = { fg = "grey04", bg = "grey00" } "ui.bufferline" = { fg = "grey04", bg = "grey00" }
"ui.bufferline.active" = { fg = "grey07", bg = "grey02" } "ui.bufferline.active" = { fg = "grey07", bg = "grey02" }
"ui.picker.header.column" = { fg = "grey05", modifiers = ["italic", "bold"] }
"ui.picker.header.column.active" = { fg = "grey05", bg = "grey03", modifiers = ["italic", "bold"] }
"operator" = "grey05" "operator" = "grey05"
"variable" = "white" "variable" = "white"

@ -33,7 +33,7 @@ tag = "red"
"ui.selection" = { bg = "selection" } "ui.selection" = { bg = "selection" }
"ui.virtual.indent-guide" = { fg = "gray" } "ui.virtual.indent-guide" = { fg = "gray" }
"ui.virtual.whitespace" = { fg = "light-gray" } "ui.virtual.whitespace" = { fg = "light-gray" }
"ui.virtual.ruler" = { bg ="dark-bg" } "ui.virtual.ruler" = { bg = "dark-bg" }
"ui.statusline" = { bg = "dark-bg", fg = "light-gray" } "ui.statusline" = { bg = "dark-bg", fg = "light-gray" }
"ui.popup" = { bg = "dark-bg", fg = "orange" } "ui.popup" = { bg = "dark-bg", fg = "orange" }
"ui.help" = { bg = "dark-bg", fg = "orange" } "ui.help" = { bg = "dark-bg", fg = "orange" }
@ -43,6 +43,8 @@ tag = "red"
"ui.bufferline" = { bg = "dark-bg", fg = "light-gray" } "ui.bufferline" = { bg = "dark-bg", fg = "light-gray" }
"ui.bufferline.active" = { bg = "dark-bg", fg = "orange" } "ui.bufferline.active" = { bg = "dark-bg", fg = "orange" }
"ui.virtual.jump-label" = { fg = "pink", modifiers = ["bold"] } "ui.virtual.jump-label" = { fg = "pink", modifiers = ["bold"] }
"ui.picker.header.column" = { fg = "orange", underline.style = "line" }
"ui.picker.header.column.active" = { fg = "purple", modifiers = ["bold"], underline.style = "line" }
# Diagnostics # Diagnostics
"diagnostic" = { underline = { style = "curl" } } "diagnostic" = { underline = { style = "curl" } }

@ -1,119 +1,124 @@
# Author : Timothy DeHerrera <tim@nrdxp.dev> # Author : Timothy DeHerrera <tim@nrdxp.dev>
"comment".fg = "comment" "comment".fg = "comment"
"constant".fg = "purple" "constant.builtin".fg = "olive"
"constant.builtin".fg = "olive"
"constant.character".fg = "carnation"
"constant.character.escape".fg = "magenta" "constant.character.escape".fg = "magenta"
"constant.numeric".fg = "cyan" "constant.character".fg = "carnation"
"constant.numeric.float".fg = "red" "constant".fg = "purple"
"constant.numeric".fg = "cyan"
"constant.numeric.float".fg = "red"
"function".fg = "green"
"function.builtin".fg = "sand" "function.builtin".fg = "sand"
"function.macro".fg = "blue" "function".fg = "green"
"function.method".fg = "opal" "function.macro".fg = "blue"
"function.method".fg = "opal"
"keyword" = { fg = "magenta", modifiers = ["bold"] } "keyword" = { fg = "magenta", modifiers = ["bold"] }
"keyword.operator" = { fg = "coral", modifiers = ["bold"] } "keyword.control" = { fg = "carnation", modifiers = ["bold"] }
"keyword.function" = { fg = "lilac", modifiers = ["bold"] }
"keyword.control" = { fg = "carnation", modifiers = ["bold"]}
"keyword.control.exception" = { fg = "red", modifiers = ["bold"] } "keyword.control.exception" = { fg = "red", modifiers = ["bold"] }
"keyword.storage" = { fg = "coral", modifiers = ["bold"] } "keyword.function" = { fg = "lilac", modifiers = ["bold"] }
"keyword.operator" = { fg = "coral", modifiers = ["bold"] }
"keyword.storage" = { fg = "coral", modifiers = ["bold"] }
"operator".fg = "coral" "operator".fg = "coral"
"punctuation".fg = "magenta" "punctuation.bracket".fg = "foreground"
"punctuation.delimiter".fg = "coral" "punctuation.delimiter".fg = "coral"
"punctuation.bracket".fg = "foreground" "punctuation".fg = "magenta"
"string".fg = "yellow" "attribute".fg = "opal"
"string".fg = "yellow"
"string.regexp".fg = "red"
"string.special".fg = "blue" "string.special".fg = "blue"
"string.regexp".fg = "red" "tag".fg = "carnation"
"tag".fg = "carnation"
"attribute".fg = "opal"
"type".fg = "opal" "type.builtin".fg = "yellow"
"type.variant".fg = "sand"
"type.builtin".fg = "yellow"
"type.enum.variant".fg = "sand" "type.enum.variant".fg = "sand"
"type".fg = "opal"
"type.variant".fg = "sand"
"variable".fg = "cyan" "variable.builtin".fg = "olive"
"variable.builtin".fg = "olive" "variable".fg = "cyan"
"variable.other.member".fg = "lilac" "variable.other.member".fg = "lilac"
"variable.parameter" = { fg ="blue", modifiers = ["italic"] } "variable.parameter" = { fg = "blue", modifiers = ["italic"] }
"namespace".fg = "olive"
"constructor".fg = "sand" "constructor".fg = "sand"
"special".fg = "magenta" "label".fg = "magenta"
"label".fg = "magenta" "namespace".fg = "olive"
"special".fg = "magenta"
"diff.plus".fg = "green"
"diff.delta".fg = "blue" "diff.delta".fg = "blue"
"diff.minus".fg = "red" "diff.minus".fg = "red"
"diff.plus".fg = "green"
"ui.background" = { fg = "foreground", bg = "background" }
"ui.cursor" = { fg = "background", bg = "blue", modifiers = ["dim"] } "ui.background" = { fg = "foreground", bg = "background" }
"ui.cursor.match" = { fg = "green", modifiers = ["underlined"] } "ui.cursor" = { fg = "background", bg = "blue", modifiers = ["dim"] }
"ui.cursor.primary" = { fg = "background", bg = "cyan", modifiers = ["dim"] } "ui.cursor.match" = { fg = "green", modifiers = ["underlined"] }
"ui.help" = { fg = "foreground", bg = "background_dark" } "ui.cursor.primary" = { fg = "background", bg = "cyan", modifiers = ["dim"] }
"ui.linenr" = { fg = "comment" } "ui.cursorline" = { bg = "background_dark" }
"ui.linenr.selected" = { fg = "foreground" } "ui.help" = { fg = "foreground", bg = "background_dark" }
"ui.menu" = { fg = "foreground", bg = "background_dark" } "ui.linenr" = { fg = "comment" }
"ui.menu.selected" = { fg = "cyan", bg = "background_dark" } "ui.linenr.selected" = { fg = "foreground" }
"ui.popup" = { fg = "foreground", bg = "background_dark" } "ui.menu" = { fg = "foreground", bg = "background_dark" }
"ui.selection" = { bg = "secondary_highlight" } "ui.menu.selected" = { fg = "cyan", bg = "background_dark" }
"ui.selection.primary" = { bg = "primary_highlight" } "ui.popup" = { fg = "foreground", bg = "background_dark" }
"ui.cursorline" = { bg = "background_dark" } "ui.selection" = { bg = "secondary_highlight" }
"ui.statusline" = { fg = "foreground", bg = "background_dark" } "ui.selection.primary" = { bg = "primary_highlight" }
"ui.statusline.inactive" = { fg = "comment", bg = "background_dark" } "ui.statusline" = { fg = "foreground", bg = "background_dark" }
"ui.statusline.insert" = { fg = "olive", bg = "background_dark" } "ui.statusline.inactive" = { fg = "comment", bg = "background_dark" }
"ui.statusline.normal" = { fg = "opal", bg = "background_dark" } "ui.statusline.insert" = { fg = "olive", bg = "background_dark" }
"ui.statusline.select" = { fg = "carnation", bg = "background_dark" } "ui.statusline.normal" = { fg = "opal", bg = "background_dark" }
"ui.text" = { fg = "foreground" } "ui.statusline.select" = { fg = "carnation", bg = "background_dark" }
"ui.text.focus" = { fg = "cyan" } "ui.text" = { fg = "foreground" }
"ui.window" = { fg = "foreground" } "ui.text.focus" = { fg = "cyan" }
"ui.virtual.whitespace" = { fg = "comment" }
"ui.virtual.indent-guide" = { fg = "opal" } "ui.virtual.indent-guide" = { fg = "opal" }
"ui.virtual.ruler" = { bg = "background_dark" } "ui.virtual.ruler" = { bg = "background_dark" }
"ui.virtual.whitespace" = { fg = "comment" }
"ui.window" = { fg = "foreground" }
"error" = { fg = "red" } "error" = { fg = "red" }
"warning" = { fg = "cyan" } "warning" = { fg = "cyan" }
"diagnostic" = { underline = { style = "line", color = "coral" }, bg = "cyan" }
"diagnostic.deprecated" = { modifiers = ["crossed_out"] }
"diagnostic.error" = { underline = { style = "curl", color = "red" } }
"diagnostic.hint" = { underline = { style = "line", color = "cyan" } }
"diagnostic.info" = { underline = { style = "line" } }
"diagnostic.unnecessary" = { modifiers = ["dim"] } "diagnostic.unnecessary" = { modifiers = ["dim"] }
"diagnostic.deprecated" = { modifiers = ["crossed_out"] } "diagnostic.warning" = { underline = { style = "curl", color = "yellow" } }
"markup.heading" = { fg = "purple", modifiers = ["bold"] } "markup.bold" = { fg = "blue", modifiers = ["bold"] }
"markup.link.label" = { fg = "blue", modifiers = ["italic"] } "markup.heading" = { fg = "purple", modifiers = ["bold"] }
"markup.list" = "cyan" "markup.italic" = { fg = "yellow", modifiers = ["italic"] }
"markup.bold" = { fg = "blue", modifiers = ["bold"] } "markup.link.label" = { fg = "blue", modifiers = ["italic"] }
"markup.italic" = { fg = "yellow", modifiers = ["italic"] } "markup.link.text" = "magenta"
"markup.link.url" = "cyan"
"markup.list" = "cyan"
"markup.quote" = { fg = "yellow", modifiers = ["italic"] }
"markup.raw" = { fg = "foreground" }
"markup.strikethrough" = { modifiers = ["crossed_out"] } "markup.strikethrough" = { modifiers = ["crossed_out"] }
"markup.link.url" = "cyan"
"markup.link.text" = "magenta"
"markup.quote" = { fg = "yellow", modifiers = ["italic"] }
"markup.raw" = { fg = "foreground" }
[palette] [palette]
background = "#282a36" background = "#282a36"
background_dark = "#21222c" background_dark = "#21222c"
primary_highlight = "#800049" comment = "#a39e9b"
foreground = "#eff0eb"
primary_highlight = "#800049"
secondary_highlight = "#4d4f66" secondary_highlight = "#4d4f66"
foreground = "#eff0eb"
comment = "#a39e9b"
# main colors # main colors
red = "#ff5c57" blue = "#57c7ff"
blue = "#57c7ff" cyan = "#9aedfe"
yellow = "#f3f99d" green = "#5af78e"
green = "#5af78e"
purple = "#bd93f9"
cyan = "#9aedfe"
magenta = "#ff6ac1" magenta = "#ff6ac1"
purple = "#bd93f9"
red = "#ff5c57"
yellow = "#f3f99d"
# aux colors # aux colors
lilac = "#c9c5fb"
coral = "#f97c7c"
sand = "#ffab6f"
carnation = "#f99fc6" carnation = "#f99fc6"
olive = "#b6d37c" coral = "#f97c7c"
opal = "#b1d7c7" lilac = "#c9c5fb"
olive = "#b6d37c"
opal = "#b1d7c7"
sand = "#ffab6f"

Loading…
Cancel
Save