Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for class, class types and methods in DocumentSymbol #1487

Merged
merged 5 commits into from
Feb 28, 2025

Conversation

xvw
Copy link
Collaborator

@xvw xvw commented Feb 25, 2025

Should resolve #1449

@xvw xvw requested review from trefis and voodoos February 25, 2025 14:57
@xvw xvw force-pushed the document-symbol-for-class-and-class-types branch from 109e180 to e317de2 Compare February 25, 2025 14:58
~kind:Class
~range:(Range.of_loc decl.pci_loc)
~selectionRange:(Range.of_loc decl.pci_name.loc)
~children:(visit_class_sig decl.pci_expr)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you don't rely on the iterator for nested symbols like it's done in other cases, isn't there a risk that we would miss some of these nested symbols ?

Like x in class a = object method f = let x = 42 in x end ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure you want to return that x, local value are usually not listed AFAICT (but don't take my word for it)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question. From my (perhaps clumsy) point of view, I get the impression that we want to be able to navigate in all outlines, don't we?

Copy link
Collaborator

@voodoos voodoos Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it in vscode before writing my comment, and local values do show in the "outline",but maybe that's another request ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@xvw xvw changed the title Add support for class, class types and methods in DocumentSymbol Draft: Add support for class, class types and methods in DocumentSymbol Feb 25, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 4767

Details

  • 30 of 46 (65.22%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.7%) to 22.906%

Changes Missing Coverage Covered Lines Changed/Added Lines %
ocaml-lsp-server/src/document_symbol.ml 30 46 65.22%
Files with Coverage Reduction New Missed Lines %
ocaml-lsp-server/src/document_symbol.ml 2 33.33%
Totals Coverage Status
Change from base Build 4763: 0.7%
Covered Lines: 5852
Relevant Lines: 25548

💛 - Coveralls

@coveralls
Copy link

coveralls commented Feb 25, 2025

Pull Request Test Coverage Report for Build 4771

Details

  • 32 of 53 (60.38%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.8%) to 22.978%

Changes Missing Coverage Covered Lines Changed/Added Lines %
ocaml-lsp-server/src/document_symbol.ml 32 53 60.38%
Files with Coverage Reduction New Missed Lines %
ocaml-lsp-server/src/document_symbol.ml 2 41.58%
Totals Coverage Status
Change from base Build 4763: 0.8%
Covered Lines: 5872
Relevant Lines: 25555

💛 - Coveralls

@xvw xvw changed the title Draft: Add support for class, class types and methods in DocumentSymbol Add support for class, class types and methods in DocumentSymbol Feb 26, 2025
@xvw
Copy link
Collaborator Author

xvw commented Feb 26, 2025

The PR is reviewable!

@voodoos
Copy link
Collaborator

voodoos commented Feb 28, 2025

Thanks Xavier, looks good to go.

@voodoos voodoos merged commit 83000eb into ocaml:master Feb 28, 2025
6 checks passed
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.

documentSymbol missing elements
4 participants