Proposal: Add end_lnum and end_col to quickfix entry#8393
Proposal: Add end_lnum and end_col to quickfix entry#8393thinca wants to merge 3 commits intovim:masterfrom
Conversation
558522a to
909665b
Compare
909665b to
2f777c5
Compare
Codecov Report
@@ Coverage Diff @@
## master #8393 +/- ##
==========================================
- Coverage 89.85% 89.76% -0.09%
==========================================
Files 149 149
Lines 167465 165940 -1525
==========================================
- Hits 150469 148960 -1509
+ Misses 16996 16980 -16
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
Thanks, this can be useful. |
|
Hi,
On Wed, Jun 16, 2021 at 12:37 PM Bram Moolenaar ***@***.***> wrote:
Thanks, this can be useful.
I'll let @yegappan <https://github.com/yegappan> make comments, he has
been doing work on quickfix code.
The changes look good to me. Can you add a few test cases for setqflist(),
getqflist(), :vimgrep, :helpgrep, :clist and :cwindow with the end line
number and column number?
Regards,
Yegappan
|
|
I added some patterns to existing test cases. Is this enough? I tweaked representation of range in quickfix window/
|
|
Hi,
On Thu, Jun 17, 2021 at 9:39 AM thinca ***@***.***> wrote:
I added some patterns to existing test cases. Is this enough?
Yes. This looks good. Thanks for the patch and the tests.
Regards,
Yegappan
… I tweaked representation of range in quickfix window/:clist.
lnum end_lnum col end_col representation
yes no no no 10
yes no yes no 10 col 5
yes no yes yes 10 col 5-8
yes yes no no 10-12
yes yes yes no 10-12 col 5
yes yes yes yes 10-12 col 5-8
|
| call assert_equal(1, line('$')) | ||
| call assert_equal(['Xfile1|10| aa'], getline(1, '$')) | ||
| call assert_equal([{'lnum': 10, 'bufnr': bufnr('Xfile1'), 'col': 0, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': 'aa'}], getqflist()) | ||
| call assert_equal([{'lnum': 10, 'end_lnum': 0, 'bufnr': bufnr('Xfile1'), 'col': 0, 'end_col': 0, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': 'aa'}], getqflist()) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
There was a problem hiding this comment.
Don't worry.
end_lnum and end_col are just optional values. The text in the quickfix window is never changed when they are zero. It will be displayed as before. See the comment above.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Problem: Location list only has the start position.
Solution: Make it possible to add an end position. (Shane-XB-Qian,
closes vim/vim#8393)
vim/vim@6864efa
N/A patches for version.c:
vim-patch:8.2.3002: Vim doesn't abort on a fatal Tcl error
Problem: Vim doesn't abort on a fatal Tcl error.
Solution: Change emsg() to iemsg(). (Dominique Pellé, closes vim/vim#8383)
vim/vim@affd0bc
vim-patch:8.2.3030: Coverity reports a memory leak
Problem: Coverity reports a memory leak.
Solution: Fix the leak and a few typos. (Dominique Pellé, closes vim/vim#8418)
vim/vim@cb54bc6
Patch v8.2.3022 is mostly N/A but cannot be included here
because of new feature check for "has()".
vim-patch:8.2.3032: build problems with MSVC, other crypt issues with libsodium
Problem: Build problems with MSVC, other crypt issues with libsodium.
Solution: Adjust MSVC makefile. Disable swap file only when 'key' is set.
Adjust error message used when key is wrong. Fix Coverity issues.
(Christian Brabandt, closes vim/vim#8420, closes vim/vim#8411)
vim/vim@226b28b
vim-patch:8.2.3044: Amiga MorphOS and AROS: process ID is not valid
Problem: Amiga MorphOS and AROS: process ID is not valid.
Solution: Use FindTask to return something which is unique to all processes.
(Ola Söder, closes vim/vim#8444)
vim/vim@3a62b14
vim-patch:8.2.3046: Amiga MorphOS: Term mode is set using DOS packets
Problem: Amiga MorphOS: Term mode is set using DOS packets.
Solution: Use the same way of setting term mdoe on all next gen Amiga-like
systems. (Ola Söder, closes vim/vim#8445)
vim/vim@b420ac9
Problem: Location list only has the start position.
Solution: Make it possible to add an end position. (Shane-XB-Qian,
closes vim/vim#8393)
vim/vim@6864efa
N/A patches for version.c:
vim-patch:8.2.3002: Vim doesn't abort on a fatal Tcl error
Problem: Vim doesn't abort on a fatal Tcl error.
Solution: Change emsg() to iemsg(). (Dominique Pellé, closes vim/vim#8383)
vim/vim@affd0bc
vim-patch:8.2.3030: Coverity reports a memory leak
Problem: Coverity reports a memory leak.
Solution: Fix the leak and a few typos. (Dominique Pellé, closes vim/vim#8418)
vim/vim@cb54bc6
Patch v8.2.3022 is mostly N/A but cannot be included here
because of new feature check for "has()".
vim-patch:8.2.3032: build problems with MSVC, other crypt issues with libsodium
Problem: Build problems with MSVC, other crypt issues with libsodium.
Solution: Adjust MSVC makefile. Disable swap file only when 'key' is set.
Adjust error message used when key is wrong. Fix Coverity issues.
(Christian Brabandt, closes vim/vim#8420, closes vim/vim#8411)
vim/vim@226b28b
vim-patch:8.2.3044: Amiga MorphOS and AROS: process ID is not valid
Problem: Amiga MorphOS and AROS: process ID is not valid.
Solution: Use FindTask to return something which is unique to all processes.
(Ola Söder, closes vim/vim#8444)
vim/vim@3a62b14
vim-patch:8.2.3046: Amiga MorphOS: Term mode is set using DOS packets
Problem: Amiga MorphOS: Term mode is set using DOS packets.
Solution: Use the same way of setting term mdoe on all next gen Amiga-like
systems. (Ola Söder, closes vim/vim#8445)
vim/vim@b420ac9
Modern tools may be able to specify a range when outputting the location of the source code.
Quickfix is a common part of Vim, where many plugins output location information to here, and many plugins get location information from here.
The fact that the quickfix entry has range information creates orthogonality between plugins.
For example, we can create a plugin that properly highlights the range specified by quickfix.
For example, even if there are multiple errors on the same line, we can pop up the appropriate error message for the cursor position.
If quickfix doesn't have range information, we can only collect location information and highlight it in one plugin. This is because there is no way to pass information between plugins.
This pull request does not contain any changes regarding errorformat. I think it will be necessary eventually, but first I made a pull request at this stage to see if this proposal would be accepted.
What do you think about this?