Use related error spans for "implement abstract class" errors
See original GitHub issueFrom https://github.com/microsoft/vscode/issues/78048
TypeScript Version: 3.6.0-dev.20190810
Search Terms:
- abstract class
- related error spans
- diagnostics
Problem For the TypeScript:
abstract class A {
abstract b(): void;
abstract c(): void;
}
class B extends A { }
The typescript server currently generates two errors on B
, one for b
not being implemented and one for c
not being implemented.
Having two errors causes VS Code to show a fix all...
quick fix even though the single implement abstract class
quick fix will resolve both errors. See https://github.com/microsoft/vscode/issues/78048
Proposal
Instead of generating two errors in this case, generate a single, generic diagnostic that states something like: B does not implement all abstract members of A
and on that diagnostic return related spans that state specifically which members are not implemented (b
and c
).
Related Issues:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5 (4 by maintainers)
Top GitHub Comments
Go for it! Start at the checker to consolidate the error messages, and then work within
src/services/codefixes
.Thanks @FlyingPumba!