-
Notifications
You must be signed in to change notification settings - Fork 219
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
Report diagnostics for unused "using" and "import" so that they will be shown properly in ide #5146
base: main
Are you sure you want to change the base?
Conversation
All changed packages have been documented.
Show changes
|
// the projection statements will only be processed when applying projection. There is no way to determine | ||
// whether "import" or "using" is referenced from them, so we just skip here to avoid providing incorrect suggestions (diagnostics) | ||
// This should be fine for now considering projection is an experiemental feature. | ||
for (const node of processedProjections) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timotheeguerin , I tried to check the project part code and can't find a way to identify the references as commented here. Please let me know if there is some way I missed to count them considering my knowledge in compiler is still limited. thanks.
You can try these changes here
|
@@ -164,6 +169,7 @@ export async function createSourceLoader( | |||
if (options?.getCachedScript) { | |||
const old = options.getCachedScript(file); | |||
if (old?.file === file && deepEquals(old.parseOptions, options.parseOptions)) { | |||
mutate(old).importedBy = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timotheeguerin , I am not very comfortable modifying the old object here, but I can't find a better place to put the importedBy information. Any suggestion here?
When "using" and "import" are not needed, dim them and provide quickfix in IDE.
related issues:
#3373 , #4861