fix: use relative path when finding file
style: cargo fmt
_
chore: better error message
refactor: rename to `blame_line`
fix: use line of primary cursor for git blame
feat: basic implementation of blocking Blame handler
feat: implement basic virtual text (end of line blame)
feat: figure out how to draw stuff at the end of lines
feat: implement end of line virtual text for the current line
feat: implement inline git blame
chore: clean up
chore: remove unused import
_
chore: set `blame` to `false` by default
docs: document `[editor.vcs.blame]`
chore: add progress
perf: use background task for worker
_
chore: remove unnecessary panic!s
chore: remove commented code
refactor: remove some layers of abstraction
refactor: remove nesting
feat: [editor.vcs] -> [editor.version-control]
fix: account for inserted and deleted lines
_
refactor: extract into a `blame` module
feat: allow using custom commit format
feat: allow more customizability for inline blame
test: add tests for custom inline commit parsser
refactor: rename `blame` -> `blame_line`
_
_
test: create helper macros for tests
test: make test syntax more expressive. Allow specifying line numbers
that just got added
test: with interspersed lines
feat: add `line_blame` static command
_
test: add an extra test case
test: add ability to have `delete`d lines
test: fix on windows (?)
test: `delete` test case
test: add extra step to test case
test: add documentation for macro
refactor: use `hashmap!` macro
refactor: collapse match arm
fix: remove panic
perf: update inline git blame every 150 milliseconds instead of on each
command
test: add attributes on blocks
style: move function earlier in the file
perf: cache blame results in a hashma
chore: remove log statements
chore: clean up.
ALSO: removes checking for inline blame every N seconds.
_
perf: use mspc instead of busy-wait
docs: add information why we don't optimize the repo
_
test: add back the commented out tests
chore: comment out cfg(not(windows))
test: add extra history to blame test
docs: remove incorrect static command
_
test: disable test on windows
feat: send inline blame event update when reloading or saving the
document
feat: rename `version-control` -> `inline-blame`
feat: update theme key used for inline-blame
chore: remove unused #![allow]
chore:
style: remove accidental formatting
docs: remove incorrect key
perf: Use a single `ThreadSafeRepository` instead of re-constructing it
each time
feat: add `inline_blame` static command bound to `space + B`
style: revert formatting in keymap.md
chore: do not compute blame for document when changing config option
This isn't needed anymore because the inline-blame will be computed
regardless if `inline_blame.enable` is set or not
style: remove newline
refactor: use `fold` instead of loop
chore: clean up
feat: log error forl line blame when it happens
feat: improve message when we don't have the blame
We know that we don't have it because we're still calculating it.
feat: do not render inline blame for empty lines
_
feat: do not show blame output when we are on a hunk that was added
refactor: remove additional wrapper methods
fix
_
feat: more readable time for git blame
chr
feat:
feat: improved error handling
fix: path separator on Windows
test: disable on windows
refactor: move pretty date function formatter into `helix-stdx`
perf: do not use a syscall on each render
chore: add TODO comment to update gix version
chore: use `gix::path` conversion from Path -> BString
_
_
chore: do not update file blame on document save
This is not needed because when we write the file, we don't make a new
commit so the blame will not change.
refactor: use statics to get time elapsed instead of editor state
refactor: do not use custom event, use handler instead
fix: do not spawn a new handler
docs: correct examples for `editor.inline-blame.format`
docs: correct static command name
refactor: add comments, and improve variable names
I didn't really understand this function when I made it. Was just
copy-pasted from end of line diagnostics
I wanted to know what this is actually doing, so I investigated and
while doing this also added comments and improved names of variables
so others can understand too
fix: time in future is accounted for
perf: inline some functions that are called in only 1 place, during a
render loop
perf: add option to disable requesting inline blame in the background
fix: request blame again when document is reloaded
chore: inline blame is disabled with request on demand
feat: when requesting line blame with "blame on demand", show blame in
status
perf: use less allocations
perf: less allocations in `format_relative_time`
_
_
_
_
docs: correct name of command
_
feat: improve error message
_
feat: rename enum variants for inline blame behaviour
docs: improve description of behaviour field
Previously the `call` helper (and its related functions) returned a
`serde_json::Value` which was then decoded either later in the client
(see signature help and hover) or by the client's caller. This led to
some unnecessary boilerplate in the client:
let resp = self.call::<MyRequest>(params);
Some(async move { Ok(serde_json::from_value(resp.await?)?) })
and in the caller. It also allowed for mistakes with the types. The
workspace symbol request's calling code for example mistakenly decoded a
`lsp::WorkspaceSymbolResponse` as `Vec<lsp::SymbolInformation>` - one of
the untagged enum members (so it parsed successfully) but not the
correct type.
With this change, the `call` helper eagerly decodes the response to a
request as the `lsp::request::Request::Result` trait item. This is
similar to the old helper `request` (which has become redundant and has
been eliminated) but all work is done within the same async block which
avoids some awkward lifetimes. The return types of functions like
`Client::text_document_range_inlay_hints` are now more verbose but it is
no longer possible to accidentally decode as an incorrect type.
Additionally `Client::resolve_code_action` now uses the `call_with_ref`
helper to avoid an unnecessary clone.
This adds events for:
* a document being opened
* a document being closed
* a language server sending the initialized notification
* a language server exiting
and also moves some handling done for these scenarios into hooks,
generally moving more into helix-view. A hook is also added on
`DocumentDidChange` which sends the `text_document_did_change`
notification - this resolves a TODO in `document`.
This resolves a TODO in the core diagnostic module to refactor this
type. It was originally an alias of `LanguageServerId` for simplicity.
Refactoring as an enum is a necessary step towards introducing
"internal" diagnostics - diagnostics emitted by core features such as
a spell checker. Fully supporting this use-case will require further
larger changes to the diagnostic type, but the change to the provider
can be made first.
Note that `Copy` is not derived for `DiagnosticProvider` (as it was
previously because `LanguageServerId` is `Copy`). In the child commits
we will add the `identifier` used in LSP pull diagnostics which is a
string - not `Copy`.
This is the same change as 1c9a5bd366 but for:
* document symbols
* workspace symbols
* goto definition/declaration/.../references
* hover
Instead of bailing when one server fails, we log an error and continue
gathering items from the other responses.
When requesting code actions from multiple LSP servers,
rather than bailing as soon as an error is encountered,
instead log the error and then keep going so that successful
requests can be presented to the user.
This is a minor move that will make future refactors of code actions
simpler. We should be able to move nearly all code action functionality
into `helix-view`, save UI stuff like the `menu::Item` implementation
and dealings with the compositor.
if `config.toml` either does not have `editor.true-color` or sets
it to false, many (most?) themes stop being usable. when loading such a
theme, Helix falls back to the default theme, but didn't mention this
anywhere - even in `~/.cache/helix/helix.log` when run with `-v`.
if this occurs when reloading a theme at runtime with `:theme`, there's
a fairly helpful error about
> `theme requires true color support`
seems worth logging about this if it happens during startup too.
This matches the behavior described by the EditorConfig spec for its
`insert_final_newline` option:
> Editors must not insert newlines in empty files when saving those
> files, even if `insert_final_newline = true`.
Co-authored-by: Axlefublr <101342105+Axlefublr@users.noreply.github.com>
These match the equivalent options in VSCode. `trim_trailing_whitespace`
is also the name used by EditorConfig.
* `trim-final-newlines` trims any extra line endings after the final one
* `trim-trailing-whitespace` trims any trailing whitespace (but not
empty lines)
Render rulers before the cursor to ensure that the cursor, when over
a ruler, is not hidden from view. Without this, you typically end up
with 1) foreground text that is the same as the background if the
ruler doesn't already have a foreground and 2) no visible cursor,
because the ruler's background color took precedence. By moving the
rulers before the cursor, this ensures that the theme is still rendered
more or less the way one would visually expect things to turn out.
This follows a pattern used in the signature help request for example.
Moving the json deserialization into the return future of
`text_document_hover` makes the types easier for callers to work with.
The info log within `process_request_response` duplicated the body of
the JSON message printed earlier by the transport which was confusing.
The error log in the completion handler was easy to hit during normal
use and is not actually an error - dropping is the graceful way to
handle changes occurring while completion requests are in flight.
This is not consequential now but when we switch to the new highlighter
we will want the theme to be set (and the loader's `scopes` to be set
based on the theme) before parsing a document. Previously `set_theme`
came after the loading of documents, so documents would be missing
locals highlights after being loaded and before the first edit.
`:lsp-stop` should consider only the set of active language servers for
a document. `:lsp-restart` though may be used to start up a language
server that crashed or was manually stopped, so it needs to consider the
language servers in config instead.
This change inlines the `valid_lang_servers` function into `:lsp-stop`
and `:lsp-restart` and changes `:lsp-restart` to check the doc's config
rather than active language servers. `:lsp-restart` now also does not
need to clone the language server names as strings since it borrows from
the config and arguments rather than `Document`. The completer has also
been split into two - one matching active language servers, used by
`:lsp-stop`, and the other matching configured language servers, used by
`:lsp-restart`.
This also removes the part of `:lsp-restart` which bailed if a language
server failed to be restarted (for example because it is not installed).
There might be multiple language servers configured for a language and
only one installed. In that case the `:lsp-restart` should be considered
successful even if not all servers could be started. Bailing prevented
any language servers which could start from being attached to the
document. Instead errors are collected and emitted at the end.
Previously all register selection info boxes had "Registers" as the
title. That was particularly confusing for `copy_between_registers`
which presents two info boxes back-to-back.
The application held onto these since their introduction in ce97a2f0 but
the Arcs are duplicated between Application and Editor - we can store it
only on Editor without issue.
There is no functional change to the move - it's just moving the code
into helix-view under a new method `Editor::handle_lsp_diagnostics` -
thought there is a typo fix, the removal of an unnecessary clone (for
the document's language config) and the removal of some nesting.
Co-authored-by: Sofus Addington <sofus@addington.dk>
This causes the infobox to disappear even when you type a non-character
key like escape. For example `"<esc>` now clears the infobox where
before it was left hanging.
Path completion items always have documentation but future core (i.e.
non-LSP) completions may not always have documentation - for example
word completion from the current buffer.