Skip to content

Commit

Permalink
feat: Implement error emission about existing file (#1076)
Browse files Browse the repository at this point in the history
**Related issue:**

 - Part of #705
  • Loading branch information
sunrabbit123 authored Sep 10, 2023
1 parent 637a99c commit 90f7c04
Show file tree
Hide file tree
Showing 16 changed files with 105 additions and 23 deletions.
1 change: 1 addition & 0 deletions crates/stc_ts_type_checker/tests/conformance.pass.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,7 @@ externalModules/multipleExportDefault6.ts
externalModules/nameDelimitedBySlashes.ts
externalModules/nameWithFileExtension.ts
externalModules/reexportClassDefinition.ts
externalModules/relativePathMustResolve.ts
externalModules/topLevelAwait.3.ts
externalModules/topLevelFileModule.ts
externalModules/topLevelFileModuleMissing.ts
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"required_errors": {},
"required_error_lines": {},
"extra_errors": {
"TS2307": 1
},
"extra_error_lines": {
"TS2307": [
1
]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 0,
matched_error: 0,
extra_error: 0,
panic: 1,
extra_error: 1,
panic: 0,
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 1,
matched_error: 0,
required_error: 0,
matched_error: 1,
extra_error: 0,
panic: 1,
panic: 0,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"required_errors": {},
"required_error_lines": {},
"extra_errors": {
"TS2307": 3
},
"extra_error_lines": {
"TS2307": [
1,
2,
3
]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 0,
matched_error: 0,
extra_error: 0,
panic: 1,
extra_error: 3,
panic: 0,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"required_errors": {},
"required_error_lines": {},
"extra_errors": {
"TS2307": 1
},
"extra_error_lines": {
"TS2307": [
1
]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 0,
matched_error: 0,
extra_error: 0,
panic: 1,
extra_error: 1,
panic: 0,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"required_errors": {},
"required_error_lines": {},
"extra_errors": {
"TS2307": 2
},
"extra_error_lines": {
"TS2307": [
1,
1
]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 0,
matched_error: 0,
extra_error: 0,
panic: 1,
extra_error: 2,
panic: 0,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"required_errors": {},
"required_error_lines": {},
"extra_errors": {
"TS2307": 1
},
"extra_error_lines": {
"TS2307": [
1
]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 0,
matched_error: 0,
extra_error: 0,
panic: 1,
extra_error: 1,
panic: 0,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"required_errors": {
"TS2694": 1
},
"required_error_lines": {
"TS2694": [
3
]
},
"extra_errors": {
"TS0": 1
},
"extra_error_lines": {
"TS0": [
16
]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 4,
matched_error: 0,
extra_error: 0,
panic: 1,
required_error: 1,
matched_error: 3,
extra_error: 1,
panic: 0,
}
8 changes: 4 additions & 4 deletions crates/stc_ts_type_checker/tests/tsc-stats.rust-debug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Stats {
required_error: 3493,
matched_error: 6542,
extra_error: 764,
panic: 73,
required_error: 3489,
matched_error: 6546,
extra_error: 773,
panic: 66,
}
4 changes: 2 additions & 2 deletions crates/stc_ts_type_checker/tests/tsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::{
sync::Arc,
};

use anyhow::{Context, Error};
use anyhow::{bail, Context, Error};
use indexmap::IndexMap;
use once_cell::sync::Lazy;
use parking_lot::Mutex;
Expand Down Expand Up @@ -662,7 +662,7 @@ impl LoadFile for TestFileSystem {
}
}

todo!("load_file: {:?} ", filename);
bail!("not found module");
}
}

Expand Down

0 comments on commit 90f7c04

Please sign in to comment.