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.
This commit is contained in:
Stephan Seitz 2022-06-25 11:51:21 +02:00
parent 74ec4e1d5c
commit d810c38634
2 changed files with 10 additions and 6 deletions

View file

@ -242,7 +242,11 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync,
if from_local_path then if from_local_path then
compile_location = repo.url compile_location = repo.url
else 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) compile_location = utils.join_path(cache_folder, repo_location)
end end
local parser_lib_name = utils.join_path(install_folder, lang) .. ".so" local parser_lib_name = utils.join_path(install_folder, lang) .. ".so"

View file

@ -398,7 +398,7 @@ list.ocaml = {
install_info = { install_info = {
url = "https://github.com/tree-sitter/tree-sitter-ocaml", url = "https://github.com/tree-sitter/tree-sitter-ocaml",
files = { "src/parser.c", "src/scanner.cc" }, files = { "src/parser.c", "src/scanner.cc" },
location = "tree-sitter-ocaml/ocaml", location = "ocaml",
}, },
maintainers = { "@undu" }, maintainers = { "@undu" },
} }
@ -407,7 +407,7 @@ list.ocaml_interface = {
install_info = { install_info = {
url = "https://github.com/tree-sitter/tree-sitter-ocaml", url = "https://github.com/tree-sitter/tree-sitter-ocaml",
files = { "src/parser.c", "src/scanner.cc" }, files = { "src/parser.c", "src/scanner.cc" },
location = "tree-sitter-ocaml_interface/interface", location = "interface",
}, },
maintainers = { "@undu" }, maintainers = { "@undu" },
filetype = "ocamlinterface", filetype = "ocamlinterface",
@ -463,7 +463,7 @@ list.typescript = {
install_info = { install_info = {
url = "https://github.com/tree-sitter/tree-sitter-typescript", url = "https://github.com/tree-sitter/tree-sitter-typescript",
files = { "src/parser.c", "src/scanner.c" }, files = { "src/parser.c", "src/scanner.c" },
location = "tree-sitter-typescript/typescript", location = "typescript",
generate_requires_npm = true, generate_requires_npm = true,
}, },
maintainers = { "@steelsojka" }, maintainers = { "@steelsojka" },
@ -473,7 +473,7 @@ list.tsx = {
install_info = { install_info = {
url = "https://github.com/tree-sitter/tree-sitter-typescript", url = "https://github.com/tree-sitter/tree-sitter-typescript",
files = { "src/parser.c", "src/scanner.c" }, files = { "src/parser.c", "src/scanner.c" },
location = "tree-sitter-tsx/tsx", location = "tsx",
generate_requires_npm = true, generate_requires_npm = true,
}, },
filetype = "typescriptreact", filetype = "typescriptreact",
@ -1083,7 +1083,7 @@ list.v = {
install_info = { install_info = {
url = "https://github.com/vlang/vls", url = "https://github.com/vlang/vls",
files = { "src/parser.c", "src/scanner.c" }, files = { "src/parser.c", "src/scanner.c" },
location = "tree-sitter-v/tree_sitter_v", location = "tree_sitter_v",
generate_requires_npm = false, generate_requires_npm = false,
requires_generate_from_grammar = false, requires_generate_from_grammar = false,
}, },