Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion internal/execute/incremental/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ func (p *Program) ensureHasErrorsForState(ctx context.Context, program *compiler
len(program.GetConfigFileParsingDiagnostics()) > 0 ||
len(program.GetSyntacticDiagnostics(ctx, nil)) > 0 ||
len(program.GetProgramDiagnostics()) > 0 ||
len(program.GetBindDiagnostics(ctx, nil)) > 0 ||
len(program.GetOptionsDiagnostics(ctx)) > 0 ||
len(program.GetGlobalDiagnostics(ctx)) > 0 {
p.snapshot.hasErrors = core.TSTrue
Expand Down
28 changes: 28 additions & 0 deletions internal/execute/tsctests/tsc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,34 @@ func TestTscIncremental(t *testing.T) {
},
},
},
{
subScenario: "when there is bind diagnostics thats ignored",
files: FileMap{
"/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
{
"compilerOptions": {
"skipLibCheck": true,
"incremental": true,
}
}`),
"/home/src/workspaces/project/a.ts": `export const a = 10;`,
"/home/src/workspaces/project/b.d.ts": stringtestutil.Dedent(`
interface NoName {
Profiler: new ({ sampleInterval: number, maxBufferSize: number }) => {
stop: () => Promise<any>;
};
}
`),
},
commandLineArgs: []string{""},
edits: []*tscEdit{
noChange,
{
caption: "no change and tsc -b",
commandLineArgs: []string{"-b", "-v"},
},
},
},
}

for _, test := range testCases {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
currentDirectory::/home/src/workspaces/project
useCaseSensitiveFileNames::true
Input::
//// [/home/src/workspaces/project/a.ts] *new*
export const a = 10;
//// [/home/src/workspaces/project/b.d.ts] *new*
interface NoName {
Profiler: new ({ sampleInterval: number, maxBufferSize: number }) => {
stop: () => Promise<any>;
};
}
//// [/home/src/workspaces/project/tsconfig.json] *new*
{
"compilerOptions": {
"skipLibCheck": true,
"incremental": true,
}
}

tsgo
ExitStatus:: Success
Output::
//// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib*
/// <reference no-default-lib="true"/>
interface Boolean {}
interface Function {}
interface CallableFunction {}
interface NewableFunction {}
interface IArguments {}
interface Number { toExponential: any; }
interface Object {}
interface RegExp {}
interface String { charAt: any; }
interface Array<T> { length: number; [n: number]: T; }
interface ReadonlyArray<T> {}
interface SymbolConstructor {
(desc?: string | number): symbol;
for(name: string): symbol;
readonly toStringTag: symbol;
}
declare var Symbol: SymbolConstructor;
interface Symbol {
readonly [Symbol.toStringTag]: string;
}
declare const console: { log(msg: any): void; };
//// [/home/src/workspaces/project/a.js] *new*
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.a = void 0;
exports.a = 10;

//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new*
{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.d.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},"3a1e9965f8602302ee6ae53756eac8be-export const a = 10;",{"version":"53a40371b72faeca3dac96d61d6fb24f-interface NoName {\n Profiler: new ({ sampleInterval: number, maxBufferSize: number }) => {\n stop: () => Promise<any>;\n };\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"skipLibCheck":true}}
//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new*
{
"version": "FakeTSVersion",
"root": [
{
"files": [
"./a.ts",
"./b.d.ts"
],
"original": [
2,
3
]
}
],
"fileNames": [
"lib.d.ts",
"./a.ts",
"./b.d.ts"
],
"fileInfos": [
{
"fileName": "lib.d.ts",
"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; };",
"signature": "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": "CommonJS",
"original": {
"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
}
},
{
"fileName": "./a.ts",
"version": "3a1e9965f8602302ee6ae53756eac8be-export const a = 10;",
"signature": "3a1e9965f8602302ee6ae53756eac8be-export const a = 10;",
"impliedNodeFormat": "CommonJS"
},
{
"fileName": "./b.d.ts",
"version": "53a40371b72faeca3dac96d61d6fb24f-interface NoName {\n Profiler: new ({ sampleInterval: number, maxBufferSize: number }) => {\n stop: () => Promise<any>;\n };\n}",
"signature": "53a40371b72faeca3dac96d61d6fb24f-interface NoName {\n Profiler: new ({ sampleInterval: number, maxBufferSize: number }) => {\n stop: () => Promise<any>;\n };\n}",
"affectsGlobalScope": true,
"impliedNodeFormat": "CommonJS",
"original": {
"version": "53a40371b72faeca3dac96d61d6fb24f-interface NoName {\n Profiler: new ({ sampleInterval: number, maxBufferSize: number }) => {\n stop: () => Promise<any>;\n };\n}",
"affectsGlobalScope": true,
"impliedNodeFormat": 1
}
}
],
"options": {
"skipLibCheck": true
},
"size": 1195
}

tsconfig.json::
SemanticDiagnostics::
*refresh* /home/src/tslibs/TS/Lib/lib.d.ts
*refresh* /home/src/workspaces/project/a.ts
*refresh* /home/src/workspaces/project/b.d.ts
Signatures::


Edit [0]:: no change

tsgo
ExitStatus:: Success
Output::

tsconfig.json::
SemanticDiagnostics::
Signatures::


Edit [1]:: no change and tsc -b

tsgo -b -v
ExitStatus:: Success
Output::
[HH:MM:SS AM] Projects in this build:
* tsconfig.json

[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'b.d.ts' is older than output 'tsconfig.tsbuildinfo'


Loading