mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
* retroactive approach to remove duplicate diagnostics * use code instead of messageText, update test * use existing de-dupe function * rename test and baselines * add fourslash test for better assertion of fix * review feedback: move deduplicate to getDiagnosticsHelper * accept baseline with sorted diagnostics * remove newline
This commit is contained in:
parent
e087992134
commit
65bf850a20
@ -2639,7 +2639,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
|
||||
getDiagnostics: (sourceFile: SourceFile, cancellationToken: CancellationToken | undefined) => readonly T[],
|
||||
cancellationToken: CancellationToken | undefined): readonly T[] {
|
||||
if (sourceFile) {
|
||||
return getDiagnostics(sourceFile, cancellationToken);
|
||||
return sortAndDeduplicateDiagnostics(getDiagnostics(sourceFile, cancellationToken));
|
||||
}
|
||||
return sortAndDeduplicateDiagnostics(flatMap(program.getSourceFiles(), sourceFile => {
|
||||
if (cancellationToken) {
|
||||
|
||||
@ -118,19 +118,6 @@ FsWatchesRecursive::
|
||||
Info 15 [00:00:34.000] response:
|
||||
{
|
||||
"response": [
|
||||
{
|
||||
"start": {
|
||||
"line": 2,
|
||||
"offset": 29
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"offset": 30
|
||||
},
|
||||
"text": "Cannot find name 'y'.",
|
||||
"code": 2304,
|
||||
"category": "error"
|
||||
},
|
||||
{
|
||||
"start": {
|
||||
"line": 1,
|
||||
@ -143,6 +130,19 @@ Info 15 [00:00:34.000] response:
|
||||
"text": "File '/a/b/commonFile2.ts' not found.",
|
||||
"code": 6053,
|
||||
"category": "error"
|
||||
},
|
||||
{
|
||||
"start": {
|
||||
"line": 2,
|
||||
"offset": 29
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"offset": 30
|
||||
},
|
||||
"text": "Cannot find name 'y'.",
|
||||
"code": 2304,
|
||||
"category": "error"
|
||||
}
|
||||
],
|
||||
"responseRequired": true
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Infer parameter types from usage",
|
||||
index: 4,
|
||||
index: 3,
|
||||
newFileContent:
|
||||
`/**
|
||||
* @param {number} a
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
/// <reference path="./fourslash.ts" />
|
||||
|
||||
//// class X {
|
||||
//// foo() {
|
||||
//// return 1;
|
||||
//// }
|
||||
//// get foo() {
|
||||
//// return 1;
|
||||
//// }
|
||||
//// }
|
||||
|
||||
verify.numberOfErrorsInCurrentFile(2);
|
||||
Loading…
x
Reference in New Issue
Block a user