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

How to enable float window to show diagnostic information temporarily for this line? #4633

Closed
wyg1997 opened this issue May 9, 2023 · 4 comments · Fixed by #4642
Closed

Comments

@wyg1997
Copy link

wyg1997 commented May 9, 2023

Is your feature request related to a problem? Please describe.

I set "diagnostic.messageTarget": "echo" in coc-setting.json, but sometimes I want to open float window to see detail information with diagnostic.

Describe the solution you'd like

Provide a CocAction or other way to open the diagnostic information for this line with a float window.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@fannheyward
Copy link
Member

fannheyward commented May 10, 2023

You can use :call CocAction('diagnosticPreview') to open the diagnostic info in Preview window (:help preview-window) .

:call CocActionAsync('diagnosticInfo') is used to show diagnostic info, but this is also following messageTarget.

@wyg1997
Copy link
Author

wyg1997 commented May 10, 2023

Yes I have tried using CocAction('diagnosticPreview') but feel the display is not as good as the float window.

I installed some plugins which caused me to have too much diagnostic information, and using the float window by default caused a lot of trouble in development.

I don't know if there is a way to balance the advantages of both, so that I can summon the float window when I need it. May I ask if you think this is a necessary requirement?

@fannheyward
Copy link
Member

some plugins which caused me to have too much diagnostic information

I didn't use any other plugins to show diagnostic in floating window, only one window on the diagnostic position.

A forward-compatible solution: add target param in CocActionAsync('diagnosticInfo', target), by default it's messageTarget, user can override the message showing.

@wyg1997
Copy link
Author

wyg1997 commented May 10, 2023

A forward-compatible solution: add target param in CocActionAsync('diagnosticInfo', target), by default it's messageTarget, user can override the message showing.

I think this method is very flexible and convenient, and can perfectly meet my needs!

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 a pull request may close this issue.

2 participants