question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Find references to fields via getters/setters

See original GitHub issue

I’m using coc-java with jdt.ls v0.60.0.

Currently <Plug>(coc-references) only returns direct usages for class fields. To list references via getters/setters, one has to do coc-references on those methods again. This can be even more inconvenient when Lombok is used, in which case coc only says [coc.nvim] References not found (I have configured VM options correctly I think, as I can see getter/setter completions).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
snjezacommented, Sep 23, 2020

@Frederick888 I will try.

0reactions
Frederick888commented, Sep 22, 2020

@snjeza Thank you!

And by the way – I know I’m probably asking for too much here – will it also be possible to jump from fields to Lombok constructors/builders? For instance, from https://github.com/Frederick888/java-dummy/blob/b38bab6e135e84dc5d181294d719e06e77b4a16e/src/main/java/com/example/demo/dao/Apple.java#L24 to https://github.com/Frederick888/java-dummy/blob/master/src/main/java/com/example/demo/service/impl/AppleTreeServiceImpl.java#L26 ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

@Getter and @Setter - Project Lombok
You can annotate any field with @Getter and/or @Setter , to let lombok generate ... getter/setter generation for any field by using the...
Read more >
How to search for references or open call hierarchy on a getter ...
You can go via the outline view, otherwise, 'find callers' on the field, this will find the generated getX method, then hit the...
Read more >
Code references of setters when using Lombok - Stack Overflow
Typically we could find out how the variable is set by finding the references in the setter or the with arguments constructor. Since...
Read more >
Best Practices for Java Getter and Setter - DZone
In this post, we take a closer look at getter and setter methods in Java, common mistakes, and best practices for combating these...
Read more >
Significance of Getters and Setters in Java - Baeldung
Explore the pros and cons of using getters and setters in Java. ... levels to the fields; for example, the get (read-access) may...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found