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

bug: Treesitter Sytnax Highlighting Not Working for PHP #575

Open
4 tasks done
Alaa-MK opened this issue Sep 7, 2024 · 2 comments
Open
4 tasks done

bug: Treesitter Sytnax Highlighting Not Working for PHP #575

Alaa-MK opened this issue Sep 7, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Alaa-MK
Copy link

Alaa-MK commented Sep 7, 2024

Did you check docs and existing issues?

  • I have read all the trouble.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of trouble.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.10.1

Operating system/version

MacOS Sonoma 14.6.1 (23G93)

Describe the bug

Treesitter syntax highlighting doesn't seem to work with PHP. I tried multiple commands, and none has syntax highlighting enabled. Note that syntax highlighting is working as expected with other file types on my end.
Commands I've tried:

  • qflist
  • loclist
  • Opening Telescope results in a Trouble list

I did some digging in the code, and I found that the lang is correctly set to php, and the parser is defined here.

Steps To Reproduce

  1. Use the following snippet in trouble-php/main.php
<?php
echo "hey";
echo "hey there";
  1. Run :grep hey main.php to create a qflist
  2. Run :Trouble qflist

You can try the same exact steps with trouble-py/main.py with the following snippet, and the syntax highlighting will work fine. So the problem seems specific to PHP.

print('hey there')
print('hey')

Expected Behavior

The code in the list should have syntax highlighting enabled.

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/trouble.nvim", opts = {} },
    {
        "nvim-treesitter/nvim-treesitter",
        build = ":TSUpdate",
        config = function()
            require('nvim-treesitter.configs').setup({
                ensure_installed = {'php', 'python'},
                highlight = {
                    enable = true,
                    indent = true,
                },
            })
        end
    }
},
})
@Alaa-MK Alaa-MK added the bug Something isn't working label Sep 7, 2024
Copy link
Contributor

github-actions bot commented Oct 8, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Oct 8, 2024
@Alaa-MK
Copy link
Author

Alaa-MK commented Oct 8, 2024

Any updates?

@github-actions github-actions bot removed the stale label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant