nvim-lua / lsp-status.nvim

Utility functions for getting diagnostic status and progress messages from LSP servers, for use in the Neovim statusline
MIT License
621 stars 41 forks source link

Include structs in `current_function` #48

Closed rileyshahar closed 3 years ago

rileyshahar commented 3 years ago

This would be nice for languages without traditional object-orientation; e.g., rust-analyzer defines a Struct object kind. Should just be a one-line change here: https://github.com/nvim-lua/lsp-status.nvim/blob/60a3ad9dc2f43e0e512c242411541846a86eb7de/lua/lsp-status/current_function.lua#L21

I can submit a PR if you want.

wbthomason commented 3 years ago

Sure, a PR would be great, thank you!

rileyshahar commented 3 years ago

Actually, I think there are some others that might be useful. Maybe this should be configurable? For reference, here's the full list of symbol kinds:

File
Module
Namespace
Package
Class
Method
Property
Field
Constructor
Enum
Interface
Function
Variable
Constant
String
Number
Boolean
Array
Object
Key
Null
EnumMember
Struct
Event
Operator
TypeParameter

I think we want class, method, enum, interface, function, and struct by default, and maybe also module and namespace?

Should I include these in the PR, add a config item, or just add struct like we talked about?

wbthomason commented 3 years ago

I made some comments on the PR, but I also like the idea of making this list configurable.

rileyshahar commented 3 years ago

Makes sense! I followed up on the comments, I'll maybe write a second PR to make it configurable.