Skip to content

Instantly share code, notes, and snippets.

@hack3ric
Created April 19, 2023 16:11
Show Gist options
  • Save hack3ric/e5a02e6f2f23149360437dca1d02dc98 to your computer and use it in GitHub Desktop.
Save hack3ric/e5a02e6f2f23149360437dca1d02dc98 to your computer and use it in GitHub Desktop.
Deno riscv64 debug
ERROR TSLS = Error: Could not find source file: 'file:///<working_dir>/$deno$repl.ts'.
    at getValidSourceFile (ext:deno_tsc/00_typescript.js:133358:23)
    at Object.getSemanticDiagnostics (ext:deno_tsc/00_typescript.js:133600:32)
    at serverRequest (ext:deno_tsc/99_main_compiler.js:1059:34)
    at [ext:cli/lsp/tsc.rs:3496:26]:1:12

How $deno$repl.ts is opened by LSP (probably):

  1. cli/lsp/repl.rs: line 255: self.cwd_uri.join("$deno$repl.ts").unwrap() -> ReplLanguageServer::open_current_document
  2. cli/lsp/language_server.rs: line 2886: <LanguageServer as tower_lsp::LanguageServer>::did_open -> line 2901: let document = inner.did_open(&specifier, params).await; -> line 1169: Inner::did_open -> line 1191: let document = self.documents.open(...)
  3. cli/lsp/documents.rs: line 869: Documents::open -> line 877: let document = Document::open(...)
  4. cli/lsp/documents.rs: line 887: self.open_docs.insert(specifier, document.clone());
    • the document is stored in LanguageServer's Inner.documents (wrapped inside Arc<RwLock>)
  5. ...

todo: Seems to relate to DiagnosticsServer, but how does TypeScript knows about documents?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment