Repository navigation
release 0.7.1: fixes from the second survey of other plugins - #158
Merged
Merged
Conversation
Problem: The survey does not show every fault of the rules. Solution: Pin six more Vim9 plugins in the survey list (Galvarcus). The eleven plugins in tools/survey.txt come from few authors. A scan of DanBradbury/copilot-chat.vim shows two faults that none of them shows: a key before the command of a mapping command line, and the shell command of :!. Each is filed as a sub-issue. The list now also pins copilot-chat.vim, lifepillar/vim-colortemplate, girishji/vimsuggest, gh-tui-tools/gh-review.vim, bfrg/vim-jqplay and kennypete/vim-tene, each at the commit that the survey read. All seventeen scans exit 0. related: #140 related: #141 related: #142 Assisted-by: Claude Opus 5 Signed-off-by: Galvarcus <117151435+Galvarcus@users.noreply.github.com>
the survey does not show every fault of the rules
Problem: A key before the command of a mapping command line gives the
command as a name.
Solution: Read the command of a command line past the key names before
it (Galvarcus).
A mapping such as `:<C-u>call Foo()<CR>` types `<C-u>` to clear the range
that a count or a selection puts on the line, then runs `call`. The rule
of #131 reads the command right behind the colon, so `<C-u>` stopped it
and `call` was an unplaced name.
past_keys now moves the head of a command line past each key name glued
behind its colon. A key name with nothing behind it ends the line and
stays the head, as before.
The four corpora report the same with every class on. In the survey, the
one change is that `call` at plugin/copilot_chat.vim:48 of
DanBradbury/copilot-chat.vim is no longer an unplaced name.
fixes: #141
related: #131
related: #140
Assisted-by: Claude Opus 5
Signed-off-by: Galvarcus <117151435+Galvarcus@users.noreply.github.com>
a key before the command of a mapping command line gives it as a name
Problem: The shell command of :! gives its words as names.
Solution: Read a bang that no modifier takes as the command :!, whose
line is text (Galvarcus).
The search for the command of a line skipped every bang, because a
modifier takes one, as in `silent!`. A bang that stands alone is the
command :!, so in `!xdg-open foo` the search went on to `xdg` and gave
`xdg`, `open` and `foo` as names. The same held behind `silent` and in
the text that `execute` runs.
shell() now tells the command from the bang of a modifier: the bang of
a modifier is glued to it. The command stops the search, and its line
is text to its end, bars included, as the shell reads it.
The four corpora report the same with every class on. In the survey, the
one change is that `xdg` and `open` at autoload/copilot_chat/auth.vim:141
of DanBradbury/copilot-chat.vim are no longer unplaced names.
fixes: #142
related: #140
Assisted-by: Claude Opus 5
Signed-off-by: Galvarcus <117151435+Galvarcus@users.noreply.github.com>
the shell command of :! gives its words as names
Problem: A :command behind a colon in a lambda block gives its words as
names.
Solution: Read the word of a line past the colon of a command when the
lexer asks whether the line opens a block (Galvarcus).
The rules of a :command line read the head of a statement alone. A
`command` line in a lambda block is a statement of its own, because
`command` is one of the words that end the statement before them. The
lexer read the first word of the line for that, and `:command!` gives
none, so the line stayed in the statement of the lambda, and its
attributes, its name and `<f-args>` were names.
opens_block now reads the word past a colon that opens the line, as Vim
does: `:command!` is `command!`. The colon of a conditional cannot stand
there, because Vim9 needs a space behind it.
The four corpora report the same with every class on. In the survey,
girishji/vimsuggest gives 78 fewer unplaced names in each scan, and
nothing else changes.
fixes: #146
related: #140
Assisted-by: Claude Opus 5
Signed-off-by: Galvarcus <117151435+Galvarcus@users.noreply.github.com>
a :command behind a colon in a lambda block gives its words as names
Problem: A comment behind the brace of a lambda block makes the next key
of the dictionary a name.
Solution: Read whether a line opens a lambda block from its tokens, past
a comment (Galvarcus).
The lexer records a lambda block where its line ends with `=> {`, so
that a block word inside the lambda returns to the brackets around it
when the lambda closes (#96). A comment behind the brace hid that end.
The `if` inside the lambda then cleared the depth of the brackets, the
statement ended at the `},` of the lambda, and the next key of the
dictionary opened a statement of its own, as a name.
opens_lambda now reads the last tokens of the line other than a comment:
the arrow, then the brace.
The four corpora report the same with every class on. In the survey,
the one change is that `close_cb` at autoload/vimsuggest/addons/job.vim:34
of girishji/vimsuggest is no longer an unplaced name.
fixes: #147
related: #96
related: #140
Assisted-by: Claude Opus 5
Signed-off-by: Galvarcus <117151435+Galvarcus@users.noreply.github.com>
a comment behind the brace of a lambda block makes the next key a name
Problem: The text of a :! command line runs past its end.
Solution: End the shell text of a :! at the end of its line, and in a
mapping at the first key name or bar (Galvarcus).
The rule of #142 read every word behind a :! as shell text, to the end
of the statement. In a mapping, the command line of the shell ends at
the `<CR>` that runs it, and the mapping ends at a bar. In a lambda
block, it ends with its line. So `:!git pull<CR>:call Missing()<CR>`,
`:!ctags -R .<CR>| call Missing()` and a `Missing()` on a later line of
the block marked `Missing` as a word of Vim, and a call to a function
that does not exist was no longer counted.
shell_text now bounds the text: the line of the :!, and in a mapping the
tokens before the first key name or bar. A key name such as `<Bar>`
that the shell would read ends the text as well, which leaves a word
counted and drops none.
The four corpora and the survey report the same as before.
fixes: #150
related: #142
related: #140
Assisted-by: Claude Opus 5
Signed-off-by: Galvarcus <117151435+Galvarcus@users.noreply.github.com>
the text of a :! command line runs past its end
Problem: A comment behind the arrow of a lambda ends the statement.
Solution: Read whether a line ends with the arrow from its tokens, past
a comment (Galvarcus).
Vim9 carries a line that ends with `=>` on to the body of the lambda on
the next line (#94). The lexer read that end from the raw text, so a
comment behind the arrow hid it. The statement then ended at the arrow,
and the body became a statement of its own, where the parameters of the
lambda were names.
code_ends now reads the last tokens of a line other than a comment, for
the arrow alone and for the arrow and the brace that open a block lambda
(#147), which it replaces.
The four corpora and the survey report the same as before.
fixes: #151
related: #94
related: #147
related: #140
Assisted-by: Claude Opus 5
Signed-off-by: Galvarcus <117151435+Galvarcus@users.noreply.github.com>
a comment behind the arrow of a lambda ends the statement
Problem: A dot that ends a line of a lambda block reaches into the next
line.
Solution: Read a word as a member only where the dot before it stands on
its line (Galvarcus).
The lines of a lambda block stay in one statement, so a dot that ended
one line stood right before the first word of the next. The analyzer
read that word as a member: after `:!ctags -R .` a call `Missing()` was
`R.Missing`, a member that resolves to no function, so a call to a
function that does not exist gave no unplaced name, and after `edit .`
a call to a function of the project could leave the function a ghost.
Vim9 allows no space behind the dot of a member, and the end of a line
is one. behind_dot now asks that the dot and the word share a line, for
the member flag and for the type of the receiver. A dot that opens a
line still reaches into the line before it.
The four corpora and the survey report the same as before. A word on
the line below `edit .` is still read as an argument of `edit`, which is
#155.
fixes: #153
related: #140
related: #155
Assisted-by: Claude Opus 5
Signed-off-by: Galvarcus <117151435+Galvarcus@users.noreply.github.com>
a dot that ends a line of a lambda block reaches into the next line
Problem: The text arguments of a command in a lambda block run onto
later lines.
Solution: End the text of a command at a head that opens a line of the
block (Galvarcus).
The lines of a lambda block stay in one statement. text_args read a word
as an argument of every text command before it in the statement, up to
a bar, and `:normal` past every bar. So after `edit foo`, `highlight Foo
guifg=red` or `normal! gg`, a call `Missing()` on the next line of the
block was marked as a word of Vim, and a call to a function that does not
exist gave no unplaced name.
opens_block_line now tells a head that opens a line of the block, and
the text of a command before it ends there. A head that a backslash
carries on to a line of its own ends the text as well, which leaves a
word counted and drops none.
The four corpora and the survey report the same as before.
fixes: #155
related: #140
related: #153
Assisted-by: Claude Opus 5
Signed-off-by: Galvarcus <117151435+Galvarcus@users.noreply.github.com>
the text arguments of a command in a lambda block run onto later lines
Problem: The version names a release without the fixes that the second
survey of other plugins found.
Solution: Raise the version to 0.7.1 (Galvarcus).
Every change since v0.7.0 corrects a rule, so the patch rises. The
analyzer no longer reports a function as a ghost when a lambda block
calls it on the line below a dot, as after `edit .`. It now counts calls
to functions that do not exist where it hid them, on the lines of a
lambda block below a text command or below a line that ends with a dot.
It also places more names. A key before the command of a mapping
command line, the shell command of :!, a :command behind a colon in a
lambda block, and a comment behind the arrow or the brace of a lambda
no longer give unplaced names.
The survey list pins six more plugins. Every parity fixture still
matches.
The gate compares the version with the tag, so v0.7.1 is tagged on the
merge into main and not before it.
related: #140
Assisted-by: Claude Opus 5
Signed-off-by: Galvarcus <117151435+Galvarcus@users.noreply.github.com>
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.
AI assistance
Checklist
tools/checkprintsevery check passedSigned-off-by:trailer is present, which theprepare-commit-msghook adds. A fresh checkout has no hooks,so install them again before the first commit
Tests
Each fix came with its own tests in its pull request, each watched failing first. The version commit changes no rule.
What the analyzer reports
Every parity fixture matches, and the four corpora report the same with every class on. A project can lose a finding that v0.7.0 reported where a lambda block calls the function on the line below a dot (#153).
Documentation
Anything reviewers should know
10 commits since v0.7.0: 9 fixes and the version (
ef5dabc), merged in #143, #144, #145, #148, #149, #152, #154, #156 and #157.tools/survey.txtpins six more plugins: DanBradbury/copilot-chat.vim, lifepillar/vim-colortemplate, girishji/vimsuggest, gh-tui-tools/gh-review.vim, bfrg/vim-jqplay and kennypete/vim-tene.:!(the shell command of :! gives its words as names #142), a:commandbehind a colon in a lambda block (a :command behind a colon in a lambda block gives its words as names #146), and a comment behind the brace (a comment behind the brace of a lambda block makes the next key a name #147) or the arrow (a comment behind the arrow of a lambda ends the statement #151) of a lambda. the text of a :! command line runs past its end #150 bounds the text of the shell command of :! gives its words as names #142, which the cloud review found.fixes:lines. the eleven plugins of the survey do not show every fault of the rules #140 stays open: four of the new plugins are not read yet. The tagv0.7.1on the merge commit starts the release, and the gate compares the tag with the version of the crate before anything is built.