From 48e15f77f7c3e5c48d754966784afabdb211c2ac Mon Sep 17 00:00:00 2001 From: Jaakko Paju Date: Thu, 21 Nov 2024 00:03:46 +0200 Subject: [PATCH] Add package.json and (and tsconfig.json) for TS/JS language config roots (#10652) * Add package.json and tsconfig.json for TS/JS language config roots * Add root to Javascript --- languages.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/languages.toml b/languages.toml index 5ad48c0c8..0661d9c3e 100644 --- a/languages.toml +++ b/languages.toml @@ -742,6 +742,7 @@ injection-regex = "(js|javascript)" language-id = "javascript" file-types = ["js", "mjs", "cjs", "rules", "es6", "pac", { glob = ".node_repl_history" }, { glob = "jakefile" }] shebangs = ["node"] +roots = [ "package.json" ] comment-token = "//" block-comment-tokens = { start = "/*", end = "*/" } language-servers = [ "typescript-language-server" ] @@ -769,6 +770,7 @@ scope = "source.jsx" injection-regex = "jsx" language-id = "javascriptreact" file-types = ["jsx"] +roots = [ "package.json" ] comment-token = "//" block-comment-tokens = { start = "/*", end = "*/" } language-servers = [ "typescript-language-server" ] @@ -782,6 +784,7 @@ injection-regex = "(ts|typescript)" language-id = "typescript" file-types = ["ts", "mts", "cts"] shebangs = ["deno", "bun", "ts-node"] +roots = [ "package.json", "tsconfig.json" ] comment-token = "//" block-comment-tokens = { start = "/*", end = "*/" } language-servers = [ "typescript-language-server" ] @@ -814,6 +817,7 @@ scope = "source.tsx" injection-regex = "(tsx)" # |typescript language-id = "typescriptreact" file-types = ["tsx"] +roots = [ "package.json", "tsconfig.json" ] comment-token = "//" block-comment-tokens = { start = "/*", end = "*/" } language-servers = [ "typescript-language-server" ]