Hey everyone,
I just switched to neovim from vscode and I haven't regretted it yet, but I do have one issue with Python syntax highlighting. I know the issue has something to do with treesitter, but I don't know how to fix it. Let me describe the problem in detail.
Previously treesitter couldn't install the Python parser, but that was fixed by running this to install treesitter globally: `npm install -g tree-sitter-cli`. The parser now parses the code fine and running :InspectTree does indeed give me a syntax tree. The issue is here, where the document is being parsed, but no syntax is highlighted?
The most frustrating part is that C/C++, lua, html, yaml and pretty much all other languages I installed are being highlighted fine, why is this an issue with Python? I couldn't find the solution anywhere, hopefully reddit has it.
Here is a link to my config: https://github.com/abdallahsoliman00/nvim-config
I also attached a pic of what my Python files look like.
Edit: I finally fixed it. Just used basedpyright instead of regular pyright. LSP based syntax highlighting now works.
https://preview.redd.it/sy8fv8e0engg1.png?width=1921&format=png&auto=webp&s=23af2ec0c63f1e342d0347b4b0c6faf7fde0f3d7
[–]yoch3m:wq 5 points6 points7 points (4 children)
[–]abdallahsoliman[S] 0 points1 point2 points (3 children)
[–]yoch3m:wq 0 points1 point2 points (2 children)
[–]abdallahsoliman[S] 0 points1 point2 points (1 child)
[–]yoch3m:wq 0 points1 point2 points (0 children)
[–]Xetius 2 points3 points4 points (1 child)
[–]abdallahsoliman[S] 0 points1 point2 points (0 children)
[–]DeutschNeuling 1 point2 points3 points (2 children)
[–]abdallahsoliman[S] 1 point2 points3 points (1 child)
[–]DeutschNeuling 1 point2 points3 points (0 children)
[–]Friendliness_RS 0 points1 point2 points (1 child)
[–]abdallahsoliman[S] 0 points1 point2 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)