Track integration branch: schema-aware editor work#1
Closed
StarProxima wants to merge 9 commits intomainfrom
Closed
Track integration branch: schema-aware editor work#1StarProxima wants to merge 9 commits intomainfrom
StarProxima wants to merge 9 commits intomainfrom
Conversation
…tation SuggestionProvider decouples the source of completion candidates from the CodeController. DefaultSuggestionProvider wraps the existing Autocompleter so the out-of-the-box behavior stays identical: language keywords, buffer words, and words from setCustomWords are exposed as text-typed Suggestion items. Callers can now inject their own implementation (e.g. schema-driven or LSP-backed) without subclassing or forking Autocompleter.
- `showItems(List<Suggestion>)` is the new primary entry point; the legacy `show(List<String>)` now wraps each string in a text-typed Suggestion and delegates to `showItems`. - `items` exposes the rich suggestions; `suggestions` becomes a view returning just the labels for backward compatibility with popup widgets that were built against the original `List<String>` shape. - `getSelectedItem()` returns the full Suggestion for callers that need `insertText`/`detail`/`documentation`; `getSelectedWord()` still returns the label. - `scrollByArrow` guards against an empty items list.
Adds an optional `suggestionProvider` constructor parameter and a matching getter/setter. When no provider is supplied the controller falls back to `DefaultSuggestionProvider(autocompleter)`, preserving the pre-existing completion behavior. `generateSuggestions` now builds a `SuggestionRequest` from the current editor state (text, caret offset, prefix, language) and delegates to the provider. Results flow through `PopupController.showItems`, so rich metadata (type, priority, detail, documentation) is retained for UI layers that want to render it. No changes in behavior for existing callers.
- Re-export Suggestion, SuggestionType, SuggestionRequest, SuggestionProvider and DefaultSuggestionProvider from package:flutter_code_editor/flutter_code_editor.dart. - Small tidy-ups in the new files (import pruning, redundant default argument removal, dartdoc link imports).
- Drop a dartdoc reference that required importing CodeController
just for the link.
- Turn sync `_FixedProvider` tests into plain sync tests (no unused
async modifier).
- Extra tests:
- `DefaultSuggestionProvider` respects `Autocompleter.blacklist`.
- `PopupController.showItems` called twice resets the selection and
replaces the list.
- Assigning the same `SuggestionProvider` instance is a no-op
(no spurious listener notifications).
Owner
Author
|
Откатываем downstream изменения - форк редактора не в приоритете. Ветки остаются на случай возврата к идее. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking PR keeping this fork's `integration` branch visible against upstream `main`.
Each feature intended for upstream lives on its own `feat/*` branch merged into `integration`; the tracking PR aggregates the current state.
Currently on `integration`
Downstream design reference
See schema-aware Lab editor spec for the full picture - this fork is the editor half of the work.
Supersedes