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

No semantic highlight with pylsp #1530

Closed
kalium222 opened this issue Jan 26, 2024 · 6 comments
Closed

No semantic highlight with pylsp #1530

kalium222 opened this issue Jan 26, 2024 · 6 comments

Comments

@kalium222
Copy link

kalium222 commented Jan 26, 2024

Hello, I got some problem when working with python environment. Here is how I config relative plugins:

Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'  

" register clangd
if executable('clangd')
    au User lsp_setup call lsp#register_server({
    \ 'name': 'clangd',
    \ 'cmd': {server_info->['clangd', '-background-index']},
 	\ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'],
    \ })
endif

" register pylsp
if executable('pylsp')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pylsp',
        \ 'cmd': {server_info->['pylsp']},
        \ 'allowlist': ['python'],
        \ })
endif   

" enable sementic highlighting
let g:lsp_semantic_enabled = 1

And I get pylsp by running pip install "python-lsp-server[all]", which should be OK from here.

And here is a comparison with semantic highlight for cpp with clangd.

@kalium222
Copy link
Author

Screenshot from 2024-01-27 01-18-14

@kalium222
Copy link
Author

How to solve this? Thanks.

@prabirshrestha
Copy link
Owner

You would want to look at the logs and see if it is enabled or not. Instructions in readme. Feel free to share the logs if you are still having issues.

@kalium222
Copy link
Author

The non-verbose log of these two files were similar, so i will show you the verbose version. They are quite long.
In the log for python, the researching result for "semantic" is two, which is much less than that in log for cpp.
Uploading py_v.log…

@kalium222
Copy link
Author

In comparison, it is log for cpp file: cpp_v.log

@kalium222
Copy link
Author

in fact i find that the output of :LspSemanticTokenModifer is []. Doesn't pylsp support for semantic tokens?

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

2 participants