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

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

Merged

Conversation

nayeemrmn
Copy link
Collaborator

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.

cli/lsp/diagnostics.rs Outdated Show resolved Hide resolved
cli/lsp/diagnostics.rs Show resolved Hide resolved
"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
Collaborator 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