- This topic has 3 replies, 2 voices, and was last updated 7 years, 5 months ago by support-swapna.
-
AuthorPosts
-
Fedor LosevParticipant1) When file with the error is closed, quick fix is suggested but does nothing. When relevant file editor is opened, quick fix removes the declaration properly.
Expected: should work like any other fix, no file is required to be open.
2) Does not work on multiple errors: ‘The selected problems do not have a common applicable quick fix’. Expected: should work for multiple ‘never used’ errors.
Unused errors frequently come in large bursts, making this quick fix completely pointless, now it is faster to remove by hand.
support-swapnaModeratorFedor,
I see the error markers on a closed file go away when I apply the Quick Fix from the Markers view. It did not require me to open the file in the editor.
Can you please share with us the exact error details for which the Quick Fix does not work unless the file is opened in the editor to help us investigate further?
I have filed an enhancement request for the dev team to work on the quick fix for multiple ‘never used’ errors.
Thank you for raising it.
–Swapna
MyEclipse Support
Fedor LosevParticipantHi Swapna, I wrote the exact error in the title, “xx is declared but never used”.
To reproduce:
Add any unused import, say add
import { Component } from '@angular/core';
to empty ts file.
Put"noUnusedLocals": true,
in tsconfig compilerOptions.'Component' is declared but never used
error will appear. Select the error in Problems or Markers view and apply the quick fix.– Apply quick fix for this error when file is closed. Import is not removed, nothing happens. Expected: import is removed.
– Open the file without changes and apply the fix (in Problems or Markers view). The import is removed in editor but the file is not saved and the editor becomes unsaved. Expected: the import is removed without changing the editor to the unsaved state.
– Open the file, make some changes without saving and apply the fix. Import is not removed and there is an NPE error in eclipse log. Expected: either should work like the fix was applied from an inline editor error marker (which works in this case) or display a message “can’t apply this quick fix to unsaved files”.
support-swapnaModeratorFedor,
Thank you for the detailed steps. While I could replicate the inconsistent behavior with the Quick Fix, I could not replicate the problem when the Quick Fix is applied without saving the file. The Import is removed and no NPE is logged at my end.
Are you working with the latest version i.e CI 6a which released on Friday?
Can you please also share the .log file located at workspace dir/.metadata/.log for further investigation?–Swapna
MyEclipse Support -
AuthorPosts