sts4 icon indicating copy to clipboard operation
sts4 copied to clipboard

[improvement] categorize symbols in the symbole view.

Open gayanper opened this issue 3 years ago • 3 comments

It would be nice if the symbols can be categorize based on their type. Specially the request mappings. May be the symbols view can also be grouped by the project and have support for filter by workingsets

gayanper avatar Nov 06 '20 19:11 gayanper

Hey @gayanper, thanks for suggesting this. I would like to understand this a bit better and in more depth.

Regarding the categorization: At the moment, the Spring symbols in general are prefixed specifically for each "type" of symbol. Every request mapping symbol starts with @/, every bean symbol with @+, every function with @>. The default symbols for spring annotations start purely with @.

What do you have in mind when you think about the categorization?

Regarding the grouping: In the symbols view in Eclipse you can select workspace, file and project as the scope for the symbols to display (the same is available for the in-place symbol popup in Eclipse). Do you have something different in mind?

The working set is indeed not being taken into account because it is a concept that is around in Eclipse only and not really present in the language server. The views in Eclipse could take that into account and do some additional filtering, that would be possible. But that would be available in Eclipse only. Any thoughts on this?

martinlippert avatar Nov 07 '20 18:11 martinlippert

@martinlippert below are more details Regarding the categorization: I was thinking of making them as expandable groups, like we had in sts3 if i remember correct. So for example it will start with Bean, RequestMappings, Functions and icon expand each of this branch to see the symbol definitions.

Regarding the grouping: This is on top of the categorization. When we list all symbols from workspace it would be nice to have something like this

Project | -- Beans | -- Request Mappings | -- Functions

which can expand and navigate.

gayanper avatar Nov 07 '20 19:11 gayanper

It seems like a good idea, but may be a little tricky to actually define properly how to classify the symbols.

I'm not sure that we can easily classify symbols into 'types' in a non-ambiguous way. I guess we'd have to go based on the type of the annotation but that may not be unambiguous. For example a RM annotated with @GetMapping... is that a @RequestMapping (I guess yes, it is). But it is also a @GetMapping which is a more specific 'subtype'. So do we classify this as RequestMapping only, as GetMapping only or as both at the same time? If 'both' then symbols would show up multpile times in the view under different classifications.

And yes, we can probably answer this particular example, and just decide that @RequestMapping is the type to use. But the problem is how do this for every possible Spring annotation in a general way?

Also, if it is based on the annotation type, then it wouldn't work for symbols that are derived from 'functional' bean definitions or other methods to define beans (e.g. xml).

If we can come up with a way to classify them by type reliably, then we can base a view on that as well. But right now, I'm not sure how we'd classify all the symbols.

kdvolder avatar Nov 09 '20 19:11 kdvolder