Lambe 0.6.1: completer trailing-whitespace fix; rumil 0.6.0 dep bump#2
Merged
Merged
Conversation
Fixes the tab-completion corruption where trailing whitespace in the REPL (or the arda-web playground) produced a wrong replacement offset. Typing `.dependencies`, a space, then Tab now completes against `.dependencies` instead of producing `..dependencies`. Completer changes (lib/src/completer.dart): - Unparsed-remainder classification no longer uses regex. Two small Rumil parsers (`_pipeCtx`, `_fieldTailCtx`) handle pipe-op and field-tail contexts, with `position()` for offset tracking. - AST-end offset (`astEnd`) is computed by walking back over trailing whitespace in the successfully-parsed prefix. Previously `before.length` was used directly, which overshoots when the user has typed trailing whitespace. - Whitespace handling is now uniform across space, tab, CR, LF. Tests: - New 14-test `Trailing whitespace regression` group in test/completer_test.dart covering identity tails, field tails, access tails, parameterized ops, pipe-op paths, and the no-trailing-whitespace parity cases. - Fixed two cursor positions in existing tests (21 and 19 instead of 22 and 20) to match the new contract. - 752 tests passing, no regressions. Investigation artefacts: - PLAN_COMPLETER_WHITESPACE_FIX.md documents the characterization (9 scenarios, 4 hypothesized fix shapes) and the decision to use Rumil parsers over regex. - tool/probe_completer.dart is a diagnostic runner for the cases the plan enumerates. Dependency bumps (pubspec.yaml): - rumil: ^0.5.0 -> ^0.6.0 - rumil_parsers: ^0.5.0 -> ^0.6.0 - rumil_expressions: ^0.5.0 -> ^0.6.0 Rumil 0.6.0 adds the `position()` primitive used by the completer fix. Version metadata: - pubspec.yaml version 0.6.0 -> 0.6.1. - lib/src/_version.dart regenerated via `dart run tool/gen_version.dart`. - doc/lam.1.md front-matter updated, doc/lam.1 regenerated. - README.md and doc/getting-started.md: stale 0.5.0/0.6.0 version strings in example outputs updated. Release gate: format, analyze --fatal-infos, dartdoc --dry-run, tests all clean. Note: Lambe 0.6.0 was tagged locally but not published to pub.dev. The pub.dev jump is 0.5.0 -> 0.6.1; consumers will see the full 0.6.0 + 0.6.1 CHANGELOG entries on install.
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.
Fixes the tab-completion corruption where trailing whitespace in the REPL (or the arda-web playground) produced a wrong replacement offset. Typing
.dependencies, a space, then Tab now completes against.dependenciesinstead of producing..dependencies.Completer changes (lib/src/completer.dart):
_pipeCtx,_fieldTailCtx) handle pipe-op and field-tail contexts, withposition()for offset tracking.astEnd) is computed by walking back over trailing whitespace in the successfully-parsed prefix. Previouslybefore.lengthwas used directly, which overshoots when the user has typed trailing whitespace.Tests:
Trailing whitespace regressiongroup in test/completer_test.dart covering identity tails, field tails, access tails, parameterized ops, pipe-op paths, and the no-trailing-whitespace parity cases.Investigation artefacts:
Dependency bumps (pubspec.yaml):
Rumil 0.6.0 adds the
position()primitive used by the completer fix.Version metadata:
dart run tool/gen_version.dart.Release gate: format, analyze --fatal-infos, dartdoc --dry-run, tests all clean.