If you have sloppy imports enabled, and you have both a .js and .d.ts file, you get an error upon opening the .js file.
For instance:
// deno.json
{
"unstable": ["sloppy-imports"]
}
// foo.js
export const bar = 3;
// foo.d.ts
export const bar: number;
if you open foo.js, you get
ERROR TSLS = Error: Could not find source file: 'file:///home/lsp-sloppy-imports/foo.js'.
at getValidSourceFile (ext:deno_tsc/00_typescript.js:144419:24)
at Object.getSemanticDiagnostics (ext:deno_tsc/00_typescript.js:144681:32)
at serverRequest (ext:deno_tsc/99_main_compiler.js:1153:34)
Error during TS request "$getDiagnostics":
Error: Could not find source file: 'file:///home/lsp-sloppy-imports/foo.js'.
at getValidSourceFile (ext:deno_tsc/00_typescript.js:144419:24)
at Object.getSemanticDiagnostics (ext:deno_tsc/00_typescript.js:144681:32)
at serverRequest (ext:deno_tsc/99_main_compiler.js:1153:34)
Error generating TypeScript diagnostics: The response was not received for the request.
This is because the LSP is resolving foo.js to foo.d.ts even though foo.js exists.
If you have sloppy imports enabled, and you have both a
.js
and.d.ts
file, you get an error upon opening the.js
file.For instance:
if you open
foo.js
, you getThis is because the LSP is resolving
foo.js
tofoo.d.ts
even thoughfoo.js
exists.