Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a descriptive quickfix/location list title. #1004

Merged
merged 5 commits into from
Nov 25, 2016

Conversation

datanoise
Copy link
Contributor

Currently, the w:quickfix_title is being automatically set to the actual
Vim command that populates quickfix/location list. For example, running
any Guru command it will be displayed as : lgetexpr a:items which
is not really informative.

@fatih
Copy link
Owner

fatih commented Aug 20, 2016

Can you show an after/before screenshot? For example I've introduced a syntx error, but :GoFmt was not able to parse it and it errored. And a :GoBuild just displayed a normal quickfix list without any name.

@datanoise
Copy link
Contributor Author

It depends on if you are using %q in your statusline configuration. %q will display the type of the quickfix window (Quickfix or Location List) and the command that was used to generate this list.

GoBuild displays the title correctly:

[Quickfix List] :go build . errors

but GoFmt would display:

[Location List] :setloclist()

because the location list was set explicitly with setloclist() function without specifying any title.

@fatih
Copy link
Owner

fatih commented Sep 13, 2016

@datanoise This is something I want to merge definitely. I have some tasks on the vim-8.0 branch, I'll take another stab once I've merged it to master. Thanks for the work. I'll merge it if there is no problem or try to give a feedback if needed any.

@fatih
Copy link
Owner

fatih commented Nov 23, 2016

@datanoise can you please rebase against master if possible?

@datanoise
Copy link
Contributor Author

Yes. Working on it.

@@ -106,7 +106,7 @@ function! s:guru_cmd(args) range abort
endfunction

" sync_guru runs guru in sync mode with the given arguments
function! s:sync_guru(args) abort
function! s:sync_guru(args, title) abort
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

title should be a part of args. If you check args you'll see that I'm just passing a single dict because otherwise the number of arguments ot this functions increase over time. I think you even don't need title here, just use a:args.mode which already contains the mode and is the same as title.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, good point. I'll fix it.

@@ -235,7 +235,7 @@ function! go#guru#Implements(selected) abort
\ 'needs_scope': 1,
\ }

call s:run_guru(args)
call s:run_guru(args, 'Implements')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all run_guru functions should be fixed as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right. I pushed too early. it should be fixed now.

@fatih
Copy link
Owner

fatih commented Nov 24, 2016

Just tested it locally, but it doesn't work for me. This is what I got for :GoBuild

image

Can you please search for Populate(...) functions. For example there is one in job.vim which is the case for my error.

@datanoise
Copy link
Contributor Author

it should be fixed now.

@fatih
Copy link
Owner

fatih commented Nov 24, 2016

I've pulled the changes and tried :GoMetaLinter for the following code: https://play.golang.org/p/lZwwR-vXQl

However I don't see :GoMetaLinter in the title yet:

screen_shot_2016-11-24_at_10_41_04_pm

@datanoise
Copy link
Contributor Author

I'll check it later today. I suspect that there are still cases where I didn't propagate the title.

Kent Sibilev added 5 commits November 24, 2016 22:30
Currently, the w:quickfix_title is being automatically set to the actual
Vim command that populates quickfix/location list. For example, running
any Guru command it will be displayed as ':    lgetexpr a:items' which
is not really informative.
@fatih
Copy link
Owner

fatih commented Nov 25, 2016

Thanks @datanoise 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants