scalameta / metals-zed

Zed plugin for Metals
Apache License 2.0
45 stars 10 forks source link

Anonymous givens are not in the outline #4

Open bishabosha opened 4 months ago

bishabosha commented 4 months ago
class Bar:
  def foo: Int = 23
  given Foo()
  given baz: Baz()

The outline would only show

- Bar {}
  - foo
  - baz

i.e. missing the anonymous Foo given.

the name isn't visible in the AST, (compiler generates given_Foo) but it would be good to provide some placeholder there (is this possible?)

filipwiech commented 4 months ago

It's worth noting that tree-sitter outline queries will be used to chunk files, to help power the LLM integrations (semantic index), see for example https://github.com/zed-industries/zed/pull/11283 and https://github.com/zed-industries/zed/pull/10329, although I don't know what the exact impact of this could be here, if any. :+1: