Stream: t-compiler/wg-rls-2.0

Topic: #1314


Jeremy Kolb (May 24 2019 at 14:51, on Zulip):

@matklad how do you recommend replacing the description portions of hover for NameRefKind?

matklad (May 24 2019 at 14:56, on Zulip):

which portions?

Jeremy Kolb (May 24 2019 at 14:58, on Zulip):

basically NavigationTarget.description()

matklad (May 24 2019 at 14:59, on Zulip):

ah

matklad (May 24 2019 at 14:59, on Zulip):

I think that maybe it should be just a field?

matklad (May 24 2019 at 14:59, on Zulip):

which is filled during construction of nav target from HIR?

Jeremy Kolb (May 24 2019 at 15:04, on Zulip):

Oh maybe I misunderstood. I was calling classify_name_ref instead of reference_definition. Is the intent to instead use classify_name_ref on the NavigationTargets returned from reference_definition?

matklad (May 24 2019 at 15:13, on Zulip):

No, the intention is to use classify_name_ref and to consturct Hover from it directly, bypassing NavigationTarget entirely

matklad (May 24 2019 at 15:14, on Zulip):

I think that maybe we shouldn't even have NavTarget::description?

matklad (May 24 2019 at 15:15, on Zulip):

Yeah, seems like it!

matklad (May 24 2019 at 15:15, on Zulip):

We only use descr in doc_text_for

matklad (May 24 2019 at 15:15, on Zulip):

and doc_text_for is used only by hover

matklad (May 24 2019 at 15:16, on Zulip):

so, if we re-base hover to use hir directly (via classify_name_ref), than we can completely remove descr from navigation target an implement it directly in hover

matklad (May 24 2019 at 15:16, on Zulip):

does this make sense?

Jeremy Kolb (May 24 2019 at 15:20, on Zulip):

For the case where the cursor is on a NameRef it does the other cases would still use a NavigationTarget right?

matklad (May 24 2019 at 15:21, on Zulip):

Hm, I think the end state here is when NavigationTarget is used only for goto definition/goto type

matklad (May 24 2019 at 15:22, on Zulip):

For example, for "index resolve case", we can make a helper function, which retruns a Vec<FileSymbol>. These symbols will be converted to nav target by gotodef, and to hover by hover

Jeremy Kolb (May 24 2019 at 15:25, on Zulip):

Okay... so for the other cases in hover that are not NameRef I should use SourceAnalyzer to convert to hir?

matklad (May 24 2019 at 15:27, on Zulip):

yeah

Jeremy Kolb (May 24 2019 at 15:27, on Zulip):

sounds good

Last update: Nov 12 2019 at 15:30UTC