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

Defaults lsp-ui-peek-expand-function to unfold all xref items #46

Closed
MaskRay opened this issue Jan 13, 2018 · 3 comments
Closed

Defaults lsp-ui-peek-expand-function to unfold all xref items #46

MaskRay opened this issue Jan 13, 2018 · 3 comments

Comments

@MaskRay
Copy link
Member

MaskRay commented Jan 13, 2018

It currently displays xref items in the current buffer and folds others. I use (setq lsp-ui-peek-expand-function (lambda (xs) (mapcar #'car xs))) to unfold all files. I wonder if this is a better default to unfold all xref items.

C/C++ has separated header files and .c/.cc/.cpp/.cxx/.... Finding references in C/C++ a.h will likely reveal references in a.cc.

@sebastiencs
Copy link
Member

sebastiencs commented Jan 14, 2018

I really think it's a bad idea.
The issue is, in case there are a lot of files, it would make open them all, which can take a lot of time and unnecessary ressources.
vscode doesn't unfold items in its peek view too.

You can change that behavior with lsp-ui-peek-expand-function but I think the default should be keep as it is now.

@MaskRay
Copy link
Member Author

MaskRay commented Jan 14, 2018

Then provide (lambda (xs) (mapcar #'car xs)) as an alternative expand-function?

Anternatively, if the number of xref items is smaller than a threshold, unfold all?

@MaskRay MaskRay closed this as completed Jan 14, 2018
@sebastiencs
Copy link
Member

The variable lsp-ui-peek-expand-function has been created specifically for this purpose: #8.
The user is free to choose whatever behavior he wants

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

No branches or pull requests

2 participants