aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2022-06-25 11:51:21 +0200
committerStephan Seitz <stephan.seitz@fau.de>2022-06-25 12:01:22 +0200
commitd810c386341fbf0d49895a2cdd6a2b63b945b71a (patch)
tree61d74cb82e03c28afee171e51aa5167f55ef8253
parentfix(haskell): highlight exp_name as function in infix operations (diff)
downloadnvim-treesitter-d810c386341fbf0d49895a2cdd6a2b63b945b71a.tar
nvim-treesitter-d810c386341fbf0d49895a2cdd6a2b63b945b71a.tar.gz
nvim-treesitter-d810c386341fbf0d49895a2cdd6a2b63b945b71a.tar.bz2
nvim-treesitter-d810c386341fbf0d49895a2cdd6a2b63b945b71a.tar.lz
nvim-treesitter-d810c386341fbf0d49895a2cdd6a2b63b945b71a.tar.xz
nvim-treesitter-d810c386341fbf0d49895a2cdd6a2b63b945b71a.tar.zst
nvim-treesitter-d810c386341fbf0d49895a2cdd6a2b63b945b71a.zip
Chore: remove prefix from parser "location" property
This was very confusing when using the location property as it always had to start with "tree-sitter-<lang>" for no real reason.
-rw-r--r--lua/nvim-treesitter/install.lua6
-rw-r--r--lua/nvim-treesitter/parsers.lua10
2 files changed, 10 insertions, 6 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index 822e00e69..e709849ad 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -242,7 +242,11 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync,
if from_local_path then
compile_location = repo.url
else
- local repo_location = string.gsub(repo.location or project_name, "/", path_sep)
+ local repo_location = project_name
+ if repo.location then
+ repo_location = repo_location .. "/" .. repo.location
+ end
+ repo_location = repo_location:gsub("/", path_sep)
compile_location = utils.join_path(cache_folder, repo_location)
end
local parser_lib_name = utils.join_path(install_folder, lang) .. ".so"
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 2cf2f4364..dc02c9322 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -398,7 +398,7 @@ list.ocaml = {
install_info = {
url = "https://github.com/tree-sitter/tree-sitter-ocaml",
files = { "src/parser.c", "src/scanner.cc" },
- location = "tree-sitter-ocaml/ocaml",
+ location = "ocaml",
},
maintainers = { "@undu" },
}
@@ -407,7 +407,7 @@ list.ocaml_interface = {
install_info = {
url = "https://github.com/tree-sitter/tree-sitter-ocaml",
files = { "src/parser.c", "src/scanner.cc" },
- location = "tree-sitter-ocaml_interface/interface",
+ location = "interface",
},
maintainers = { "@undu" },
filetype = "ocamlinterface",
@@ -463,7 +463,7 @@ list.typescript = {
install_info = {
url = "https://github.com/tree-sitter/tree-sitter-typescript",
files = { "src/parser.c", "src/scanner.c" },
- location = "tree-sitter-typescript/typescript",
+ location = "typescript",
generate_requires_npm = true,
},
maintainers = { "@steelsojka" },
@@ -473,7 +473,7 @@ list.tsx = {
install_info = {
url = "https://github.com/tree-sitter/tree-sitter-typescript",
files = { "src/parser.c", "src/scanner.c" },
- location = "tree-sitter-tsx/tsx",
+ location = "tsx",
generate_requires_npm = true,
},
filetype = "typescriptreact",
@@ -1083,7 +1083,7 @@ list.v = {
install_info = {
url = "https://github.com/vlang/vls",
files = { "src/parser.c", "src/scanner.c" },
- location = "tree-sitter-v/tree_sitter_v",
+ location = "tree_sitter_v",
generate_requires_npm = false,
requires_generate_from_grammar = false,
},