Skip to content
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

graph does not analyze JSDoc imports #91

Closed
kitsonk opened this issue Dec 20, 2021 · 1 comment · Fixed by #92
Closed

graph does not analyze JSDoc imports #91

kitsonk opened this issue Dec 20, 2021 · 1 comment · Fixed by #92
Assignees
Labels
enhancement New feature or request

Comments

@kitsonk
Copy link
Contributor

kitsonk commented Dec 20, 2021

https://github.com/denoland/deno/blob/1eb78731eb57b1d0eb7c0ece97b2018c1724989e/cli/lsp/documents.rs#L1025-L1059

This is where it goes wrong. Because the dependencies list is empty, it fails to resolve the imported module.
I think think it might be possible to fix this without making changes to swc.
If you add a regular import at the top of a file, that fixes the jsdoc import:

import {Bar} from "./Bar.js";

/** @type {import("./Bar.js").Bar} */
const foo = null;

Originally posted by @jespertheend in https://github.com/denoland/vscode_deno/issues/588#issuecomment-998330173

@kitsonk kitsonk changed the title https://github.com/denoland/deno/blob/1eb78731eb57b1d0eb7c0ece97b2018c1724989e/cli/lsp/documents.rs#L1025-L1059 graph does not analyze JSDoc imports Dec 20, 2021
@kitsonk kitsonk added the enhancement New feature or request label Dec 20, 2021
@kitsonk
Copy link
Contributor Author

kitsonk commented Dec 20, 2021

deno_graph does not currently analyze JSDoc imports, which means that modules imported in JSDoc are not included in the dependency graph, which means they are not available to tsc during type checking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant