diff options
| author | kiyan42 <yazdani.kiyan@protonmail.com> | 2020-04-21 19:10:01 +0200 |
|---|---|---|
| committer | kiyan42 <yazdani.kiyan@protonmail.com> | 2020-04-21 19:10:01 +0200 |
| commit | a7810728d2727120fe73df49618a8c72949371e8 (patch) | |
| tree | c6d83b60e79bb7ff66778ea263cacdd233f97339 /lua | |
| parent | Merge pull request #13 from kyazdani42/fix-install (diff) | |
| download | nvim-treesitter-a7810728d2727120fe73df49618a8c72949371e8.tar nvim-treesitter-a7810728d2727120fe73df49618a8c72949371e8.tar.gz nvim-treesitter-a7810728d2727120fe73df49618a8c72949371e8.tar.bz2 nvim-treesitter-a7810728d2727120fe73df49618a8c72949371e8.tar.lz nvim-treesitter-a7810728d2727120fe73df49618a8c72949371e8.tar.xz nvim-treesitter-a7810728d2727120fe73df49618a8c72949371e8.tar.zst nvim-treesitter-a7810728d2727120fe73df49618a8c72949371e8.zip | |
refacto/feat: enable csharp install, fix clone
- clone only master at depth 1 to avoid long download from huge repos.
- use ft to specify folder name to clone so csharp can be cloned and
used properly.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 62405bae1..1d4785522 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -72,11 +72,11 @@ M.repositories = { url = "https://github.com/tree-sitter/tree-sitter-swift", files = { "src/parser.c" }, }, - -- TODO: find a way to install c-sharp and typescript properly - -- csharp = { - -- url = "https://github.com/tree-sitter/tree-sitter-c-sharp", - -- files = { "src/parser.c", "src/scanner.c" }, - -- }, + csharp = { + url = "https://github.com/tree-sitter/tree-sitter-c-sharp", + files = { "src/parser.c", "src/scanner.c" }, + }, + -- TODO: find a way to install typescript properly } local function get_package_path() @@ -120,7 +120,8 @@ local function iter_cmd(cmd_list, i, ft) end local function run_install(cache_folder, package_path, ft, repo) - local project_repo = cache_folder..'/tree-sitter-'..ft + local project_name = 'tree-sitter-'..ft + local project_repo = cache_folder..'/'..project_name local parser_lib_name = package_path.."/parser/"..ft..".so" local command_list = { { @@ -134,7 +135,7 @@ local function run_install(cache_folder, package_path, ft, repo) info = 'Downloading...', err = 'Error during download, please verify your internet connection', opts = { - args = { 'clone', repo.url }, + args = { 'clone', '--single-branch', '--branch', 'master', '--depth', '1', repo.url, project_name }, cwd = cache_folder, }, }, |
