Skip to content

fix(lsp): show dependency errors for repeated imports#18807

Merged
dsherret merged 6 commits intodenoland:mainfrom
nayeemrmn:lsp-diagnostics-for-duplicate-imports
Apr 24, 2023
Merged

fix(lsp): show dependency errors for repeated imports#18807
dsherret merged 6 commits intodenoland:mainfrom
nayeemrmn:lsp-diagnostics-for-duplicate-imports

Conversation

@nayeemrmn
Copy link
Contributor

This was missing because deno_graph didn't store every import site for a dependency until denoland/deno_graph#251.

Before

image

After

image

@bartlomieju bartlomieju requested a review from dsherret April 23, 2023 19:48
@bartlomieju
Copy link
Member

@nayeemrmn could you bump deno_graph dependency in this PR?

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just needs a few small changes.

"file:///a.ts",
r#"
import "bad.js";
import "bad.js";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe try adding a test with multiple bad @deno-types directives as well?

Copy link
Contributor Author

@nayeemrmn nayeemrmn Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one @deno-types directive is stored per JS dep, that would be addressed by denoland/deno_graph#272 Edit: actually no it should ignore @deno-types for deps which already have one attached.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @nayeemrmn!

@dsherret dsherret enabled auto-merge (squash) April 24, 2023 23:24
@dsherret dsherret merged commit 667acb0 into denoland:main Apr 24, 2023
@nayeemrmn nayeemrmn deleted the lsp-diagnostics-for-duplicate-imports branch April 25, 2023 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants