diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index d5acac8d7b4819..cbc839c46405f4 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -455,12 +455,17 @@ impl Document { pub fn is_diagnosable(&self) -> bool { matches!( self.media_type(), - // todo(#12410): Update with new media types for TS 4.5 MediaType::JavaScript | MediaType::Jsx + | MediaType::Mjs + | MediaType::Cjs | MediaType::TypeScript | MediaType::Tsx + | MediaType::Mts + | MediaType::Cts | MediaType::Dts + | MediaType::Dmts + | MediaType::Dcts ) } diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 94cc98f603ba66..59755db8bb25ad 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -326,12 +326,17 @@ impl Inner { if specifier.scheme() == "asset" { matches!( MediaType::from(specifier), - // todo(#12410): Update with new media types for TS 4.5 MediaType::JavaScript | MediaType::Jsx + | MediaType::Mjs + | MediaType::Cjs | MediaType::TypeScript | MediaType::Tsx + | MediaType::Mts + | MediaType::Cts | MediaType::Dts + | MediaType::Dmts + | MediaType::Dcts ) } else { self diff --git a/cli/tsc.rs b/cli/tsc.rs index 184fbd144b2b1f..a35ca9e7daa36e 100644 --- a/cli/tsc.rs +++ b/cli/tsc.rs @@ -144,31 +144,26 @@ fn get_tsc_media_type(specifier: &ModuleSpecifier) -> MediaType { if let Some(os_str) = path.file_stem() { if let Some(file_name) = os_str.to_str() { if file_name.ends_with(".d") { - // todo(#12410): Use Dmts for TS 4.5 - return MediaType::Dts; + return MediaType::Dmts; } } } - // todo(#12410): Use Mts for TS 4.5 - MediaType::TypeScript + MediaType::Mts } Some("cts") => { if let Some(os_str) = path.file_stem() { if let Some(file_name) = os_str.to_str() { if file_name.ends_with(".d") { - // todo(#12410): Use Dcts for TS 4.5 - return MediaType::Dts; + return MediaType::Dcts; } } } - // todo(#12410): Use Cts for TS 4.5 - MediaType::TypeScript + MediaType::Cts } Some("tsx") => MediaType::Tsx, Some("js") => MediaType::JavaScript, - // todo(#12410): Use correct media type for TS 4.5 - Some("mjs") => MediaType::JavaScript, - Some("cjs") => MediaType::JavaScript, + Some("mjs") => MediaType::Mjs, + Some("cjs") => MediaType::Cjs, Some("jsx") => MediaType::Jsx, _ => MediaType::Unknown, },