tstyche 7.2.4 → 8.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/api.d.ts +16 -761
- package/dist/api.js +16 -6170
- package/dist/bin.js +2 -3
- package/dist/checker/BaseCheckerAdapter.d.ts +15 -0
- package/dist/checker/BaseCheckerAdapter.js +32 -0
- package/dist/checker/CompatCheckerAdapter.d.ts +70 -0
- package/dist/checker/CompatCheckerAdapter.js +221 -0
- package/dist/checker/NativeCheckerAdapter.d.ts +70 -0
- package/dist/checker/NativeCheckerAdapter.js +200 -0
- package/dist/checker/index.d.ts +3 -0
- package/dist/checker/index.js +2 -0
- package/dist/checker/types.d.ts +9 -0
- package/dist/checker/types.js +1 -0
- package/dist/cli/Cli.d.ts +5 -0
- package/dist/cli/Cli.js +144 -0
- package/dist/cli/CliDIagnosticText.d.ts +3 -0
- package/dist/cli/CliDIagnosticText.js +9 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +1 -0
- package/dist/collect/CollectDiagnosticText.d.ts +3 -0
- package/dist/collect/CollectDiagnosticText.js +5 -0
- package/dist/collect/CollectService.d.ts +9 -0
- package/dist/collect/CollectService.js +150 -0
- package/dist/collect/ExpectNode.d.ts +16 -0
- package/dist/collect/ExpectNode.js +30 -0
- package/dist/collect/IdentifierLookup.d.ts +18 -0
- package/dist/collect/IdentifierLookup.js +90 -0
- package/dist/collect/TestTree.d.ts +16 -0
- package/dist/collect/TestTree.js +15 -0
- package/dist/collect/TestTreeNode.d.ts +15 -0
- package/dist/collect/TestTreeNode.js +27 -0
- package/dist/collect/TestTreeNodeBrand.enum.d.ts +6 -0
- package/dist/collect/TestTreeNodeBrand.enum.js +7 -0
- package/dist/collect/TestTreeNodeFlags.enum.d.ts +6 -0
- package/dist/collect/TestTreeNodeFlags.enum.js +7 -0
- package/dist/collect/index.d.ts +6 -0
- package/dist/collect/index.js +6 -0
- package/dist/config/CommandParser.d.ts +7 -0
- package/dist/config/CommandParser.js +107 -0
- package/dist/config/Config.d.ts +18 -0
- package/dist/config/Config.js +59 -0
- package/dist/config/ConfigDiagnosticText.d.ts +19 -0
- package/dist/config/ConfigDiagnosticText.js +57 -0
- package/dist/config/ConfigParser.d.ts +10 -0
- package/dist/config/ConfigParser.js +165 -0
- package/dist/config/Directive.d.ts +9 -0
- package/dist/config/Directive.js +119 -0
- package/dist/config/DirectiveDiagnosticText.d.ts +5 -0
- package/dist/config/DirectiveDiagnosticText.js +11 -0
- package/dist/config/OptionBrand.enum.d.ts +8 -0
- package/dist/config/OptionBrand.enum.js +9 -0
- package/dist/config/OptionGroup.enum.d.ts +5 -0
- package/dist/config/OptionGroup.enum.js +6 -0
- package/dist/config/Options.d.ts +29 -0
- package/dist/config/Options.js +290 -0
- package/dist/config/Target.d.ts +7 -0
- package/dist/config/Target.js +47 -0
- package/dist/config/defaultOptions.d.ts +2 -0
- package/dist/config/defaultOptions.js +14 -0
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.js +7 -0
- package/dist/config/types.d.ts +55 -0
- package/dist/config/types.js +1 -0
- package/dist/diagnostic/Diagnostic.d.ts +19 -0
- package/dist/diagnostic/Diagnostic.js +51 -0
- package/dist/diagnostic/DiagnosticCategory.enum.d.ts +4 -0
- package/dist/diagnostic/DiagnosticCategory.enum.js +5 -0
- package/dist/diagnostic/DiagnosticOrigin.d.ts +13 -0
- package/dist/diagnostic/DiagnosticOrigin.js +27 -0
- package/dist/diagnostic/helpers.d.ts +6 -0
- package/dist/diagnostic/helpers.js +74 -0
- package/dist/diagnostic/index.d.ts +5 -0
- package/dist/diagnostic/index.js +4 -0
- package/dist/diagnostic/types.d.ts +2 -0
- package/dist/diagnostic/types.js +1 -0
- package/dist/editor/TextEditor.d.ts +15 -0
- package/dist/editor/TextEditor.js +88 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/index.js +1 -0
- package/dist/editor/types.d.ts +4 -0
- package/dist/editor/types.js +1 -0
- package/dist/environment/Environment.d.ts +5 -0
- package/dist/environment/Environment.js +89 -0
- package/dist/environment/environmentOptions.d.ts +1 -0
- package/dist/environment/environmentOptions.js +2 -0
- package/dist/environment/index.d.ts +2 -0
- package/dist/environment/index.js +1 -0
- package/dist/environment/types.d.ts +10 -0
- package/dist/environment/types.js +1 -0
- package/dist/events/EventEmitter.d.ts +14 -0
- package/dist/events/EventEmitter.js +42 -0
- package/dist/events/index.d.ts +2 -0
- package/dist/events/index.js +1 -0
- package/dist/events/types.d.ts +88 -0
- package/dist/events/types.js +1 -0
- package/dist/expect/AbilityMatcherBase.d.ts +16 -0
- package/dist/expect/AbilityMatcherBase.js +52 -0
- package/dist/expect/Ensure.d.ts +10 -0
- package/dist/expect/Ensure.js +51 -0
- package/dist/expect/ExpectDiagnosticText.d.ts +29 -0
- package/dist/expect/ExpectDiagnosticText.js +87 -0
- package/dist/expect/ExpectService.d.ts +21 -0
- package/dist/expect/ExpectService.js +90 -0
- package/dist/expect/RelationMatcherBase.d.ts +12 -0
- package/dist/expect/RelationMatcherBase.js +16 -0
- package/dist/expect/ToAcceptProps.d.ts +10 -0
- package/dist/expect/ToAcceptProps.js +52 -0
- package/dist/expect/ToBe.d.ts +13 -0
- package/dist/expect/ToBe.js +18 -0
- package/dist/expect/ToBeApplicable.d.ts +10 -0
- package/dist/expect/ToBeApplicable.js +72 -0
- package/dist/expect/ToBeAssignableFrom.d.ts +9 -0
- package/dist/expect/ToBeAssignableFrom.js +12 -0
- package/dist/expect/ToBeAssignableTo.d.ts +9 -0
- package/dist/expect/ToBeAssignableTo.js +12 -0
- package/dist/expect/ToBeCallableWith.d.ts +11 -0
- package/dist/expect/ToBeCallableWith.js +29 -0
- package/dist/expect/ToBeConstructableWith.d.ts +11 -0
- package/dist/expect/ToBeConstructableWith.js +29 -0
- package/dist/expect/ToBeInstantiableWith.d.ts +10 -0
- package/dist/expect/ToBeInstantiableWith.js +31 -0
- package/dist/expect/ToHaveProperty.d.ts +10 -0
- package/dist/expect/ToHaveProperty.js +59 -0
- package/dist/expect/ToRaiseError.d.ts +9 -0
- package/dist/expect/ToRaiseError.js +82 -0
- package/dist/expect/index.d.ts +2 -0
- package/dist/expect/index.js +1 -0
- package/dist/expect/types.d.ts +7 -0
- package/dist/expect/types.js +1 -0
- package/dist/file/FilePosition.d.ts +7 -0
- package/dist/file/FilePosition.js +16 -0
- package/dist/file/index.d.ts +1 -0
- package/dist/file/index.js +1 -0
- package/dist/glob/Braces.d.ts +4 -0
- package/dist/glob/Braces.js +56 -0
- package/dist/glob/Glob.d.ts +4 -0
- package/dist/glob/Glob.js +47 -0
- package/dist/glob/index.d.ts +1 -0
- package/dist/glob/index.js +1 -0
- package/dist/handlers/CancellationHandler.d.ts +7 -0
- package/dist/handlers/CancellationHandler.js +15 -0
- package/dist/handlers/ExitCodeHandler.d.ts +7 -0
- package/dist/handlers/ExitCodeHandler.js +20 -0
- package/dist/handlers/ResultHandler.d.ts +5 -0
- package/dist/handlers/ResultHandler.js +206 -0
- package/dist/handlers/index.d.ts +3 -0
- package/dist/handlers/index.js +3 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +40 -45
- package/dist/index.d.ts +40 -45
- package/dist/index.js +1 -2
- package/dist/input/InputService.d.ts +6 -0
- package/dist/input/InputService.js +16 -0
- package/dist/input/index.d.ts +1 -0
- package/dist/input/index.js +1 -0
- package/dist/json/JsonNode.d.ts +11 -0
- package/dist/json/JsonNode.js +28 -0
- package/dist/json/JsonScanner.d.ts +14 -0
- package/dist/json/JsonScanner.js +105 -0
- package/dist/json/index.d.ts +3 -0
- package/dist/json/index.js +2 -0
- package/dist/json/types.d.ts +1 -0
- package/dist/json/types.js +1 -0
- package/dist/layers/AbilityLayer.d.ts +10 -0
- package/dist/layers/AbilityLayer.js +186 -0
- package/dist/layers/Layers.d.ts +11 -0
- package/dist/layers/Layers.js +47 -0
- package/dist/layers/SuppressedLayer.d.ts +11 -0
- package/dist/layers/SuppressedLayer.js +93 -0
- package/dist/layers/index.d.ts +2 -0
- package/dist/layers/index.js +1 -0
- package/dist/layers/types.d.ts +8 -0
- package/dist/layers/types.js +1 -0
- package/dist/output/CodeFrameText.d.ts +10 -0
- package/dist/output/CodeFrameText.js +71 -0
- package/dist/output/OutputService.d.ts +13 -0
- package/dist/output/OutputService.js +38 -0
- package/dist/output/StreamController.d.ts +10 -0
- package/dist/output/StreamController.js +16 -0
- package/dist/output/addsText.d.ts +4 -0
- package/dist/output/addsText.js +8 -0
- package/dist/output/describeNameText.d.ts +2 -0
- package/dist/output/describeNameText.js +5 -0
- package/dist/output/diagnosticText.d.ts +4 -0
- package/dist/output/diagnosticText.js +23 -0
- package/dist/output/dotText.d.ts +3 -0
- package/dist/output/dotText.js +11 -0
- package/dist/output/fileStatusText.d.ts +4 -0
- package/dist/output/fileStatusText.js +26 -0
- package/dist/output/formattedText.d.ts +2 -0
- package/dist/output/formattedText.js +19 -0
- package/dist/output/helpText.d.ts +3 -0
- package/dist/output/helpText.js +52 -0
- package/dist/output/helpers.d.ts +5 -0
- package/dist/output/helpers.js +23 -0
- package/dist/output/index.d.ts +16 -0
- package/dist/output/index.js +15 -0
- package/dist/output/prologueText.d.ts +2 -0
- package/dist/output/prologueText.js +5 -0
- package/dist/output/summaryText.d.ts +12 -0
- package/dist/output/summaryText.js +31 -0
- package/dist/output/testNameText.d.ts +3 -0
- package/dist/output/testNameText.js +24 -0
- package/dist/output/types.d.ts +5 -0
- package/dist/output/types.js +1 -0
- package/dist/output/usesText.d.ts +5 -0
- package/dist/output/usesText.js +22 -0
- package/dist/output/waitingForFileChangesText.d.ts +2 -0
- package/dist/output/waitingForFileChangesText.js +5 -0
- package/dist/output/watchUsageText.d.ts +2 -0
- package/dist/output/watchUsageText.js +12 -0
- package/dist/path/Path.d.ts +7 -0
- package/dist/path/Path.js +28 -0
- package/dist/path/index.d.ts +1 -0
- package/dist/path/index.js +1 -0
- package/dist/project/CompatMappedDiagnostic.d.ts +12 -0
- package/dist/project/CompatMappedDiagnostic.js +25 -0
- package/dist/project/CompatProjectService.d.ts +19 -0
- package/dist/project/CompatProjectService.js +188 -0
- package/dist/project/FileMapService.d.ts +6 -0
- package/dist/project/FileMapService.js +14 -0
- package/dist/project/NativeMappedDiagnostic.d.ts +14 -0
- package/dist/project/NativeMappedDiagnostic.js +29 -0
- package/dist/project/NativeProjectService.d.ts +21 -0
- package/dist/project/NativeProjectService.js +216 -0
- package/dist/project/ProjectConfigService.d.ts +8 -0
- package/dist/project/ProjectConfigService.js +73 -0
- package/dist/project/index.d.ts +3 -0
- package/dist/project/index.js +2 -0
- package/dist/project/types.d.ts +7 -0
- package/dist/project/types.js +1 -0
- package/dist/reject/Reject.d.ts +9 -0
- package/dist/reject/Reject.js +43 -0
- package/dist/reject/RejectDiagnosticText.d.ts +5 -0
- package/dist/reject/RejectDiagnosticText.js +16 -0
- package/dist/reject/helpers.d.ts +1 -0
- package/dist/reject/helpers.js +3 -0
- package/dist/reject/index.d.ts +1 -0
- package/dist/reject/index.js +1 -0
- package/dist/reporters/BaseReporter.d.ts +7 -0
- package/dist/reporters/BaseReporter.js +6 -0
- package/dist/reporters/DotReporter.d.ts +6 -0
- package/dist/reporters/DotReporter.js +51 -0
- package/dist/reporters/FileView.d.ts +13 -0
- package/dist/reporters/FileView.js +33 -0
- package/dist/reporters/ListReporter.d.ts +6 -0
- package/dist/reporters/ListReporter.js +125 -0
- package/dist/reporters/SetupReporter.d.ts +4 -0
- package/dist/reporters/SetupReporter.js +21 -0
- package/dist/reporters/SummaryReporter.d.ts +5 -0
- package/dist/reporters/SummaryReporter.js +19 -0
- package/dist/reporters/WatchReporter.d.ts +5 -0
- package/dist/reporters/WatchReporter.js +21 -0
- package/dist/reporters/index.d.ts +7 -0
- package/dist/reporters/index.js +6 -0
- package/dist/reporters/types.d.ts +5 -0
- package/dist/reporters/types.js +1 -0
- package/dist/result/DescribeResult.d.ts +9 -0
- package/dist/result/DescribeResult.js +11 -0
- package/dist/result/ExpectResult.d.ts +10 -0
- package/dist/result/ExpectResult.js +11 -0
- package/dist/result/FileResult.d.ts +15 -0
- package/dist/result/FileResult.js +13 -0
- package/dist/result/ProjectConfigKind.enum.d.ts +6 -0
- package/dist/result/ProjectConfigKind.enum.js +7 -0
- package/dist/result/ProjectResult.d.ts +8 -0
- package/dist/result/ProjectResult.js +9 -0
- package/dist/result/Result.d.ts +13 -0
- package/dist/result/Result.js +14 -0
- package/dist/result/ResultStatus.enum.d.ts +10 -0
- package/dist/result/ResultStatus.enum.js +11 -0
- package/dist/result/SuppressedResult.d.ts +5 -0
- package/dist/result/SuppressedResult.js +6 -0
- package/dist/result/TargetResult.d.ts +11 -0
- package/dist/result/TargetResult.js +12 -0
- package/dist/result/TestResult.d.ts +13 -0
- package/dist/result/TestResult.js +13 -0
- package/dist/result/helpers.d.ts +7 -0
- package/dist/result/helpers.js +21 -0
- package/dist/result/index.d.ts +11 -0
- package/dist/result/index.js +10 -0
- package/dist/result/types.d.ts +31 -0
- package/dist/result/types.js +1 -0
- package/dist/runner/FileRunner.d.ts +10 -0
- package/dist/runner/FileRunner.js +93 -0
- package/dist/runner/FixmeDiagnosticText.d.ts +4 -0
- package/dist/runner/FixmeDiagnosticText.js +8 -0
- package/dist/runner/FixmeService.d.ts +9 -0
- package/dist/runner/FixmeService.js +51 -0
- package/dist/runner/RunModeFlags.enum.d.ts +7 -0
- package/dist/runner/RunModeFlags.enum.js +8 -0
- package/dist/runner/Runner.d.ts +9 -0
- package/dist/runner/Runner.js +101 -0
- package/dist/runner/TestTreeWalker.d.ts +19 -0
- package/dist/runner/TestTreeWalker.js +169 -0
- package/dist/runner/index.d.ts +1 -0
- package/dist/runner/index.js +1 -0
- package/dist/scribbler/Color.enum.d.ts +10 -0
- package/dist/scribbler/Color.enum.js +11 -0
- package/dist/scribbler/Line.d.ts +9 -0
- package/dist/scribbler/Line.js +5 -0
- package/dist/scribbler/Scribbler.d.ts +10 -0
- package/dist/scribbler/Scribbler.js +53 -0
- package/dist/scribbler/Text.d.ts +9 -0
- package/dist/scribbler/Text.js +8 -0
- package/dist/scribbler/index.d.ts +5 -0
- package/dist/scribbler/index.js +4 -0
- package/dist/scribbler/jsxRuntime.d.ts +4 -0
- package/dist/scribbler/jsxRuntime.js +4 -0
- package/dist/scribbler/types.d.ts +19 -0
- package/dist/scribbler/types.js +1 -0
- package/dist/select/Select.d.ts +7 -0
- package/dist/select/Select.js +91 -0
- package/dist/select/SelectDiagnosticText.d.ts +6 -0
- package/dist/select/SelectDiagnosticText.js +24 -0
- package/dist/select/index.d.ts +2 -0
- package/dist/select/index.js +2 -0
- package/dist/store/Fetcher.d.ts +8 -0
- package/dist/store/Fetcher.js +52 -0
- package/dist/store/Lock.d.ts +5 -0
- package/dist/store/Lock.js +17 -0
- package/dist/store/LockService.d.ts +8 -0
- package/dist/store/LockService.js +36 -0
- package/dist/store/Manifest.d.ts +35 -0
- package/dist/store/Manifest.js +58 -0
- package/dist/store/ManifestService.d.ts +10 -0
- package/dist/store/ManifestService.js +129 -0
- package/dist/store/PackageService.d.ts +8 -0
- package/dist/store/PackageService.js +69 -0
- package/dist/store/Store.d.ts +12 -0
- package/dist/store/Store.js +103 -0
- package/dist/store/StoreDiagnosticText.d.ts +12 -0
- package/dist/store/StoreDiagnosticText.js +36 -0
- package/dist/store/TarReader.d.ts +9 -0
- package/dist/store/TarReader.js +56 -0
- package/dist/store/helpers.d.ts +1 -0
- package/dist/store/helpers.js +3 -0
- package/dist/store/index.d.ts +1 -0
- package/dist/store/index.js +1 -0
- package/dist/structure/ComparisonResult.enum.d.ts +5 -0
- package/dist/structure/ComparisonResult.enum.js +6 -0
- package/dist/structure/Structure.d.ts +24 -0
- package/dist/structure/Structure.js +481 -0
- package/dist/structure/index.d.ts +1 -0
- package/dist/structure/index.js +1 -0
- package/dist/suppressed/SuppressedDiagnosticText.d.ts +6 -0
- package/dist/suppressed/SuppressedDiagnosticText.js +18 -0
- package/dist/suppressed/SuppressedService.d.ts +5 -0
- package/dist/suppressed/SuppressedService.js +61 -0
- package/dist/suppressed/index.d.ts +1 -0
- package/dist/suppressed/index.js +1 -0
- package/dist/tag.d.ts +1 -3
- package/dist/tag.js +2 -5
- package/dist/text/TextFile.d.ts +11 -0
- package/dist/text/TextFile.js +41 -0
- package/dist/text/TextFileService.d.ts +10 -0
- package/dist/text/TextFileService.js +31 -0
- package/dist/text/index.d.ts +3 -0
- package/dist/text/index.js +2 -0
- package/dist/text/types.d.ts +5 -0
- package/dist/text/types.js +1 -0
- package/dist/token/CancellationReason.enum.d.ts +6 -0
- package/dist/token/CancellationReason.enum.js +7 -0
- package/dist/token/CancellationToken.d.ts +8 -0
- package/dist/token/CancellationToken.js +22 -0
- package/dist/token/index.d.ts +2 -0
- package/dist/token/index.js +2 -0
- package/dist/typescript/BaseAdapter.d.ts +36 -0
- package/dist/typescript/BaseAdapter.js +83 -0
- package/dist/typescript/CompatTypeScript.d.ts +21 -0
- package/dist/typescript/CompatTypeScript.js +37 -0
- package/dist/typescript/NativeTypeScript.d.ts +24 -0
- package/dist/typescript/NativeTypeScript.js +44 -0
- package/dist/typescript/index.d.ts +3 -0
- package/dist/typescript/index.js +2 -0
- package/dist/typescript/types.d.ts +69 -0
- package/dist/typescript/types.js +1 -0
- package/dist/version/Version.d.ts +6 -0
- package/dist/version/Version.js +30 -0
- package/dist/version/index.d.ts +1 -0
- package/dist/version/index.js +1 -0
- package/dist/watch/Debounce.d.ts +9 -0
- package/dist/watch/Debounce.js +27 -0
- package/dist/watch/FileWatcher.d.ts +5 -0
- package/dist/watch/FileWatcher.js +12 -0
- package/dist/watch/WatchService.d.ts +8 -0
- package/dist/watch/WatchService.js +96 -0
- package/dist/watch/Watcher.d.ts +10 -0
- package/dist/watch/Watcher.js +31 -0
- package/dist/watch/index.d.ts +3 -0
- package/dist/watch/index.js +3 -0
- package/package.json +9 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "#scribbler/jsx-runtime";
|
|
2
|
+
import { Line, Text } from "#scribbler";
|
|
3
|
+
import { duration, getStatusColor, total } from "./helpers.js";
|
|
4
|
+
function RowText({ label, text }) {
|
|
5
|
+
return (_jsxs(Line, { children: [`${label}:`.padEnd(12), text] }));
|
|
6
|
+
}
|
|
7
|
+
function CountsText({ counts, total }) {
|
|
8
|
+
const countsText = Object.entries(counts).map(([status, count]) => {
|
|
9
|
+
return (_jsx(Text, { children: count > 0 ? (_jsxs(Text, { children: [_jsxs(Text, { color: getStatusColor(status), children: [count, " ", status] }), _jsx(Text, { children: ", " })] })) : undefined }));
|
|
10
|
+
});
|
|
11
|
+
const totalText = (_jsxs(Text, { children: [total, " ", "total"] }));
|
|
12
|
+
return (_jsxs(Text, { children: [countsText, totalText] }));
|
|
13
|
+
}
|
|
14
|
+
function DurationText({ timing }) {
|
|
15
|
+
const seconds = duration(timing) / 1000;
|
|
16
|
+
return _jsx(Text, { children: `${Math.round(seconds * 10) / 10}s` });
|
|
17
|
+
}
|
|
18
|
+
export function summaryText({ targetCounts, fileCounts, testCounts, assertionCounts, suppressedCounts, timing, }) {
|
|
19
|
+
const targetCountsTotal = total(targetCounts);
|
|
20
|
+
const targetCountsText = (_jsx(RowText, { label: "Targets", text: _jsx(CountsText, { counts: targetCounts, total: targetCountsTotal }) }));
|
|
21
|
+
const fileCountsTotal = total(fileCounts);
|
|
22
|
+
const fileCountsText = (_jsx(RowText, { label: "Test files", text: _jsx(CountsText, { counts: fileCounts, total: fileCountsTotal }) }));
|
|
23
|
+
const testCountsTotal = total(testCounts);
|
|
24
|
+
const testCountsText = testCountsTotal > 0 ? (_jsx(RowText, { label: "Tests", text: _jsx(CountsText, { counts: testCounts, total: testCountsTotal }) })) : undefined;
|
|
25
|
+
const assertionCountsTotal = total(assertionCounts);
|
|
26
|
+
const assertionCountsText = assertionCountsTotal > 0 ? (_jsx(RowText, { label: "Assertions", text: _jsx(CountsText, { counts: assertionCounts, total: assertionCountsTotal }) })) : undefined;
|
|
27
|
+
const suppressedCountsTotal = total(suppressedCounts);
|
|
28
|
+
const suppressedCountsText = suppressedCountsTotal > 0 ? (_jsx(RowText, { label: "Suppressed", text: _jsx(CountsText, { counts: suppressedCounts, total: suppressedCountsTotal }) })) : undefined;
|
|
29
|
+
const durationText = _jsx(RowText, { label: "Duration", text: _jsx(DurationText, { timing: timing }) });
|
|
30
|
+
return (_jsxs(Text, { children: [targetCountsText, fileCountsText, testCountsText, assertionCountsText, suppressedCountsText, durationText] }));
|
|
31
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "#scribbler/jsx-runtime";
|
|
2
|
+
import { Line, Text } from "#scribbler";
|
|
3
|
+
import { getStatusColor } from "./helpers.js";
|
|
4
|
+
export function testNameText(status, name, indent = 0) {
|
|
5
|
+
let statusText;
|
|
6
|
+
switch (status) {
|
|
7
|
+
case "passed":
|
|
8
|
+
statusText = "+";
|
|
9
|
+
break;
|
|
10
|
+
case "failed":
|
|
11
|
+
statusText = "×";
|
|
12
|
+
break;
|
|
13
|
+
case "skipped":
|
|
14
|
+
statusText = "- skip";
|
|
15
|
+
break;
|
|
16
|
+
case "fixme":
|
|
17
|
+
statusText = "- fixme";
|
|
18
|
+
break;
|
|
19
|
+
case "todo":
|
|
20
|
+
statusText = "- todo";
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
return (_jsxs(Line, { indent: indent + 1, children: [_jsx(Text, { color: getStatusColor(status), children: statusText }), " ", _jsx(Text, { color: "90", children: name })] }));
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "#scribbler/jsx-runtime";
|
|
2
|
+
import { Path } from "#path";
|
|
3
|
+
import { Line, Text } from "#scribbler";
|
|
4
|
+
export function usesText(compilerVersion, projectConfig, options) {
|
|
5
|
+
if (options?.short) {
|
|
6
|
+
return _jsx(Text, { color: "34", children: compilerVersion });
|
|
7
|
+
}
|
|
8
|
+
let projectConfigText;
|
|
9
|
+
switch (projectConfig.kind) {
|
|
10
|
+
case 0:
|
|
11
|
+
case 2:
|
|
12
|
+
projectConfigText = (_jsxs(Text, { color: "90", children: [" with ", Path.relative("", projectConfig.specifier)] }));
|
|
13
|
+
break;
|
|
14
|
+
case 1:
|
|
15
|
+
projectConfigText = (_jsxs(Text, { color: "90", children: [" with ", projectConfig.specifier, " TSConfig"] }));
|
|
16
|
+
break;
|
|
17
|
+
case 3:
|
|
18
|
+
projectConfigText = _jsx(Text, { color: "90", children: " with inline TSConfig" });
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
return (_jsxs(Text, { children: [_jsxs(Line, { children: [_jsx(Text, { color: "34", children: "uses" }), " TypeScript ", compilerVersion, projectConfigText] }), _jsx(Line, {})] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "#scribbler/jsx-runtime";
|
|
2
|
+
import { Line, Text } from "#scribbler";
|
|
3
|
+
export function watchUsageText() {
|
|
4
|
+
const usage = [
|
|
5
|
+
["a", "to run all tests."],
|
|
6
|
+
["x", "to exit."],
|
|
7
|
+
];
|
|
8
|
+
const usageText = usage.map(([keyText, actionText]) => {
|
|
9
|
+
return (_jsxs(Line, { children: [_jsx(Text, { color: "90", children: "Press" }), _jsx(Text, { children: ` ${keyText} ` }), _jsx(Text, { color: "90", children: actionText })] }));
|
|
10
|
+
});
|
|
11
|
+
return _jsx(Text, { children: usageText });
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare class Path {
|
|
2
|
+
static normalizeSlashes: (filePath: string) => string;
|
|
3
|
+
static dirname(filePath: string): string;
|
|
4
|
+
static join(...filePaths: Array<string>): string;
|
|
5
|
+
static relative(from: string, to: string): string;
|
|
6
|
+
static resolve(...filePaths: Array<string>): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
export class Path {
|
|
3
|
+
static normalizeSlashes;
|
|
4
|
+
static {
|
|
5
|
+
if (path.sep === "/") {
|
|
6
|
+
Path.normalizeSlashes = (filePath) => filePath;
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
Path.normalizeSlashes = (filePath) => filePath.replace(/\\/g, "/");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
static dirname(filePath) {
|
|
13
|
+
return Path.normalizeSlashes(path.dirname(filePath));
|
|
14
|
+
}
|
|
15
|
+
static join(...filePaths) {
|
|
16
|
+
return Path.normalizeSlashes(path.join(...filePaths));
|
|
17
|
+
}
|
|
18
|
+
static relative(from, to) {
|
|
19
|
+
const relativePath = Path.normalizeSlashes(path.relative(from, to));
|
|
20
|
+
if (/^\.\.?\//.test(relativePath)) {
|
|
21
|
+
return relativePath;
|
|
22
|
+
}
|
|
23
|
+
return `./${relativePath}`;
|
|
24
|
+
}
|
|
25
|
+
static resolve(...filePaths) {
|
|
26
|
+
return Path.normalizeSlashes(path.resolve(...filePaths));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Path } from "./Path.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Path } from "./Path.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type ts6 from "@typescript/typescript6";
|
|
2
|
+
import { type Offset } from "#editor";
|
|
3
|
+
export declare class CompatMappedDiagnostic {
|
|
4
|
+
category: ts6.DiagnosticCategory;
|
|
5
|
+
code: number;
|
|
6
|
+
file: ts6.SourceFile;
|
|
7
|
+
length: number | undefined;
|
|
8
|
+
messageText: string | ts6.DiagnosticMessageChain;
|
|
9
|
+
relatedInformation?: Array<ts6.DiagnosticRelatedInformation>;
|
|
10
|
+
start: number | undefined;
|
|
11
|
+
constructor(sourceFile: ts6.SourceFile, diagnostic: ts6.Diagnostic, offsets?: Array<Offset>);
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TextEditor } from "#editor";
|
|
2
|
+
export class CompatMappedDiagnostic {
|
|
3
|
+
category;
|
|
4
|
+
code;
|
|
5
|
+
file;
|
|
6
|
+
length;
|
|
7
|
+
messageText;
|
|
8
|
+
relatedInformation;
|
|
9
|
+
start;
|
|
10
|
+
constructor(sourceFile, diagnostic, offsets = []) {
|
|
11
|
+
this.file = sourceFile;
|
|
12
|
+
if (diagnostic.start != null) {
|
|
13
|
+
this.start = diagnostic.start - TextEditor.getOffset(diagnostic.start, offsets);
|
|
14
|
+
this.length = diagnostic.length;
|
|
15
|
+
}
|
|
16
|
+
this.category = diagnostic.category;
|
|
17
|
+
this.code = diagnostic.code;
|
|
18
|
+
this.messageText = diagnostic.messageText;
|
|
19
|
+
if (diagnostic.relatedInformation != null) {
|
|
20
|
+
this.relatedInformation = diagnostic.relatedInformation.map((related) => related.file?.fileName === sourceFile.fileName
|
|
21
|
+
? new CompatMappedDiagnostic(sourceFile, related, offsets)
|
|
22
|
+
: related);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type ts6 from "@typescript/typescript6";
|
|
2
|
+
import { CompatCheckerAdapter } from "#checker";
|
|
3
|
+
import { type ResolvedConfig } from "#config";
|
|
4
|
+
import type { Offset } from "#editor";
|
|
5
|
+
import type * as ts from "#typescript";
|
|
6
|
+
import { CompatMappedDiagnostic } from "./CompatMappedDiagnostic.js";
|
|
7
|
+
export declare class CompatProjectService {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(compiler: typeof ts6, resolvedConfig: ResolvedConfig);
|
|
10
|
+
closeFile(filePath: string): void;
|
|
11
|
+
getChecker(): CompatCheckerAdapter;
|
|
12
|
+
getMappedDiagnostic(sourceFile: ts.SourceFile, diagnostic: ts.Diagnostic, offsets?: Array<Offset>): CompatMappedDiagnostic;
|
|
13
|
+
getProgram(): ts6.Program;
|
|
14
|
+
getSourceFile(filePath: string): ts6.SourceFile | undefined;
|
|
15
|
+
getSemanticDiagnostics(filePath: string): ReadonlyArray<ts6.Diagnostic>;
|
|
16
|
+
getSyntacticDiagnostics(filePath: string): ReadonlyArray<ts6.Diagnostic>;
|
|
17
|
+
openFile(filePath: string, fileText?: string): void;
|
|
18
|
+
openLayer(filePath: string, fileText: string): ReadonlyArray<ts.Diagnostic>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { CompatCheckerAdapter } from "#checker";
|
|
2
|
+
import { Options } from "#config";
|
|
3
|
+
import { Diagnostic } from "#diagnostic";
|
|
4
|
+
import { EventEmitter } from "#events";
|
|
5
|
+
import { Path } from "#path";
|
|
6
|
+
import { Select } from "#select";
|
|
7
|
+
import { TextFileService } from "#text";
|
|
8
|
+
import { Version } from "#version";
|
|
9
|
+
import { CompatMappedDiagnostic } from "./CompatMappedDiagnostic.js";
|
|
10
|
+
export class CompatProjectService {
|
|
11
|
+
#compiler;
|
|
12
|
+
#languageService;
|
|
13
|
+
#host;
|
|
14
|
+
#lastSeenProject = "none";
|
|
15
|
+
#projectConfig;
|
|
16
|
+
#resolvedConfig;
|
|
17
|
+
#seenProjects = new Set();
|
|
18
|
+
#service;
|
|
19
|
+
constructor(compiler, resolvedConfig) {
|
|
20
|
+
this.#compiler = compiler;
|
|
21
|
+
this.#projectConfig = this.#resolveProjectConfig(resolvedConfig);
|
|
22
|
+
this.#resolvedConfig = resolvedConfig;
|
|
23
|
+
const noop = () => undefined;
|
|
24
|
+
const noopLogger = {
|
|
25
|
+
close: noop,
|
|
26
|
+
endGroup: noop,
|
|
27
|
+
getLogFileName: noop,
|
|
28
|
+
hasLevel: () => false,
|
|
29
|
+
info: noop,
|
|
30
|
+
loggingEnabled: () => false,
|
|
31
|
+
msg: noop,
|
|
32
|
+
perftrc: noop,
|
|
33
|
+
startGroup: noop,
|
|
34
|
+
};
|
|
35
|
+
const noopWatcher = {
|
|
36
|
+
close: noop,
|
|
37
|
+
};
|
|
38
|
+
this.#host = {
|
|
39
|
+
...compiler.sys,
|
|
40
|
+
clearImmediate,
|
|
41
|
+
clearTimeout,
|
|
42
|
+
setImmediate,
|
|
43
|
+
setTimeout,
|
|
44
|
+
watchDirectory: () => noopWatcher,
|
|
45
|
+
watchFile: () => noopWatcher,
|
|
46
|
+
};
|
|
47
|
+
if (this.#projectConfig.kind === 3) {
|
|
48
|
+
this.#host.readFile = (path) => path === this.#projectConfig.specifier ? resolvedConfig.tsconfig : compiler.sys.readFile(path);
|
|
49
|
+
}
|
|
50
|
+
this.#service = new this.#compiler.server.ProjectService({
|
|
51
|
+
allowLocalPluginLoads: true,
|
|
52
|
+
cancellationToken: this.#compiler.server.nullCancellationToken,
|
|
53
|
+
host: this.#host,
|
|
54
|
+
logger: noopLogger,
|
|
55
|
+
session: undefined,
|
|
56
|
+
useInferredProjectPerProjectRoot: true,
|
|
57
|
+
useSingleInferredProject: false,
|
|
58
|
+
});
|
|
59
|
+
this.#service.setCompilerOptionsForInferredProjects(this.#getDefaultCompilerOptions());
|
|
60
|
+
}
|
|
61
|
+
closeFile(filePath) {
|
|
62
|
+
TextFileService.close();
|
|
63
|
+
this.#service.closeClientFile(filePath);
|
|
64
|
+
}
|
|
65
|
+
#getDefaultCompilerOptions() {
|
|
66
|
+
const defaultCompilerOptions = {
|
|
67
|
+
allowJs: true,
|
|
68
|
+
checkJs: true,
|
|
69
|
+
allowImportingTsExtensions: true,
|
|
70
|
+
exactOptionalPropertyTypes: true,
|
|
71
|
+
jsx: this.#compiler.JsxEmit.Preserve,
|
|
72
|
+
module: this.#compiler.ModuleKind.NodeNext,
|
|
73
|
+
moduleResolution: this.#compiler.ModuleResolutionKind.NodeNext,
|
|
74
|
+
noEmit: true,
|
|
75
|
+
noUncheckedIndexedAccess: true,
|
|
76
|
+
resolveJsonModule: true,
|
|
77
|
+
strict: true,
|
|
78
|
+
target: this.#compiler.ScriptTarget.ESNext,
|
|
79
|
+
};
|
|
80
|
+
if (Version.isSatisfiedWith(this.#compiler.version, "5.6")) {
|
|
81
|
+
defaultCompilerOptions.noUncheckedSideEffectImports = true;
|
|
82
|
+
}
|
|
83
|
+
return defaultCompilerOptions;
|
|
84
|
+
}
|
|
85
|
+
getChecker() {
|
|
86
|
+
return new CompatCheckerAdapter(this.#compiler, this.#languageService.getProgram().getTypeChecker());
|
|
87
|
+
}
|
|
88
|
+
getMappedDiagnostic(sourceFile, diagnostic, offsets) {
|
|
89
|
+
return new CompatMappedDiagnostic(sourceFile, diagnostic, offsets);
|
|
90
|
+
}
|
|
91
|
+
getProgram() {
|
|
92
|
+
return this.#languageService.getProgram();
|
|
93
|
+
}
|
|
94
|
+
getSourceFile(filePath) {
|
|
95
|
+
return this.#languageService.getProgram().getSourceFile(filePath);
|
|
96
|
+
}
|
|
97
|
+
#getLanguageService(filePath) {
|
|
98
|
+
const project = this.#service.getDefaultProjectForFile(this.#compiler.server.toNormalizedPath(filePath), true);
|
|
99
|
+
const compilerOptions = project?.getCompilerOptions();
|
|
100
|
+
if (this.#resolvedConfig.checkDeclarationFiles && compilerOptions?.skipLibCheck) {
|
|
101
|
+
project?.setCompilerOptions({ ...compilerOptions, skipLibCheck: false });
|
|
102
|
+
}
|
|
103
|
+
return project?.getLanguageService(true);
|
|
104
|
+
}
|
|
105
|
+
getSemanticDiagnostics(filePath) {
|
|
106
|
+
return this.getProgram().getSemanticDiagnostics(this.getSourceFile(filePath));
|
|
107
|
+
}
|
|
108
|
+
getSyntacticDiagnostics(filePath) {
|
|
109
|
+
return this.getProgram().getSyntacticDiagnostics(this.getSourceFile(filePath));
|
|
110
|
+
}
|
|
111
|
+
#isFileIncluded(filePath) {
|
|
112
|
+
const configSourceFile = this.#compiler.readJsonConfigFile(this.#projectConfig.specifier, this.#host.readFile);
|
|
113
|
+
const { fileNames } = this.#compiler.parseJsonSourceFileConfigFileContent(configSourceFile, this.#host, Path.dirname(this.#projectConfig.specifier), undefined, this.#projectConfig.specifier);
|
|
114
|
+
return fileNames.includes(filePath);
|
|
115
|
+
}
|
|
116
|
+
openFile(filePath, fileText) {
|
|
117
|
+
switch (this.#projectConfig.kind) {
|
|
118
|
+
case 0:
|
|
119
|
+
break;
|
|
120
|
+
case 1:
|
|
121
|
+
this.#service.getConfigFileNameForFile = () => undefined;
|
|
122
|
+
break;
|
|
123
|
+
default:
|
|
124
|
+
this.#service.getConfigFileNameForFile = this.#isFileIncluded(filePath)
|
|
125
|
+
? () => this.#projectConfig.specifier
|
|
126
|
+
: () => undefined;
|
|
127
|
+
}
|
|
128
|
+
const { configFileErrors, configFileName } = this.#service.openClientFile(filePath, fileText, undefined, this.#resolvedConfig.rootPath);
|
|
129
|
+
if (configFileName !== this.#lastSeenProject) {
|
|
130
|
+
this.#lastSeenProject = configFileName;
|
|
131
|
+
this.#languageService = this.#getLanguageService(filePath);
|
|
132
|
+
const projectConfig = configFileName != null
|
|
133
|
+
? { ...this.#projectConfig, specifier: configFileName }
|
|
134
|
+
: { kind: 1, specifier: "baseline" };
|
|
135
|
+
EventEmitter.dispatch(["project:uses", { compilerVersion: this.#compiler.version, projectConfig }]);
|
|
136
|
+
if (configFileErrors && configFileErrors.length > 0) {
|
|
137
|
+
EventEmitter.dispatch(["project:error", { diagnostics: Diagnostic.fromDiagnostics(configFileErrors) }]);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
const program = this.getProgram();
|
|
141
|
+
if (this.#seenProjects.has(configFileName)) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
this.#seenProjects.add(configFileName);
|
|
145
|
+
const sourceFilesToCheck = program.getSourceFiles().filter((sourceFile) => {
|
|
146
|
+
if (program.isSourceFileFromExternalLibrary(sourceFile) || program.isSourceFileDefaultLibrary(sourceFile)) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
if (this.#resolvedConfig.checkDeclarationFiles && sourceFile.isDeclarationFile) {
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
if (Select.isFixtureFile(sourceFile.fileName, this.#resolvedConfig)) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
return false;
|
|
156
|
+
});
|
|
157
|
+
const diagnostics = [
|
|
158
|
+
...program.getOptionsDiagnostics(),
|
|
159
|
+
...sourceFilesToCheck.flatMap((sourceFile) => [
|
|
160
|
+
...program.getSyntacticDiagnostics(sourceFile),
|
|
161
|
+
...program.getSemanticDiagnostics(sourceFile),
|
|
162
|
+
...program.getDeclarationDiagnostics(sourceFile),
|
|
163
|
+
].sort((a, b) => a.start - b.start)),
|
|
164
|
+
];
|
|
165
|
+
if (diagnostics.length > 0) {
|
|
166
|
+
EventEmitter.dispatch(["project:error", { diagnostics: Diagnostic.fromDiagnostics(diagnostics) }]);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
openLayer(filePath, fileText) {
|
|
170
|
+
this.#service.openClientFile(filePath, fileText, undefined, this.#resolvedConfig.rootPath);
|
|
171
|
+
return this.getSemanticDiagnostics(filePath);
|
|
172
|
+
}
|
|
173
|
+
#resolveProjectConfig(resolvedConfig) {
|
|
174
|
+
if (resolvedConfig.tsconfig === "baseline") {
|
|
175
|
+
return { kind: 1, specifier: "baseline" };
|
|
176
|
+
}
|
|
177
|
+
if (resolvedConfig.tsconfig === "findup") {
|
|
178
|
+
return { kind: 0, specifier: "" };
|
|
179
|
+
}
|
|
180
|
+
if (Options.isJsonString(resolvedConfig.tsconfig)) {
|
|
181
|
+
return {
|
|
182
|
+
kind: 3,
|
|
183
|
+
specifier: Path.resolve(resolvedConfig.rootPath, `${Date.now().toString(36)}.tsconfig.json`),
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
return { kind: 2, specifier: resolvedConfig.tsconfig };
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class FileMapService {
|
|
2
|
+
#files = new Map();
|
|
3
|
+
add(path, text) {
|
|
4
|
+
this.#files.set(path, text);
|
|
5
|
+
}
|
|
6
|
+
get() {
|
|
7
|
+
const result = Object.fromEntries(this.#files);
|
|
8
|
+
this.#files.clear();
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
hasChanged() {
|
|
12
|
+
return this.#files.size > 0;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as tsAst from "typescript/ast";
|
|
2
|
+
import type * as tsApi from "typescript/sync";
|
|
3
|
+
import { type Offset } from "#editor";
|
|
4
|
+
export declare class NativeMappedDiagnostic {
|
|
5
|
+
fileName: tsAst.RootedFilePath;
|
|
6
|
+
pos: number;
|
|
7
|
+
end: number;
|
|
8
|
+
code: number;
|
|
9
|
+
category: tsApi.DiagnosticCategory;
|
|
10
|
+
text: string;
|
|
11
|
+
messageChain?: Array<tsApi.Diagnostic>;
|
|
12
|
+
relatedInformation?: Array<tsApi.Diagnostic>;
|
|
13
|
+
constructor(sourceFile: tsAst.SourceFile, diagnostic: tsApi.Diagnostic, offsets?: Array<Offset>);
|
|
14
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TextEditor } from "#editor";
|
|
2
|
+
export class NativeMappedDiagnostic {
|
|
3
|
+
fileName;
|
|
4
|
+
pos;
|
|
5
|
+
end;
|
|
6
|
+
code;
|
|
7
|
+
category;
|
|
8
|
+
text;
|
|
9
|
+
messageChain;
|
|
10
|
+
relatedInformation;
|
|
11
|
+
constructor(sourceFile, diagnostic, offsets = []) {
|
|
12
|
+
this.fileName = sourceFile.fileName;
|
|
13
|
+
this.pos = diagnostic.pos - TextEditor.getOffset(diagnostic.pos, offsets);
|
|
14
|
+
this.end = diagnostic.end - TextEditor.getOffset(diagnostic.end, offsets);
|
|
15
|
+
this.code = diagnostic.code;
|
|
16
|
+
this.category = diagnostic.category;
|
|
17
|
+
this.text = diagnostic.text;
|
|
18
|
+
if (diagnostic.messageChain != null) {
|
|
19
|
+
this.messageChain = diagnostic.messageChain.map((diagnostic) => diagnostic.fileName === sourceFile.fileName
|
|
20
|
+
? new NativeMappedDiagnostic(sourceFile, diagnostic, offsets)
|
|
21
|
+
: diagnostic);
|
|
22
|
+
}
|
|
23
|
+
if (diagnostic.relatedInformation != null) {
|
|
24
|
+
this.relatedInformation = diagnostic.relatedInformation.map((diagnostic) => diagnostic.fileName === sourceFile.fileName
|
|
25
|
+
? new NativeMappedDiagnostic(sourceFile, diagnostic, offsets)
|
|
26
|
+
: diagnostic);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as tsAst from "typescript/ast";
|
|
2
|
+
import type * as tsApi from "typescript/sync";
|
|
3
|
+
import { NativeCheckerAdapter } from "#checker";
|
|
4
|
+
import { type ResolvedConfig } from "#config";
|
|
5
|
+
import type { Offset } from "#editor";
|
|
6
|
+
import type * as ts from "#typescript";
|
|
7
|
+
import { NativeMappedDiagnostic } from "./NativeMappedDiagnostic.js";
|
|
8
|
+
export declare class NativeProjectService {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(ts: ts.NativeTypeScript, resolvedConfig: ResolvedConfig);
|
|
11
|
+
close(): void;
|
|
12
|
+
closeFile(): void;
|
|
13
|
+
getChecker(): NativeCheckerAdapter;
|
|
14
|
+
getMappedDiagnostic(sourceFile: ts.SourceFile, diagnostic: ts.Diagnostic, offsets?: Array<Offset>): NativeMappedDiagnostic;
|
|
15
|
+
getProgram(): tsApi.Program;
|
|
16
|
+
getSourceFile(filePath: string): tsAst.SourceFile | undefined;
|
|
17
|
+
getSemanticDiagnostics(filePath: string): ReadonlyArray<tsApi.Diagnostic>;
|
|
18
|
+
getSyntacticDiagnostics(filePath: string): ReadonlyArray<tsApi.Diagnostic>;
|
|
19
|
+
openFile(filePath: tsAst.RootedFilePath, fileText?: string): void;
|
|
20
|
+
openLayer(filePath: string, fileText: string): ReadonlyArray<ts.Diagnostic>;
|
|
21
|
+
}
|