From 4449bcaa86ac5b1e7019e92d8eb6320ca1ae3e47 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Mon, 13 Jan 2025 15:03:20 +0000 Subject: [PATCH] fix(treesitter): manually start http parser (fix #508) --- ftplugin/http.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ftplugin/http.lua b/ftplugin/http.lua index 7ea45af..5beb386 100644 --- a/ftplugin/http.lua +++ b/ftplugin/http.lua @@ -2,6 +2,13 @@ vim.bo.commentstring = "# %s" vim.wo.conceallevel = 0 vim.opt.comments:remove("n:>") +-- NOTE: Manually start tree-sitter-http highlighting. +-- Just in case user didn't enabled auto highlighting option. +local ok = pcall(vim.treesitter.start, 0, "http") +if not ok then + vim.notify("Failed to attach tree-sitter-http parser to current buffer", vim.log.levels.ERROR, { title = "rest.nvim" }) +end + local dotenv = require("rest-nvim.dotenv") vim.b._rest_nvim_count = 1 -- 2.51.2