| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…ns instead of errors
|
Andy (Andrewkraft) (@Andy-MS) can you run the perf tests as well.. i am concerned about the time and memory we spend building these error messages. one option is to have an additional flag to the checker that the LS sets, but not the command-line compiler, specially that we only need it for one file (open) and not the rest of the program that we will ignore the results of anyways. |
Sorry, something went wrong.
|
Also we need to mark the unused name diagnostic with a new flag to enable the VS tagging behavior. |
Sorry, something went wrong.
|
I think that, to create a good user experience in the editor, we'll want to do more than just report the same diagnostics with a lower severity.
|
Sorry, something went wrong.
There was a problem hiding this comment.
I don't object to checking this in as-is, but I do think there's more work to do.
Sorry, something went wrong.
…asking for a suggestion
|
Mohamed Hegazy (@mhegazy) Please re-review |
Sorry, something went wrong.
| getSuggestionDiagnostics: file => { | ||
| return (suggestionDiagnostics.get(file.fileName) || emptyArray).concat(getUnusedDiagnostics()); | ||
| function getUnusedDiagnostics(): ReadonlyArray<Diagnostic> { | ||
| checkSourceFile(file); |
There was a problem hiding this comment.
So is the idea that getting suggestion diagnostics always triggers type-checking the file? You could make this slightly smarter by only checking the source file if the file itself is a declaration file.
Sorry, something went wrong.
There was a problem hiding this comment.
Done
Sorry, something went wrong.
| messageText: string | DiagnosticMessageChain; | ||
| category: DiagnosticCategory; | ||
| /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */ | ||
| unused?: {}; |
There was a problem hiding this comment.
I'm not big on the name here; try reportingUnused, reportsUnused, or describesUnusedSpan
Sorry, something went wrong.
|
Daniel Rosenwasser (@DanielRosenwasser) Please re-review |
Sorry, something went wrong.
| messageText: string | DiagnosticMessageChain; | ||
| category: DiagnosticCategory; | ||
| /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */ | ||
| reportsUnused?: {}; |
There was a problem hiding this comment.
nit. why not call both this property and the one on DiagnosticMessage isUnused or isUnusedDeclaration
Andrew Casey (@amcasey) what does Roslyn call this property?
Sorry, something went wrong.
There was a problem hiding this comment.
I think you're asking about WellKnownDiagnosticTags.Unnecessary
Sorry, something went wrong.
There was a problem hiding this comment.
a bit weird ... but sure.
Sorry, something went wrong.
There was a problem hiding this comment.
👍 Please check with Andrew Casey (@amcasey) about the name of the property. ideally we would have the same name as Roslyn here.
Sorry, something went wrong.
|
Some tests are still failing. |
Sorry, something went wrong.
|
Andy (Andrewkraft) (@Andy-MS) let's get this change merged. |
Sorry, something went wrong.
|
Mohamed Hegazy (@mhegazy) In which version of TypeScript will this land? Is there a good way to determine this? |
Sorry, something went wrong.
|
Stan Fisher (@StanFisher) Should be in 2.9. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Part of #19392
Fixes #8165 once editors recognize the unused attribute on a diagnostic (Andrew Casey (@amcasey), Matt Bierner (@mjbvz))
We will now always create these diagnostics, but the list we add them to varies based on compiler options.
Also had to change some codeFix tests to use all of their variables to avoid getting extra fixes.