| Commit message (Collapse) | Author | Age |
... | |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
The code for loading queries can be shared between indent and
textobjects queries. In both cases we want to kick an error
message out to the logs.
|
|
|
| |
Also added a bunch of tests to ensure correct behaviour
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update description of `m` textobject to its actual functionality
Sometime recently the functionality of `m` was changed to match the
nearest pair to the cursor, rather than the former functionality of
matching the pair only if the cursor was on one of the brace characters
directly.
* Rename surround methods to reflect that they work on pairs
The current naming suggests that they may work generally on any
textobject, whereas their implementation really focuses on pairs.
* Change description of m textobject to match actual functionality
The current implementation of `m` no longer merely looks at the pair
character the cursor is on, but actually will search for the pair
(defined in helix-core/src/surround.rs) that encloses the cursor, and
not the entire selection.
* Accept suggested wording change
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Prefix pair surround for consistency
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix nondeterministic highlighting
This is done by prefering matches in the begining, ie for
`keyword.function`, `keyword` is a better match than `function`.
* Use all positions and not just leftmost
Fixes possible edgecase with something like `function.method.builtin`
and the queries `function.builtin` and `function.method`
* Switch to bitmask for slightly better performance
* Make matches from the start of string
Also change comments to match new behaviour
|
|
|
|
|
|
|
| |
* Avoid copying fragments
* Add slice / slices method
* Better documentation for fragment and slice methods
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Change default formatter for any language
* Fix clippy error
* Close stdin for Stdio formatters
* Better indentation and pattern matching
* Return Result<Option<...>> for fn format instead of Option
* Remove unwrap for stdin
* Handle FormatterErrors instead of Result<Option<...>>
* Use Transaction instead of LspFormatting
* Use Transaction directly in Document::format
* Perform stdin type formatting asynchronously
* Rename formatter.type values to kebab-case
* Debug format for displaying io::ErrorKind (msrv fix)
* Solve conflict?
* Use only stdio type formatters
* Remove FormatterType enum
* Remove old comment
* Check if the formatter exited correctly
* Add formatter configuration to the book
* Avoid allocations when writing to stdin and formatting errors
* Remove unused import
Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
|
|
|
|
|
| |
* Exclude only named children without injection.include-children
* Add injection.include-unnamed-children parameter
|
|
|
|
|
|
|
| |
* add code for diagnostic.
This PR provides a solution to resolve #2994. missing Code Actions for lsp
* remote unused import
|
|
|
|
|
| |
queries instead of appending them (#2470)
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add workspace and document diagnostics picker
fixes #1891
* Fix some of @archseer's annotations
* Add From<&Spans> impl for String
* More descriptive parameter names.
* Adding From<Cow<str>> impls for Span and Spans
* Add new keymap entries to docs
* Avoid some clones
* Fix api change
* Update helix-term/src/application.rs
Co-authored-by: Bjorn Ove Hay Andersen <bjrnove@gmail.com>
* Fix a clippy hint
* Sort diagnostics first by URL and then by severity.
* Sort diagnostics first by URL and then by severity.
* Ignore missing lsp severity entries
* Add truncated filepath
* Typo
* Strip cwd from paths and use url-path without schema
* Make tests a doctest
* Better variable names
Co-authored-by: Falco Hirschenberger <falco.hirschenberger@itwm.fraunhofer.de>
Co-authored-by: Bjorn Ove Hay Andersen <bjrnove@gmail.com>
|
|
|
| |
Co-authored-by: Triton171 <triton0171@gmail.com>
|
| |
|
|\
| |
| | |
Integration testing harness
|
| |\ |
|
| | |
| | |
| | |
| | | |
Use the Application's main event loop to allow LSP, file writes, etc
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When a new View of a Document is created, a default cursor of 0, 0 is
created, and it does not get normalized to a single width cursor until
at least one movement of the cursor happens. This appears to have no
practical negative effect that I could find, but it makes tests difficult
to work with, since the initial selection is not what you expect it to be.
This changes the initial selection of a new View to be the width of the
first grapheme in the text.
|
| |/
|/| |
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
* feat: make `move_vertically` aware of tabs and wide characters
* refactor: replace unnecessary checked_sub with comparison
* refactor: leave pos_at_coords unchanged and introduce separate pos_at_visual_coords
* style: include comment to explain `pos_at_visual_coords` breaking condition
* refactor: use `pos_at_visual_coords` in `text_pos_at_screen_coords`
* feat: make `copy_selection_on_line` aware of wide characters
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* allows passing extra formatting options to LSPs
- adds optional field 'format' to [[language]] sections in 'languages.toml'
- passes specified options the LSPs via FormattingOptions
* cleaner conversion of formatting properties
* move formatting options inside lsp::Client
* cleans up formatting properties merge
|
| |
|
| |
|
|
|
|
| |
`strip_prefix` will itself check whether the string starts with the
prefix, so the extra call to `starts_with` was unnecessary.
|
|
|
|
| |
textobjects (#2494)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* add reflow command
Users need to be able to hard-wrap text for many applications, including
comments in code, git commit messages, plaintext documentation, etc. It
often falls to the user to manually insert line breaks where appropriate
in order to hard-wrap text.
This commit introduces the "reflow" command (both in the TUI and core
library) to automatically hard-wrap selected text to a given number of
characters (defined by Unicode "extended grapheme clusters"). It handles
lines with a repeated prefix, such as comments ("//") and indentation.
* reflow: consider newlines to be word separators
* replace custom reflow impl with textwrap crate
* Sync reflow command docs with book
* reflow: add default max_line_len language setting
Co-authored-by: Vince Mutolo <vince@mutolo.org>
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
* Add color_column option
* Rename to ruler
Co-authored-by: DeviousStoat <devious@stoat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* log textobject query construction errors
The current behavior is that invalid queries are discarded silently
which makes it difficult to debug invalid textobjects (either invalid
syntax or an update may have come through that changed the valid set
of nodes).
* fix golang textobject query
`method_spec_list` used to be a named node but was removed (I think
for Helix, it was when updated to pull in the support for generics).
Instead of a named node for the list of method specs we have a bunch
of `method_spec` children nodes now. We can match on the set of them
with a `+` wildcard.
Example go for this query:
type Shape interface {
area() float64
perimeter() float64
}
Which is parsed as:
(source_file
(type_declaration
(type_spec
name: (type_identifier)
type: (interface_type
(method_spec
name: (field_identifier)
parameters: (parameter_list)
result: (type_identifier))
(method_spec
name: (field_identifier)
parameters: (parameter_list)
result: (type_identifier))))))
|
|
|
|
|
|
|
| |
* add local configuration
* move config loading to Application::new
* simplify find_root_impl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make textobject select last paragraph
Last paragraph shoud be selected if the cursor was placed on the
whitespace paragraph part and `map` is done, otherwise it would do
nothing useful, but now we select backwards for the last paragraph
which behaves similarly to kakoune, making `map` useful for the last
paragraph with whitespace. Example usecase is to copy and paste last
ledger cli paragraph quickly by `mapyp` to duplicate last entry.
* Fix typo in core textobject
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add runtime language configuration (#1794)
* Add set-language typable command to change the language of current buffer.
* Add completer for available language options.
* Update set-language to refresh language server as well
* Add language id based config lookup on `syntax::Loader`.
* Add `Document::set_language3` to set programming language based on language
id.
* Update `Editor::refresh_language_server` to try language detection only if
language is not already set.
* Remove language detection from Editor::refresh_language_server
* Move document language detection to where the scratch buffer is saved.
* Rename Document::set_language3 to Document::set_language_by_language_id.
* Remove unnecessary clone in completers::language
|