Skip to content

Issues with Document Symbols Responses from dotty language server #7673

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

Closed
andreamocci opened this issue Dec 3, 2019 · 0 comments
Closed

Comments

@andreamocci
Copy link
Contributor

In the context of a R&D project we're investigating, we've been recording data provided by the dotty LSP and we found the following issues related to the document symbols responses (spec here):

Ranges. The ranges of symbols correspond to the ranges of their identifiers, not the whole symbol. This has the effect of completely disabling the breadcrumb feature in VSCode and 'flattening' the tree structure of symbols.

Screenshots:

Flattened Symbol Hierarchy

Missing Breadcrumb

Top level methods. The top level methods, at the moment, seem to be wrapped in a synthetic package object, and the language server is returning it. It should be handled as Worksheet wrappers (thus excluding the synthetic container).

Missing symbol kinds. The language server is not returning all the proper symbol kinds - thus, traits and enums are shown as classes, and enum values are shown as fields.

Missing locals. The language server is not showing locals. This is due to the fact that the visitor used to retrieve defs explicitly excludes locals.

Container Names. The container names returned in the document symbol responses should be stripped of the module class suffix as the name of the symbols. However, for synthetic containers of top level methods, one should properly determine the container. Conceptually, top level methods should be contained in the package itself (so the owner of the synthetic package object).

andreamocci added a commit to si-codelounge/dotty that referenced this issue Dec 4, 2019
- Fix failing tests in dotty.tools.languageserver.WorksheetTest
- Fix failing tests in dotty.tools.languageserver.DocumentSymbolTest
- Add tests for top-level decls, enums, type params in DocumentSymbolTest
- Remove erroneous trees and empty owner from document symbols
andreamocci added a commit to si-codelounge/dotty that referenced this issue Dec 9, 2019
- Exclude type and term parameters of synthetic definitions
- Exclude erroneous trees from Interactive.namedTrees traverser
smarter added a commit that referenced this issue Dec 10, 2019
…nses-from-dotty-language-server

Fixes #7673: document symbol responses by language server
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

No branches or pull requests

1 participant