@effect/language-service 0.33.0 → 0.33.2
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 +3 -2
- package/index.js +5 -25
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +36 -25
- package/transform.js.map +1 -1
package/package.json
CHANGED
package/transform.js
CHANGED
|
@@ -4830,32 +4830,43 @@ var diagnostics = [
|
|
|
4830
4830
|
];
|
|
4831
4831
|
|
|
4832
4832
|
// src/transform.ts
|
|
4833
|
+
var programsChecked = /* @__PURE__ */ new WeakMap();
|
|
4833
4834
|
function transform_default(program, pluginConfig, { addDiagnostic, ts: tsInstance }) {
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
)
|
|
4857
|
-
|
|
4858
|
-
|
|
4835
|
+
function runDiagnostics(program2, sourceFile) {
|
|
4836
|
+
const checkedFiles = programsChecked.get(program2) ?? /* @__PURE__ */ new Set();
|
|
4837
|
+
programsChecked.set(program2, checkedFiles);
|
|
4838
|
+
if (checkedFiles.has(sourceFile.fileName)) return;
|
|
4839
|
+
checkedFiles.add(sourceFile.fileName);
|
|
4840
|
+
pipe(
|
|
4841
|
+
getSemanticDiagnosticsWithCodeFixes(diagnostics, sourceFile),
|
|
4842
|
+
nanoLayer2,
|
|
4843
|
+
nanoLayer,
|
|
4844
|
+
provideService(TypeCheckerApi, program2.getTypeChecker()),
|
|
4845
|
+
provideService(TypeScriptProgram, program2),
|
|
4846
|
+
provideService(TypeScriptApi, tsInstance),
|
|
4847
|
+
provideService(
|
|
4848
|
+
LanguageServicePluginOptions,
|
|
4849
|
+
parse(pluginConfig)
|
|
4850
|
+
),
|
|
4851
|
+
run,
|
|
4852
|
+
map((_) => _.diagnostics),
|
|
4853
|
+
map(
|
|
4854
|
+
filter(
|
|
4855
|
+
(_) => _.category === tsInstance.DiagnosticCategory.Error || _.category === tsInstance.DiagnosticCategory.Warning
|
|
4856
|
+
)
|
|
4857
|
+
),
|
|
4858
|
+
getOrElse(() => []),
|
|
4859
|
+
map2(addDiagnostic)
|
|
4860
|
+
);
|
|
4861
|
+
}
|
|
4862
|
+
const rootFileNames = program.getRootFileNames();
|
|
4863
|
+
const sourceFiles = program.getSourceFiles().filter((_) => rootFileNames.indexOf(_.fileName) > -1);
|
|
4864
|
+
for (const sourceFile of sourceFiles) {
|
|
4865
|
+
runDiagnostics(program, sourceFile);
|
|
4866
|
+
}
|
|
4867
|
+
return (_) => (sourceFile) => {
|
|
4868
|
+
runDiagnostics(program, sourceFile);
|
|
4869
|
+
return sourceFile;
|
|
4859
4870
|
};
|
|
4860
4871
|
}
|
|
4861
4872
|
//# sourceMappingURL=transform.js.map
|