Expand description
This module handles auto-magic editing actions applied together with users edits. For example, if the user typed
foo
.bar()
.baz()
| // <- cursor is hereand types . next, we want to indent the dot.
Language server executes such typing assists synchronously. That is, they block userβs typing and should be pretty fast for this reason!
ModulesΒ§
- on_
enter π - Handles the
Enterkey press. At the momently, this only continues comments, but should handle indent some time in the future as well.
StructsΒ§
- Extended
Text πEdit
ConstantsΒ§
- TRIGGER_
CHARS π
FunctionsΒ§
- conv π
- on_
char_ πtyped - on_
char_ πtyped_ - on_
delimited_ πnode_ typed - on_
dot_ πtyped - Returns an edit which should be applied when a dot (β.β) is typed on a blank line, indenting the line appropriately.
- on_
eq_ πtyped - Returns an edit which should be applied after
=was typed. Primarily, this works when addinglet =. - on_
left_ πangle_ typed - Add closing
>for generic arguments/parameters. - on_
left_ πbrace_ typed - on_
opening_ πdelimiter_ typed - Inserts a closing delimiter when the user types an opening bracket, wrapping an existing expression in a
block, or a part of a
useitem (for{). - on_
pipe_ πtyped - on_
plus_ πtyped - on_
right_ πangle_ typed - Adds a space after an arrow when
fn foo() { ... }is turned intofn foo() -> { ... }