Sitelet https://github.com/nvim-lua/lsp-status.nvim/pull/49
Skip to content

Add additional symbol kinds for current_function - #49

Merged
wbthomason merged 6 commits into
nvim-lua:masterfrom
rileyshahar:add-current-function-kinds
Apr 9, 2021
Merged

wbthomason merged 6 commits into
nvim-lua:masterfrom
rileyshahar:add-current-function-kinds

Conversation

@rileyshahar

Copy link
Copy Markdown
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.

@wbthomason wbthomason left a comment

Copy link
Copy Markdown
Collaborator

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.

Comment thread lua/lsp-status/current_function.lua Outdated
Comment thread doc/lsp-status.txt
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

Shatur commented Apr 8, 2021 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

Shatur commented Apr 8, 2021 •

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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
Copy Markdown
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

Shatur commented Apr 8, 2021

Copy link
Copy Markdown
Contributor

Yes, I just asked, sorry for confusing :)

@wbthomason

Copy link
Copy Markdown
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