When closeBrackets
skips a bracket, it now generates a change that overwrites the bracket.
Replace the entire selected range when picking a completion with a non-cursor selection active.
Completions can now provide a section
field that is used to group them into sections.
The new positionInfo
option can be used to provide custom logic for positioning the info tooltips.
Fix a bug where the apply method created by snippet
didn't add a pickedCompletion
annotation to the transactions it created.
Don't consider node names in trees that aren't the same language as the one at the completion position in ifIn
and ifNotIn
.
Make sure completions that exactly match the input get a higher score than those that don't (so that even if the latter has a score boost, it ends up lower in the list).
Fix an issue where the extension would sometimes try to draw a disabled dialog at an outdated position, leading to plugin crashes.
A tooltipClass
option to autocompletion can now be used to add additional CSS classes to the completion tooltip.
Fix an issue where completion lists could end up being higher than the tooltip they were in.
Set an explicit box-sizing
style on completion icons so CSS resets don't mess them up.
Allow closing braces in templates to be escaped with a backslash.
Fix a regression that could cause the completion dialog to stick around when it should be hidden.
Fix a regression where transactions for picking a completion (without custom apply
method) no longer had the pickedCompletion
annotation.
Reduce flickering for completion sources without validFor
info by temporarily showing a disabled tooltip while the completion updates.
Make sure completion info tooltips are kept within the space provided by the tooltipSpace
option.
Close bracket configuration now supports a stringPrefixes
property that can be used to allow autoclosing of prefixed strings.
Autocompletion now takes an interactionDelay
option that can be used to control the delay between the time where completion opens and the time where commands like acceptCompletion
affect it.
Fix a bug that prevented transactions produced by deleteBracketPair
from being marked as deletion user events.
Improve positioning of completion info tooltips so they are less likely to stick out of the screen on small displays.
You can now provide a compareCompletions
option to autocompletion to influence the way completions with the same match score are sorted.
The selectOnOpen
option to autocompletion can be used to require explicitly selecting a completion option before acceptCompletion
does anything.
Remove a leftover console.log
in bracket closing code.
Fix a bug that caused closeBrackets
to not close quotes when at the end of a syntactic construct that starts with a similar quote.
Declare package dependencies as peer dependencies as an attempt to avoid duplicated package issues.
Support escaping ${
or #{
in snippets.
Scroll the cursor into view when inserting a snippet.
Add an aria-label to the completion listbox.
Fix a regression that caused transactions generated for completion to not have a userEvent
annotation.
The package now exports an insertCompletionText
helper that implements the default behavior for applying a completion.
The new closeOnBlur
option determines whether the completion tooltip is closed when the editor loses focus.
CompletionResult
objects with filter: false
may now have a getMatch
property that determines the matched range in the options.
CompletionResult.span
has been renamed to validFor
, and may now hold a function as well as a regular expression.
Remove code that dropped any options beyond the 300th one when matching and sorting option lists.
Completion will now apply to all cursors when there are multiple cursors.
CompletionResult.update
can now be used to implement quick autocompletion updates in a synchronous way.
The @codemirror/closebrackets package was merged into this one.
The selectedCompletionIndex
function tells you the position of the currently selected completion.
The new setSelectionCompletion
function creates a state effect that moves the selected completion to a given index.
A completion's info
method may now return null to indicate that no further info is available.
Make the ARIA attributes added to the editor during autocompletion spec-compliant.
Fix an issue where the completion tooltip stayed open if it was explicitly opened and the user backspaced past its start.
Stop snippet filling when a change happens across one of the snippet fields' boundaries.
Fix completion navigation with PageUp/Down when the completion tooltip isn't part of the view DOM.
Fix a bug that caused page up/down to only move the selection by two options in the completion tooltip.
Make sure the info tooltip is hidden when the selected option is scrolled out of view.
Fix a bug in the completion ranking that would sometimes give options that match the input by word start chars higher scores than appropriate.
Options are now sorted (ascending) by length when their match score is otherwise identical.
Fix an issue where info tooltips would be visible in an inappropriate position when there was no room to place them properly.
Give the completion tooltip a minimal width, and show ellipsis when completions overflow the tooltip width.
autocompletion
now accepts an aboveCursor
option to make the completion tooltip show up above the cursor.
Make option deduplication less aggressive, so that options with different type
or apply
fields don't get merged.
Fix an issue where parsing a snippet with a field that was labeled only by a number crashed.
Make sure info tooltips don't stick out of the bottom of the page.
The package exports a new function selectedCompletion
, which can be used to find out which completion is currently selected.
Transactions created by picking a completion now have an annotation (pickedCompletion
) holding the original completion.
Don't rely on the platform's highlight colors for the active completion, since those are inconsistent and may not be appropriate for the theme.
Fix incorrect match underline for some kinds of matched completions.
Improve the sorting of completions by using localeCompare
.
Fix reading of autocompletions in NVDA screen reader.
The new icons
option can be used to turn off icons in the completion list.
The optionClass
option can now be used to add CSS classes to the options in the completion list.
It is now possible to inject additional content into rendered completion options with the addToOptions
configuration option.
Fix an issue where completeAnyWord
would return results when there was no query and explicit
was false.
Fix incorrect versions for @lezer dependencies.
Update dependencies to 0.19.0
Add an ifIn
helper function that constrains a completion source to only fire when in a given syntax node. Add support for unfiltered completions
A completion result can now set a filter: false
property to disable filtering and sorting of completions, when it already did so itself.
Don't treat continued completions when typing after an explicit completion as explicit.
Adding or reconfiguring completion sources will now cause them to be activated right away if a completion was active.
You can now specify multiple types in Completion.type
by separating them by spaces. Small doc comment tweak for Completion.type
Fix a regression where snippet field selection didn't work with @codemirror/state 0.18.6.
Fix a bug where snippet fields with different position numbers were inappropriately merged.
Fix a crash in Safari when moving the selection during composition.
Adjust to updated @codemirror/tooltip interface.
Fix unintended ES2020 output (the package contains ES6 code again).
Stop active completion when all sources resolve without producing any matches.
Completion.info
may now return a promise.
Only preserve selected option across updates when it isn't the first option.
Fix a styling issue where the selection had become invisible inside snippet fields (when using drawSelection
).
Snippet fields can now be selected with the pointing device (so that they are usable on touch devices).
Fix a bug where uppercase completions would be incorrectly matched against the typed input.
Don't bind Cmd-Space on macOS, since that already has a system default binding. Use Ctrl-Space for autocompletion.
The package now also exports a CommonJS module.
First numbered release.