After this we see that we get an error. However the error is wrong as the function returns the Repository. Also if we go to definition of init_repository we can see some undefined symbols.
Type "pygit2.repository.Repository | pygit2._pygit2.Repository" is not
assignable to declared type "Repository"
Type "pygit2.repository.Repository | pygit2._pygit2.Repository" is not
assignable to type "Repository"
"pygit2._pygit2.Repository" is not assignable to "pygit2.repository.
Repository" (Pyright reportAssignmentType)
──────────────────────────────────────────────────────────────────────────────
https://github.com/microsoft/pyright/blob/main/docs/configuration.
md#reportAssignmentType
The problem can also be reproduced with vscode if we add an empty pyrightconfig.json into the root of the project 111 folder.
cat pyrightconfig.json
{
}
After I enabled debug logs with 'python.analysis.logLevel', 'Trace' and compared the logs in vscode for both cases I could not see what is different. However with vscode if I remove the pyrightconfig.json completion works as expected.
But my question is with respect what is different between vscode and coc-pyright with respect to the pyrightconfig.json. Why does pyright works differently in the case of coc-pyright and vscode?
As I would expect if I remove the pyrightconfig.json the error should go away.
What's the output of
:CocCommand pyright.version
[coc.nvim] coc-pyright 1.1.380 with Pyright 1.1.382
The problem comes from the following steps
After this we see that we get an error. However the error is wrong as the function returns the
Repository
. Also if we go to definition ofinit_repository
we can see some undefined symbols.The problem can also be reproduced with vscode if we add an empty
pyrightconfig.json
into the root of the project111
folder.After I enabled debug logs with
'python.analysis.logLevel', 'Trace'
and compared the logs in vscode for both cases I could not see what is different. However with vscode if I remove thepyrightconfig.json
completion works as expected.The bug is probably within pyright itself, therefore I filled an issue there as well https://github.com/microsoft/pyright/issues/9104#issue-2554197146.
But my question is with respect what is different between vscode and coc-pyright with respect to the
pyrightconfig.json
. Why does pyright works differently in the case ofcoc-pyright
andvscode
?As I would expect if I remove the
pyrightconfig.json
the error should go away.