Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Syntax highlighting in preview window doesn't work when using Treesitter #283

Open
benalf opened this issue Sep 27, 2023 · 0 comments
Open

Comments

@benalf
Copy link

benalf commented Sep 27, 2023

Using a bare-bones setup. As soon as PHP treesitter parser is installed, syntax highlighting goes blank in the preview window.

It's seems to be related to the janky language design requiring <? opening tag at the start of the file. If the preview window includes the tag, highlighting works fine. Other languages don't have this problem.

php-ts-navigator

Minimal config for reproduction:

local fn = vim.fn

local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
  PACKER_BOOTSTRAP = fn.system({
    "git",
    "clone",
    "--depth",
    "1",
    "https://github.com/wbthomason/packer.nvim",
    install_path,
  })
  vim.cmd([[packadd packer.nvim]])
end

require('packer').startup(function(use)
  use({
    'williamboman/nvim-lsp-installer',
    config = function()
      require('nvim-lsp-installer').setup({})
    end,
  })
  use({
    "nvim-treesitter/nvim-treesitter",
    run = ':TSUpdate',
    config = function()
      require("nvim-treesitter.configs").setup({
       	-- ensure_installed = {"php"},
      })
    end
  })
  use ({
    "williamboman/mason.nvim",
    config = function ()
      require("mason").setup({})
    end
  })
  use({
      'ray-x/navigator.lua',
      requires = {
          { 'ray-x/guihua.lua', run = 'cd lua/fzy && make' },
          { 'neovim/nvim-lspconfig' },
      },
      config = function()
        require'navigator'.setup({});
      end
  })
end)

require('packer').sync()

vim.cmd [[
  colorscheme murphy
  set background=dark
]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant