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

Add additional symbol kinds for current_function #49

Merged
merged 6 commits into from
Apr 9, 2021
Merged

Add additional symbol kinds for current_function #49

merged 6 commits into from
Apr 9, 2021

Conversation

rileyshahar
Copy link
Contributor

Resolves #48.

This is a larger list of symbol kinds than the original issue, but I think it's justified. These kinds all tend to be top-level, which means you wouldn't lose other information by including these.

There's little reason not to want to display enums, structs, and
interfaces. They tend to be top-level in languages which define them, so
they aren't competing with anything, like some of the smaller symbol
kinds are.

The updated formatting of the conditions is to keep the line length low.
These are also generally top-level, and (based on admittedly limited testing)
don't interfere with other kinds.
This will help people set `kind_labels` by giving them an exhaustive
list of kinds they need to set labels for.
Copy link
Collaborator

@wbthomason wbthomason left a comment

Choose a reason for hiding this comment

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

Thanks, this looks good! I have one naming request for consideration, and one requested style change, but otherwise I think this is good to go.

lua/lsp-status/current_function.lua Outdated Show resolved Hide resolved
doc/lsp-status.txt Show resolved Hide resolved
As suggested by the initial PR review, this significantly improves
readability and maintainability.
Not sure why I thought table keys could be strings.
(Why you don't commit to a PR branch even for minor things.)
@Shatur
Copy link
Contributor

Shatur commented Apr 8, 2021

Is it possible to use built-in require('vim.lsp.protocol').CompletionItemKind? It is not very convenient to set this setting twice.

@wbthomason
Copy link
Collaborator

@Shatur95 Won't that cause issues if users customize CompletionItemKind (e.g. via https://github.com/onsails/lspkind-nvim)?

Also, right now, this is nothing extra to configure. Are you referring to customizing how the current symbol is displayed, or filtering the set of symbol kinds to display?

@Shatur
Copy link
Contributor

Shatur commented Apr 8, 2021

@Shatur95 Won't that cause issues if users customize CompletionItemKind (e.g. via https://github.com/onsails/lspkind-nvim)?

No, this plugins just sets CompletionItemKind in an ordinary way, so should work :)

Also, right now, this is nothing extra to configure. Are you referring to customizing how the current symbol is displayed, or filtering the set of symbol kinds to display?

I was referring to the display settings. I need to set CompletionItemKind and kind_labels separately. But, probably, this is okay, because by default, CompletionItemKind contains just text without icons.

@wbthomason
Copy link
Collaborator

Ah - I think this is actually a different issue, that of unifying kind_labels and CompletionItemKind. I would definitely be OK with using CompletionItemKind as a default for kind_labels, but I think that should happen in a separate PR - this PR is just about expanding the set of kinds which may be displayed, not changing how they're displayed.

@rileyshahar
Copy link
Contributor Author

(+1 to using CompletionItemKind as a default - I think kind_labels should still be configurable, because you might want different labels on your statusline vs for completion items - but I agree that this is completely orthogonal to this PR.)

@Shatur
Copy link
Contributor

Shatur commented Apr 8, 2021

Yes, I just asked, sorry for confusing :)

@wbthomason
Copy link
Collaborator

I think this is good to go. Thanks, @nihilistkitten!

@wbthomason wbthomason merged commit 7c376c3 into nvim-lua:master Apr 9, 2021
@rileyshahar rileyshahar deleted the add-current-function-kinds branch April 9, 2021 06:03
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.

Include structs in current_function
3 participants