-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
JSDoc @link not resolved across modules #43869
Comments
Actually, this may be wrong -- the workbench seems like it might be slightly buggy. This works only if I import the referenced type. However, with the compiler flag disallowed unused locals, this produces a warning if I don't use the type elsewhere in the file. One fix for that would be to mark linked types as "Used". C# does that in their xml docs. Or just link against all exported globals, but this might direct to the wrong types if they share names. This is the link where I see it in a real program -- which typedoc, when generated, resolves fine https://github.com/connor4312/cosmonaut/blob/18a954f6184173fff999a4616b7cf8554addd966/src/baseModel.ts#L45 |
Cool, I agree that this should probably work, and should probably look through the whole known list of symbols in the current project (that's what I'd expect as a JS user, and I think it matches how the web version of this works). From a dive into this it looks like #41877 never made changes to the gotoDefinition service meaning that it will only work with identifiers in the current scope, and doesn't reach out to search the whole project for an identifier A failing fourslash test: ///<reference path="fourslash.ts" />
// @Filename: foo.ts
//// export interface [|/*def1*/Foo|] {
//// foo: string
//// }
// @Filename: importee.ts
//// /** {@link /*otherFile*/[|Foo|] } not explicitly linked */
//// const f = ""
goTo.marker("otherFile");
verify.goToDefinitionIs("def1"); |
This had a bit of chatter about whether expanding the scope to all identifiers is the right call, so I'll wait till @sandersn is back to chat about that Otherwise, we'll make the un-used import as used if it's in the |
After discussing this with @orta, we switched our opinions. Now I think that expanding the scope to all identifiers is the right call and he doesn't. However: it would be difficult to decide on the precise semantics and difficult to implement efficiently, so I don't think it's worthwhile right now. What should work is import references: |
I'd lean towards solving this one by treating imports that are referenced in a And then for extra credit, to make the experience even more consistent between
|
Bug Report
While verifying microsoft/vscode#119357
π Search Terms
π Version & Regression Information
β― Playground Link
Workbench Repro
π» Code
π Actual behavior
@link Model
is not clickableπ Expected behavior
I expected to be able to click on
@link Model
The text was updated successfully, but these errors were encountered: