VS Code和Java Outline:类的继承字段/方法?

huangapple 未分类评论55阅读模式
英文:

VS Code and Java Outline: Inherited Fields/Methods of a Class?

问题

在VS Code中,有没有办法显示从父类继承的字段和方法?

我有这个基类:

  1. public abstract class BaseModel {
  2. @Transient
  3. public String SEQUENCE_NAME;
  4. @Id
  5. public long id;
  6. public long getId() {
  7. return id;
  8. }
  9. public void setId(long id) {
  10. this.id = id;
  11. }

以及它的子类:

  1. public class NavigationMenuItem extends BaseModel {
  2. private String text;
  3. private String path;
  4. public NavigationMenuItem(String text, String path) {
  5. SEQUENCE_NAME = "navigation_menu_item_sequence";
  6. this.setText(text);
  7. this.setPath(path);
  8. }
  9. public String getText() {
  10. return text;
  11. }
  12. public void setText(String text) {
  13. this.text = text;
  14. }
  15. public String getPath() {
  16. return path;
  17. }
  18. public void setPath(String path) {
  19. this.path = path;
  20. }
  21. }

在VS Code的Java Outline窗格中,它只显示了NavigationMenuItem类的字段和方法。

是否有办法也包括父类的字段和方法?

英文:

Is there a way for VS code to display fields/methods inherited from a super class?

I have this base class:

  1. public abstract class BaseModel {
  2. @Transient
  3. public String SEQUENCE_NAME;
  4. @Id
  5. public long id;
  6. public long getId() {
  7. return id;
  8. }
  9. public void setId(long id) {
  10. this.id = id;
  11. }

and it's child class

  1. public class NavigationMenuItem extends BaseModel {
  2. private String text;
  3. private String path;
  4. public NavigationMenuItem(String text, String path) {
  5. SEQUENCE_NAME = "navigation_menu_item_sequence";
  6. this.setText(text);
  7. this.setPath(path);
  8. }
  9. public String getText() {
  10. return text;
  11. }
  12. public void setText(String text) {
  13. this.text = text;
  14. }
  15. public String getPath() {
  16. return path;
  17. }
  18. public void setPath(String path) {
  19. this.path = path;
  20. }
  21. }

in VS Code Java Outline pane, it's only showing fields/methods from NavigationMenuItem .

Is there a way to also include the parent fields/methods?

huangapple
  • 本文由 发表于 2020年7月26日 10:09:36
  • 转载请务必保留本文链接:https://java.coder-hub.com/63095423.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定