mirror of
https://github.com/denoland/deno.git
synced 2024-12-24 08:09:08 -05:00
perf(lsp): don't pass remote modules as tsc roots (#23259)
This commit is contained in:
parent
9752a153ea
commit
3c346c8ea6
3 changed files with 11 additions and 2 deletions
|
@ -1146,6 +1146,13 @@ impl Documents {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn is_open(&self, specifier: &ModuleSpecifier) -> bool {
|
||||
let Some(specifier) = self.resolve_specifier(specifier) else {
|
||||
return false;
|
||||
};
|
||||
self.open_docs.contains_key(&specifier)
|
||||
}
|
||||
|
||||
/// Return a collection of documents that are contained in the document store
|
||||
/// based on the provided filter.
|
||||
pub fn documents(&self, filter: DocumentsFilter) -> Vec<Arc<Document>> {
|
||||
|
|
|
@ -4064,7 +4064,9 @@ fn op_script_names(state: &mut OpState) -> Vec<String> {
|
|||
if seen.insert(specifier.as_str()) {
|
||||
if let Some(specifier) = documents.resolve_specifier(specifier) {
|
||||
// only include dependencies we know to exist otherwise typescript will error
|
||||
if documents.exists(&specifier) {
|
||||
if documents.exists(&specifier)
|
||||
&& (specifier.scheme() == "file" || documents.is_open(&specifier))
|
||||
{
|
||||
result.push(specifier.to_string());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -550,7 +550,7 @@ delete Object.prototype.__proto__;
|
|||
ts.toPath(
|
||||
fileName,
|
||||
this.getCurrentDirectory(),
|
||||
this.getCanonicalFileName(fileName),
|
||||
this.getCanonicalFileName.bind(this),
|
||||
);
|
||||
},
|
||||
// @ts-ignore Undocumented method.
|
||||
|
|
Loading…
Reference in a new issue