Git Product home page Git Product logo

Comments (7)

olafurpg avatar olafurpg commented on June 14, 2024 1

Wow, that would be super cool to support! scala.meta.Symbol is an ADT with cases

  • Symbol.None
  • Symbol.Local, these are definitions inside local blocks, can't be globally referenced
  • Symbol.Global, this one is the one you're looking for, you can create hierarchical data structures from it with .owner/.signature
  • Symbol.Multi

Source https://github.com/scalameta/scalameta/blob/23de1ca839e53ad6387981bd7cced35122a2cf76/langmeta/shared/src/main/scala/org/langmeta/semanticdb/Symbol.scala#L24

To get the SymbolKind of a symbol you need the Denotation from https://github.com/scalameta/language-server/blob/04ff21002da48ea293dbed9ad99efbb366198d0e/metaserver/src/main/scala/scala/meta/languageserver/SymbolIndexer.scala#L23

from metals.

laughedelic avatar laughedelic commented on June 14, 2024

OK. Thanks for the references. I'll submit a PR shortly. Didn't solve it completely, but got something.

from metals.

olafurpg avatar olafurpg commented on June 14, 2024

You probably have to change the signature of SymbolIndexer.documentSymbols to include the Symbol.Global from here

https://github.com/scalameta/language-server/blob/04ff21002da48ea293dbed9ad99efbb366198d0e/metaserver/src/main/scala/scala/meta/languageserver/SymbolIndexer.scala#L36

and then use Symbol.Global.owner.syntax as the container name.

from metals.

laughedelic avatar laughedelic commented on June 14, 2024

Thanks. I actually moved the implementation to SymbolIndexer.documentSymbols and changed its return type to Seq[SymbolInformation]. Is it ok or should I be more conservative with the interface?

from metals.

laughedelic avatar laughedelic commented on June 14, 2024

Symbols's syntax is definitely not what we want here because name is what is shown directly in the GUI, and containerName has to refer to the same name parent symbol has.

from metals.

olafurpg avatar olafurpg commented on June 14, 2024

Fixed by #34 @laughedelic ?

from metals.

laughedelic avatar laughedelic commented on June 14, 2024

Yes, let's close it. The nested hierarchy issue is resolved by #34. It still needs improvements, but it will be addressed in another PR.

from metals.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.