mirror of
https://github.com/denoland/deno.git
synced 2024-12-01 16:51:13 -05:00
fix(lsp): wasm file import completions (#27018)
This commit is contained in:
parent
d6661884fd
commit
9fce24467b
1 changed files with 12 additions and 1 deletions
|
@ -27,7 +27,16 @@ pub fn is_importable_ext(path: &Path) -> bool {
|
|||
if let Some(ext) = get_extension(path) {
|
||||
matches!(
|
||||
ext.as_str(),
|
||||
"ts" | "tsx" | "js" | "jsx" | "mjs" | "mts" | "cjs" | "cts" | "json"
|
||||
"ts"
|
||||
| "tsx"
|
||||
| "js"
|
||||
| "jsx"
|
||||
| "mjs"
|
||||
| "mts"
|
||||
| "cjs"
|
||||
| "cts"
|
||||
| "json"
|
||||
| "wasm"
|
||||
)
|
||||
} else {
|
||||
false
|
||||
|
@ -222,6 +231,7 @@ mod test {
|
|||
assert!(is_script_ext(Path::new("foo.cjs")));
|
||||
assert!(is_script_ext(Path::new("foo.cts")));
|
||||
assert!(!is_script_ext(Path::new("foo.json")));
|
||||
assert!(!is_script_ext(Path::new("foo.wasm")));
|
||||
assert!(!is_script_ext(Path::new("foo.mjsx")));
|
||||
}
|
||||
|
||||
|
@ -243,6 +253,7 @@ mod test {
|
|||
assert!(is_importable_ext(Path::new("foo.cjs")));
|
||||
assert!(is_importable_ext(Path::new("foo.cts")));
|
||||
assert!(is_importable_ext(Path::new("foo.json")));
|
||||
assert!(is_importable_ext(Path::new("foo.wasm")));
|
||||
assert!(!is_importable_ext(Path::new("foo.mjsx")));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue