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

Class semantic token #1049

Open
rpop0 opened this issue Feb 9, 2025 · 1 comment
Open

Class semantic token #1049

rpop0 opened this issue Feb 9, 2025 · 1 comment
Labels
awaiting response waiting for more info from the author - will eventually close if they don't respond language server

Comments

@rpop0
Copy link

rpop0 commented Feb 9, 2025

Hello, I'm not too familiar with how LSPs work and all but when using basedpyright in neovim with blink.cmp for the completion, their auto-bracketing feature does not seem to work for classes.

I have reported the bug on their end (Saghen/blink.cmp#1182) but the developer mentioned that this might be an issue with the LSP:

Unfortunately, I believe that classes don't show up as methods or functions in the semantic tokens so we don't have any way of reliably adding brackets in this case. You can request this feature on your LSP's bug tracker

@DetachHead DetachHead added language server needs investigation awaiting verification by a maintainer that the issue is valid labels Feb 9, 2025
@DetachHead
Copy link
Owner

could you provide some more info on what the issue is exactly? when you accept a completion on a class, do you want it to automatically add brackets like so?

Image

Image

this might be something we can do on the language server, but i don't think adding the function or method semantic token to them as suggested in Saghen/blink.cmp#1182 (comment) is a good idea because it will cause them to have the wrong colour when your editor applies the semantic highlighting.

if we do this though we will need to only add the brackets in cases where it's valid to do so. eg. when the class is used in a type annotation you wouldn't want the brackets to be added.

@DetachHead DetachHead added awaiting response waiting for more info from the author - will eventually close if they don't respond and removed needs investigation awaiting verification by a maintainer that the issue is valid labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response waiting for more info from the author - will eventually close if they don't respond language server
Projects
None yet
Development

No branches or pull requests

2 participants