Comments (7)
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
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.
OK. Thanks for the references. I'll submit a PR shortly. Didn't solve it completely, but got something.
from metals.
You probably have to change the signature of SymbolIndexer.documentSymbols to include the Symbol.Global from here
and then use Symbol.Global.owner.syntax
as the container name.
from metals.
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.
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.
Fixed by #34 @laughedelic ?
from metals.
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)
- HoverDocSuite fails on JDK 22-ea HOT 1
- Debugging "Unknown Source" and "Unsupported evaluation in unmanaged classpath entry" in VSCode. HOT 6
- Errors aren't being reported on scala-cli scripts runs HOT 3
- Refactor 'Extract Class' does not work for Opaque types with companion objects
- Completions invoked from java files only work for stdlib types
- Go to definition doesn't work for type when instantiating anonymous class HOT 6
- LSP rename causes build server error
- Synthetic decorations on `val` with unapply
- Missing dot-completion on higher-order function HOT 3
- `documentHighlight` a for `=>` is a bit odd HOT 4
- `documentHighlight` in map is reversed HOT 1
- Clients that aren't inline decoration providers are now getting decorations that they shouldn't
- Action to add an import to the Scala-CLI script puts it before the shebang.
- `Show inferred types` mode distorts how shebang is displayed
- Crashes and restarts, error lines flashing HOT 4
- Incorrect symbol highlight in anonymous function with `case` HOT 2
- Cannot discover test frameworks HOT 3
- Go to Implementation doesn't find anonymous instantiations with SAM conversion HOT 4
- Hover doesn't work in some cases (deep call chain with terse syntax)
- Highlight/rename doesn't work for primary constructor call when type params are not explicitly passed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metals.