diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2023-06-08 13:25:31 +0200 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2025-05-12 18:43:40 +0200 |
| commit | f0a984347c0e9c1e6efc493bbfb9b062041a9855 (patch) | |
| tree | 16c918a2579c135a77ff06d85c5b679fc0d87f58 | |
| parent | refactor: use vim.system (#4923) (diff) | |
| download | nvim-treesitter-f0a984347c0e9c1e6efc493bbfb9b062041a9855.tar nvim-treesitter-f0a984347c0e9c1e6efc493bbfb9b062041a9855.tar.gz nvim-treesitter-f0a984347c0e9c1e6efc493bbfb9b062041a9855.tar.bz2 nvim-treesitter-f0a984347c0e9c1e6efc493bbfb9b062041a9855.tar.lz nvim-treesitter-f0a984347c0e9c1e6efc493bbfb9b062041a9855.tar.xz nvim-treesitter-f0a984347c0e9c1e6efc493bbfb9b062041a9855.tar.zst nvim-treesitter-f0a984347c0e9c1e6efc493bbfb9b062041a9855.zip | |
feat!: drop makefile support, norg parser
Norg install_info and queries are maintained by neorg.
All other parsers are compatible with C++11, so fix that as standard.
(Can be bumped if all supported platforms support C++14.)
Remove Makefile support, as it's no longer needed.
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | SUPPORTED_LANGUAGES.md | 1 | ||||
| -rw-r--r-- | TODO.md | 1 | ||||
| -rw-r--r-- | lockfile.json | 3 | ||||
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 15 | ||||
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 11 | ||||
| -rw-r--r-- | scripts/compile_parsers.makefile | 52 |
7 files changed, 3 insertions, 81 deletions
@@ -159,6 +159,7 @@ If Neovim does not detect your language's filetype by default, you can use [Neov You can also skip step 2 and use `:TSInstallFromGrammar zimbu` to install directly from a `grammar.js` in the top-level directory specified by `url`. Once the parser is installed, you can update it (from the latest revision of the `main` branch if `url` is a Github repository) with `:TSUpdate zimbu`. +**Note:** Parsers using external scanner need to be written in C. C++ scanners are no longer supported. ## Adding queries diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 18780fd6f..0dd2c1e9f 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -168,7 +168,6 @@ jsx (queries only)[^jsx] | | `HFIJ ` | | | @steelsojka [nim_format_string](https://github.com/aMOPel/tree-sitter-nim-format-string) | community | `H J ` | | | @aMOPel [ninja](https://github.com/alemuller/tree-sitter-ninja) | | `HFI ` | | | @alemuller [nix](https://github.com/cstrahan/tree-sitter-nix) | | `HF JL` | | | @leo60228 -[norg](https://github.com/nvim-neorg/tree-sitter-norg) | unstable | ` ` | | | @JoeyGrajciar, @vhyrro [nqc](https://github.com/amaanq/tree-sitter-nqc) | stable | `HFIJL` | | | @amaanq [objc](https://github.com/amaanq/tree-sitter-objc) | | `HFIJL` | | | @amaanq [objdump](https://github.com/ColinKennedy/tree-sitter-objdump) | community | `H J ` | | | @ColinKennedy @@ -7,7 +7,6 @@ This document lists the planned and finished changes in this rewrite towards [Nv - [ ] **`query_predicates.lua`:** upstream/remove - [ ] **`parsers.lua`:** assign tiers - [ ] **`parsers.lua`:** modularize? -- [ ] **`install.lua`:** drop norg (and makefile); document c++11 requirement - [ ] **`locals.lua`:** move to `nvim-treesitter-refactor`? - [ ] **update-lockfile:** allow specifying version in addition to commit hash (for Tier 1) - [ ] **update-lockfile:** one commit per parser/tier? diff --git a/lockfile.json b/lockfile.json index 3f87966c6..4967a911c 100644 --- a/lockfile.json +++ b/lockfile.json @@ -527,9 +527,6 @@ "nix": { "revision": "cfc53fd287d23ab7281440a8526c73542984669b" }, - "norg": { - "revision": "d89d95af13d409f30a6c7676387bde311ec4a2c8" - }, "nqc": { "revision": "14e6da1627aaef21d2b2aa0c37d04269766dcc1d" }, diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 097a5ab0e..9f99f0cfe 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -391,19 +391,8 @@ end ---@param compile_location string ---@return SystemCompleted local function do_compile(repo, cc, compile_location) - local make = M.select_executable({ 'gmake', 'make' }) - - local cmd --- @type string[] - if cc:find('cl$') or cc:find('cl.exe$') or not repo.use_makefile or iswin or not make then - local args = vim.tbl_flatten(select_compiler_args(repo, cc)) - cmd = vim.list_extend({ cc }, args) - else - cmd = { - make, - '--makefile=' .. M.get_package_path('scripts', 'compile_parsers.makefile'), - 'CC=' .. cc, - } - end + local args = vim.tbl_flatten(select_compiler_args(repo, cc)) + local cmd = vim.list_extend({ cc }, args) return system(cmd, { cwd = compile_location }) end diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 357d11650..7f0041e36 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -6,7 +6,6 @@ ---@field generate_requires_npm boolean|nil ---@field requires_generate_from_grammar boolean|nil ---@field location string|nil ----@field use_makefile boolean|nil ---@class ParserInfo ---@field install_info InstallInfo @@ -1583,16 +1582,6 @@ M.configs = { maintainers = { '@leo60228' }, }, - norg = { - install_info = { - url = 'https://github.com/nvim-neorg/tree-sitter-norg', - files = { 'src/parser.c', 'src/scanner.cc' }, - use_makefile = true, - }, - maintainers = { '@JoeyGrajciar', '@vhyrro' }, - tier = 4, - }, - nqc = { install_info = { url = 'https://github.com/amaanq/tree-sitter-nqc', diff --git a/scripts/compile_parsers.makefile b/scripts/compile_parsers.makefile deleted file mode 100644 index 020b45285..000000000 --- a/scripts/compile_parsers.makefile +++ /dev/null @@ -1,52 +0,0 @@ -CFLAGS ?= -Os -std=c99 -fPIC -CXX_STANDARD ?= c++14 -CXXFLAGS ?= -Os -std=$(CXX_STANDARD) -fPIC -LDFLAGS ?= -SRC_DIR ?= ./src -DEST_DIR ?= ./dest - -ifeq ($(OS),Windows_NT) - SHELL := powershell.exe - .SHELLFLAGS := -NoProfile -command - CP := Copy-Item -Recurse -ErrorAction SilentlyContinue - MKDIR := New-Item -ItemType directory -ErrorAction SilentlyContinue - TARGET := parser.dll - rmf = Write-Output $(1) | foreach { if (Test-Path $$_) { Remove-Item -Force } } -else - CP := cp - MKDIR := mkdir -p - TARGET := parser.so - rmf = rm -rf $(1) -endif - -ifneq ($(wildcard $(SRC_DIR)/*.cc),) - LDFLAGS += -lstdc++ -endif - -OBJECTS := parser.o - -ifneq ($(wildcard $(SRC_DIR)/scanner.*),) - OBJECTS += scanner.o -endif - -all: $(TARGET) - -$(TARGET): $(OBJECTS) - $(CC) $(OBJECTS) -o $(TARGET) -shared $(LDFLAGS) - -%.o: $(SRC_DIR)/%.c - $(CC) -c $(CFLAGS) -I$(SRC_DIR) -o $@ $< - -%.o: $(SRC_DIR)/%.cc - $(CC) -c $(CXXFLAGS) -I$(SRC_DIR) -o $@ $< - -clean: - $(call rmf,$(TARGET) $(OBJECTS)) - -$(DEST_DIR): - @$(MKDIR) $(DEST_DIR) - -install: $(TARGET) $(DEST_DIR) - $(CP) $(TARGET) $(DEST_DIR)/ - -.PHONY: clean |
