I noticed that for pyright language server, some LSP snippets were not expanding correctly. It is particularly happening inside classes for some dunders(like __init__ or __str__). What actually happens is it indents the second line incorrectly. I did some research and found that those snippets were expanding accordingly in AstroNvim and LazyVim configs. I copy pasted some lines from those configs, but no luck. An example gif is added demonstrating the issue.
Steps to reproduce
Setup pyright language server with default configs
Open any python file
Create a class
Try to create any dunder(like __init__). cmp will give suggestions. There will be one suggestion which is a snippet provided by pyright language server
Expand that snippet
See the error
Expected behavior
The second line(with pass keyword) should have indented 1 level deeper
Actual behavior
The second line(with pass keyword) is indented at the same level as def keyword which is wrong.
FAQ
Announcement
Minimal reproducible full config
Description
I noticed that for
pyright
language server, some LSP snippets were not expanding correctly. It is particularly happening inside classes for some dunders(like__init__
or__str__
). What actually happens is it indents the second line incorrectly. I did some research and found that those snippets were expanding accordingly inAstroNvim
andLazyVim
configs. I copy pasted some lines from those configs, but no luck. An example gif is added demonstrating the issue.Steps to reproduce
pyright
language server with default configsdunder
(like__init__
). cmp will give suggestions. There will be one suggestion which is a snippet provided bypyright
language serverExpected behavior
The second line(with
pass
keyword) should have indented 1 level deeperActual behavior
The second line(with
pass
keyword) is indented at the same level asdef
keyword which is wrong.Additional context
This gif demonstrates the actual issue.