-
Notifications
You must be signed in to change notification settings - Fork 717
Handle processing diagnostics similar to Strada #1628
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
testdata/baselines/reference/compiler/processingDiagnosticSkipLibCheck.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//// [tests/cases/compiler/processingDiagnosticSkipLibCheck.ts] //// | ||
|
||
//// [index.d.ts] | ||
/// <reference types="cookie-session"/> | ||
export const foo = 1; | ||
|
||
//// [package.json] | ||
{ | ||
"name": "foo", | ||
"version": "1.0.0", | ||
"types": "index.d.ts" | ||
} | ||
//// [index.ts] | ||
import { foo } from 'foo'; | ||
const y = foo; | ||
|
||
|
||
//// [index.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const foo_1 = require("foo"); | ||
const y = foo_1.foo; |
15 changes: 15 additions & 0 deletions
15
testdata/baselines/reference/compiler/processingDiagnosticSkipLibCheck.symbols
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//// [tests/cases/compiler/processingDiagnosticSkipLibCheck.ts] //// | ||
|
||
=== /index.ts === | ||
import { foo } from 'foo'; | ||
>foo : Symbol(foo, Decl(index.ts, 0, 8)) | ||
|
||
const y = foo; | ||
>y : Symbol(y, Decl(index.ts, 1, 5)) | ||
>foo : Symbol(foo, Decl(index.ts, 0, 8)) | ||
|
||
=== /node_modules/foo/index.d.ts === | ||
/// <reference types="cookie-session"/> | ||
export const foo = 1; | ||
>foo : Symbol(foo, Decl(index.d.ts, 1, 12)) | ||
|
16 changes: 16 additions & 0 deletions
16
testdata/baselines/reference/compiler/processingDiagnosticSkipLibCheck.types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//// [tests/cases/compiler/processingDiagnosticSkipLibCheck.ts] //// | ||
|
||
=== /index.ts === | ||
import { foo } from 'foo'; | ||
>foo : 1 | ||
|
||
const y = foo; | ||
>y : 1 | ||
>foo : 1 | ||
|
||
=== /node_modules/foo/index.d.ts === | ||
/// <reference types="cookie-session"/> | ||
export const foo = 1; | ||
>foo : 1 | ||
>1 : 1 | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,11 @@ Output:: | |
[7m4[0m import { createDog, Dog } from './dog'; | ||
[7m [0m [91m ~~~~~~~[0m | ||
|
||
[96mcore/utilities.ts[0m:[93m1[0m:[93m13[0m - [91merror[0m[90m TS6133: [0m'A' is declared but its value is never read. | ||
|
||
[7m1[0m import * as A from '../animals' | ||
[7m [0m [91m ~[0m | ||
|
||
[96mcore/utilities.ts[0m:[93m1[0m:[93m20[0m - [91merror[0m[90m TS6307: [0mFile '/user/username/projects/demo/animals/index.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern. | ||
The file is in the program because: | ||
Imported via '../animals' from file '/user/username/projects/demo/core/utilities.ts' | ||
|
@@ -154,11 +159,11 @@ Output:: | |
[[90mHH:MM:SS AM[0m] Building project 'zoo/tsconfig.json'... | ||
|
||
|
||
Found 3 errors in 2 files. | ||
Found 4 errors in 2 files. | ||
|
||
Errors Files | ||
2 animals/index.ts[90m:1[0m | ||
1 core/utilities.ts[90m:1[0m | ||
2 core/utilities.ts[90m:1[0m | ||
|
||
//// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* | ||
/// <reference no-default-lib="true"/> | ||
|
@@ -395,11 +400,10 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () | |
"size": 2794 | ||
} | ||
//// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] *new* | ||
{"version":"FakeTSVersion","errors":true,"root":[5],"fileNames":["lib.d.ts","../../animals/animal.ts","../../animals/dog.ts","../../animals/index.ts","../../core/utilities.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}","signature":"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","impliedNodeFormat":1},{"version":"39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}","signature":"4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","impliedNodeFormat":1},{"version":"d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };","signature":"a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n","impliedNodeFormat":1},{"version":"c71a99e072793c29cda49dd3fea04661-import * as A from '../animals'\nexport function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf<T>(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}","signature":"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf<T>(arr: T[]): T | undefined;\n","impliedNodeFormat":1}],"fileIdsList":[[4,5],[2,3],[4]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[[3,1],[4,2],[5,3]],"semanticDiagnosticsPerFile":[1,2,3,4,5],"latestChangedDtsFile":"./utilities.d.ts"} | ||
{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../../animals/animal.ts","../../animals/dog.ts","../../animals/index.ts","../../core/utilities.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}","signature":"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","impliedNodeFormat":1},{"version":"39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}","signature":"4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","impliedNodeFormat":1},{"version":"d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };","signature":"a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n","impliedNodeFormat":1},{"version":"c71a99e072793c29cda49dd3fea04661-import * as A from '../animals'\nexport function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf<T>(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}","signature":"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf<T>(arr: T[]): T | undefined;\n","impliedNodeFormat":1}],"fileIdsList":[[4,5],[2,3],[4]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[[3,1],[4,2],[5,3]],"semanticDiagnosticsPerFile":[[4,[{"pos":19,"end":29,"code":6307,"category":1,"message":"File '/user/username/projects/demo/animals/animal.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern."},{"pos":86,"end":93,"code":6307,"category":1,"message":"File '/user/username/projects/demo/animals/dog.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern."}]],[5,[{"pos":12,"end":13,"code":6133,"category":1,"message":"'A' is declared but its value is never read.","reportsUnnecessary":true},{"pos":19,"end":31,"code":6307,"category":1,"message":"File '/user/username/projects/demo/animals/index.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern.","messageChain":[{"noFile":true,"pos":-1,"end":-1,"code":1430,"category":3,"message":"The file is in the program because:","messageChain":[{"noFile":true,"pos":-1,"end":-1,"code":1393,"category":3,"message":"Imported via '../animals' from file '/user/username/projects/demo/core/utilities.ts'"},{"noFile":true,"pos":-1,"end":-1,"code":1393,"category":3,"message":"Imported via '.' from file '/user/username/projects/demo/animals/dog.ts'"}]}],"relatedInformation":[{"file":3,"pos":19,"end":22,"code":1399,"category":3,"message":"File is included via import here."}]}]]],"latestChangedDtsFile":"./utilities.d.ts"} | ||
//// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* | ||
{ | ||
"version": "FakeTSVersion", | ||
"errors": true, | ||
"root": [ | ||
{ | ||
"files": [ | ||
|
@@ -513,14 +517,86 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () | |
] | ||
}, | ||
"semanticDiagnosticsPerFile": [ | ||
"lib.d.ts", | ||
"../../animals/animal.ts", | ||
"../../animals/dog.ts", | ||
"../../animals/index.ts", | ||
"../../core/utilities.ts" | ||
[ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I could tell, these new errors are correct and show up in the Strada baselines for these tests. |
||
"../../animals/index.ts", | ||
[ | ||
{ | ||
"pos": 19, | ||
"end": 29, | ||
"code": 6307, | ||
"category": 1, | ||
"message": "File '/user/username/projects/demo/animals/animal.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern." | ||
}, | ||
{ | ||
"pos": 86, | ||
"end": 93, | ||
"code": 6307, | ||
"category": 1, | ||
"message": "File '/user/username/projects/demo/animals/dog.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern." | ||
} | ||
] | ||
], | ||
[ | ||
"../../core/utilities.ts", | ||
[ | ||
{ | ||
"pos": 12, | ||
"end": 13, | ||
"code": 6133, | ||
"category": 1, | ||
"message": "'A' is declared but its value is never read.", | ||
"reportsUnnecessary": true | ||
}, | ||
{ | ||
"pos": 19, | ||
"end": 31, | ||
"code": 6307, | ||
"category": 1, | ||
"message": "File '/user/username/projects/demo/animals/index.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern.", | ||
"messageChain": [ | ||
{ | ||
"noFile": true, | ||
"pos": -1, | ||
"end": -1, | ||
"code": 1430, | ||
"category": 3, | ||
"message": "The file is in the program because:", | ||
"messageChain": [ | ||
{ | ||
"noFile": true, | ||
"pos": -1, | ||
"end": -1, | ||
"code": 1393, | ||
"category": 3, | ||
"message": "Imported via '../animals' from file '/user/username/projects/demo/core/utilities.ts'" | ||
}, | ||
{ | ||
"noFile": true, | ||
"pos": -1, | ||
"end": -1, | ||
"code": 1393, | ||
"category": 3, | ||
"message": "Imported via '.' from file '/user/username/projects/demo/animals/dog.ts'" | ||
} | ||
] | ||
} | ||
], | ||
"relatedInformation": [ | ||
{ | ||
"file": "../../animals/dog.ts", | ||
"pos": 19, | ||
"end": 22, | ||
"code": 1399, | ||
"category": 3, | ||
"message": "File is included via import here." | ||
} | ||
] | ||
} | ||
] | ||
] | ||
], | ||
"latestChangedDtsFile": "./utilities.d.ts", | ||
"size": 3178 | ||
"size": 4652 | ||
} | ||
//// [/user/username/projects/demo/lib/core/utilities.d.ts] *new* | ||
export declare function makeRandomName(): string; | ||
|
@@ -658,11 +734,11 @@ function createZoo() { | |
|
||
core/tsconfig.json:: | ||
SemanticDiagnostics:: | ||
*not cached* /home/src/tslibs/TS/Lib/lib.d.ts | ||
*not cached* /user/username/projects/demo/animals/animal.ts | ||
*not cached* /user/username/projects/demo/animals/dog.ts | ||
*not cached* /user/username/projects/demo/animals/index.ts | ||
*not cached* /user/username/projects/demo/core/utilities.ts | ||
*refresh* /home/src/tslibs/TS/Lib/lib.d.ts | ||
*refresh* /user/username/projects/demo/animals/animal.ts | ||
*refresh* /user/username/projects/demo/animals/dog.ts | ||
*refresh* /user/username/projects/demo/animals/index.ts | ||
*refresh* /user/username/projects/demo/core/utilities.ts | ||
Signatures:: | ||
(stored at emit) /user/username/projects/demo/animals/animal.ts | ||
(stored at emit) /user/username/projects/demo/animals/dog.ts | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nit (sorry)