fannheyward / coc-pyright

Pyright extension for coc.nvim
MIT License
1.28k stars 47 forks source link

No effect after installing coc-pyright #587

Closed yukinoyoyi closed 3 years ago

yukinoyoyi commented 3 years ago

CocInfo

## versions

vim version: VIM - Vi IMproved 8.1 8012269
node version: v16.6.1
coc.nvim version: 0.0.80-9fd90ad761
coc.nvim directory: /home/alice/.vim/plugged/coc.nvim
term: dumb
platform: linux

1. coc-settings.json with no change

coc-settings.json

none

Log of coc.nvim

2021-08-06T14:59:25.357 INFO (pid:30850) [services] - registered service "pyright"
2021-08-06T14:59:25.359 INFO (pid:30850) [services] - Pyright Server state change: stopped => starting
2021-08-06T14:59:25.370 INFO (pid:30850) [plugin] - coc.nvim 0.0.80-9fd90ad761 initialized with node: v16.6.1 after 132ms
2021-08-06T14:59:25.478 INFO (pid:30850) [services] - Pyright Server state change: starting => running
2021-08-06T14:59:25.482 INFO (pid:30850) [services] - service pyright started
2021-08-06T14:59:28.887 INFO (pid:30850) [attach] - receive notification: runCommand [ 'workspace.showOutput', 'Pyright' ]
2021-08-06T14:59:29.250 INFO (pid:30850) [attach] - receive notification: highlight []
2021-08-06T14:59:33.551 INFO (pid:30850) [attach] - receive notification: highlight []
2021-08-06T14:59:34.395 INFO (pid:30850) [attach] - receive notification: highlight []
2021-08-06T14:59:34.740 INFO (pid:30850) [attach] - receive notification: highlight []
2021-08-06T14:59:35.645 INFO (pid:30850) [attach] - receive notification: highlight []
2021-08-06T14:59:47.604 INFO (pid:30850) [attach] - receive notification: highlight []
2021-08-06T15:00:19.123 INFO (pid:30850) [attach] - receive notification: highlight []
2021-08-06T15:00:20.393 INFO (pid:30850) [attach] - receive notification: highlight []
2021-08-06T15:00:24.340 INFO (pid:30850) [attach] - receive notification: runCommand [ 'pyright.version' ]
2021-08-06T15:00:24.643 INFO (pid:30850) [attach] - receive notification: highlight []
2021-08-06T15:01:41.449 INFO (pid:30850) [attach] - receive notification: highlight []
2021-08-06T15:01:46.214 INFO (pid:30850) [attach] - receive notification: showInfo []

What's the output of :CocCommand pyright.version [coc.nvim] coc-pyright 1.1.159 with Pyright 1.1.159

What's the output of :CocCommand workspace.showOutput Pyright

Workspace: /home/alice/Documents/XJTLU/Python/Python
Using python from /home/alice/Documents/XJTLU/Python/Python/venv/bin/python

[Info  - 2:59:25 PM] Pyright language server 1.1.159 starting
[Info  - 2:59:25 PM] Server root directory: /home/alice/.config/coc/extensions/node_modules/coc-pyright/node_modules/pyright/dist/
[Info  - 2:59:25 PM] No configuration file found.
[Info  - 2:59:25 PM] No pyproject.toml file found.
[Info  - 2:59:25 PM] Setting pythonPath for service "Python": "/home/alice/Documents/XJTLU/Python/Python/venv/bin/python"
[Warn  - 2:59:25 PM] stubPath /home/alice/Documents/XJTLU/Python/Python/typings is not a valid directory.
[Info  - 2:59:25 PM] Assuming Python version 3.8
[Info  - 2:59:25 PM] Assuming Python platform Linux
Exception received when installing recursive file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
Exception received when installing recursive file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
[Info  - 2:59:25 PM] Searching for source files
[Info  - 2:59:25 PM] Auto-excluding /home/alice/Documents/XJTLU/Python/Python/venv
[Info  - 2:59:25 PM] Found 1 source file

2. After add "pyright.trace.server": "verbose" to coc-settings.json

coc-settings.json

{
"pyright.trace.server": "verbose"
}
## versions

vim version: VIM - Vi IMproved 8.1 8012269
node version: v16.6.1
coc.nvim version: 0.0.80-9fd90ad761
coc.nvim directory: /home/alice/.vim/plugged/coc.nvim
term: dumb
platform: linux

## Log of coc.nvim

2021-08-06T15:22:21.962 INFO (pid:33318) [services] - registered service "pyright"
2021-08-06T15:22:21.964 INFO (pid:33318) [services] - Pyright Server state change: stopped => starting
2021-08-06T15:22:21.975 INFO (pid:33318) [plugin] - coc.nvim 0.0.80-9fd90ad761 initialized with node: v16.6.1 after 129ms
2021-08-06T15:22:22.089 INFO (pid:33318) [services] - Pyright Server state change: starting => running
2021-08-06T15:22:22.093 INFO (pid:33318) [services] - service pyright started
2021-08-06T15:22:25.267 INFO (pid:33318) [attach] - receive notification: showInfo []

What's the output of :CocCommand pyright.version [coc.nvim] coc-pyright 1.1.159 with Pyright 1.1.159

What's the output of :CocCommand workspace.showOutput Pyright


Workspace: /home/alice/Documents/XJTLU/Python/Python
Using python from /home/alice/Documents/XJTLU/Python/Python/venv/bin/python

[Trace - 2:54:04 PM] Sending request 'initialize - (0)'.
Params: {
    "processId": 29428,
    "rootPath": "/home/alice/Documents/XJTLU/Python/Python",
    "rootUri": "file:///home/alice/Documents/XJTLU/Python/Python",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
                "failureHandling": "textOnlyTransactional"
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "didChangeWatchedFiles": {
                "dynamicRegistration": true
            },
            "symbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                }
            },
            "codeLens": {
                "refreshSupport": true
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true,
            "semanticTokens": {
                "refreshSupport": true
            },
            "fileOperations": {
                "dynamicRegistration": true,
                "didCreate": true,
                "didRename": true,
                "didDelete": true,
                "willCreate": true,
                "willRename": true,
                "willDelete": true
            },
            "workspaceFolders": true
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true,
                "versionSupport": false,
                "tagSupport": {
                    "valueSet": [
                        1,
                        2
                    ]
                }
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "deprecatedSupport": true,
                    "preselectSupport": true,
                    "insertReplaceSupport": true,
                    "tagSupport": {
                        "valueSet": [
                            1
                        ]
                    },
                    "resolveSupport": {
                        "properties": [
                            "documentation",
                            "detail",
                            "additionalTextEdits"
                        ]
                    },
                    "insertTextModeSupport": {
                        "valueSet": [
                            1,
                            2
                        ]
                    }
                },
                "completionItemKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "activeParameterSupport": false,
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    }
                }
            },
            "definition": {
                "dynamicRegistration": true
            },
            "references": {
                "dynamicRegistration": true
            },
            "documentHighlight": {
                "dynamicRegistration": true
            },
            "documentSymbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "hierarchicalDocumentSymbolSupport": true,
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                }
            },
            "codeAction": {
                "dynamicRegistration": true,
                "isPreferredSupport": true,
                "disabledSupport": true,
                "dataSupport": true,
                "honorsChangeAnnotations": false,
                "resolveSupport": {
                    "properties": [
                        "edit"
                    ]
                },
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                }
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true,
                "prepareSupport": true
            },
            "documentLink": {
                "dynamicRegistration": true,
                "tooltipSupport": true
            },
            "typeDefinition": {
                "dynamicRegistration": true
            },
            "implementation": {
                "dynamicRegistration": true
            },
            "declaration": {
                "dynamicRegistration": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            },
            "selectionRange": {
                "dynamicRegistration": true
            },
            "callHierarchy": {
                "dynamicRegistration": true
            },
            "semanticTokens": {
                "dynamicRegistration": true,
                "tokenTypes": [
                    "namespace",
                    "type",
                    "class",
                    "enum",
                    "interface",
                    "struct",
                    "typeParameter",
                    "parameter",
                    "variable",
                    "property",
                    "enumMember",
                    "event",
                    "function",
                    "method",
                    "macro",
                    "keyword",
                    "modifier",
                    "comment",
                    "string",
                    "number",
                    "regexp",
                    "operator"
                ],
                "tokenModifiers": [
                    "declaration",
                    "definition",
                    "readonly",
                    "static",
                    "deprecated",
                    "abstract",
                    "async",
                    "modification",
                    "documentation",
                    "defaultLibrary"
                ],
                "formats": [
                    "relative"
                ],
                "requests": {
                    "range": true,
                    "full": {
                        "delta": true
                    }
                },
                "multilineTokenSupport": false,
                "overlappingTokenSupport": false
            },
            "linkedEditingRange": {
                "dynamicRegistration": true
            }
        },
        "window": {
            "showMessage": {
                "messageActionItem": {
                    "additionalPropertiesSupport": false
                }
            },
            "showDocument": {
                "support": false
            },
            "workDoneProgress": true
        },
        "general": {
            "regularExpressions": {
                "engine": "ECMAScript",
                "version": "ES2020"
            },
            "markdown": {
                "parser": "marked",
                "version": "1.1.0"
            }
        }
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///home/alice/Documents/XJTLU/Python/Python",
            "name": "Python"
        }
    ],
    "locale": "en_US",
    "clientInfo": {
        "name": "coc.nvim",
        "version": "0.0.80"
    },
    "workDoneToken": "6b43b15f-59e2-45ad-8723-e0242c8abb62"
}

[Trace - 2:54:04 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Pyright language server 1.1.159 starting"
}

[Info  - 2:54:04 PM] Pyright language server 1.1.159 starting
[Trace - 2:54:04 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Server root directory: /home/alice/.config/coc/extensions/node_modules/coc-pyright/node_modules/pyright/dist/"
}

[Info  - 2:54:04 PM] Server root directory: /home/alice/.config/coc/extensions/node_modules/coc-pyright/node_modules/pyright/dist/
[Trace - 2:54:04 PM] Received response 'initialize - (0)' in 98ms.
Result: {
    "capabilities": {
        "textDocumentSync": 2,
        "definitionProvider": {
            "workDoneProgress": true
        },
        "declarationProvider": {
            "workDoneProgress": true
        },
        "referencesProvider": {
            "workDoneProgress": true
        },
        "documentSymbolProvider": {
            "workDoneProgress": true
        },
        "workspaceSymbolProvider": {
            "workDoneProgress": true
        },
        "hoverProvider": {
            "workDoneProgress": true
        },
        "documentHighlightProvider": {
            "workDoneProgress": true
        },
        "renameProvider": {
            "workDoneProgress": true
        },
        "completionProvider": {
            "triggerCharacters": [
                ".",
                "["
            ],
            "resolveProvider": true,
            "workDoneProgress": true
        },
        "signatureHelpProvider": {
            "triggerCharacters": [
                "(",
                ",",
                ")"
            ],
            "workDoneProgress": true
        },
        "codeActionProvider": {
            "codeActionKinds": [
                "quickfix",
                "source.organizeImports"
            ],
            "workDoneProgress": true
        },
        "executeCommandProvider": {
            "commands": [],
            "workDoneProgress": true
        },
        "callHierarchyProvider": true
    }
}

[Trace - 2:54:04 PM] Sending notification 'initialized'.
Params: {}

[Trace - 2:54:04 PM] Sending notification 'workspace/didChangeConfiguration'.
Params: {
    "settings": {
        "python": {
            "analysis": {
                "extraPaths": [],
                "typeshedPaths": [],
                "autoImportCompletions": true,
                "autoSearchPaths": true,
                "stubPath": "typings",
                "diagnosticMode": "openFilesOnly",
                "diagnosticSeverityOverrides": {},
                "logLevel": "Information",
                "typeCheckingMode": "basic",
                "useLibraryCodeForTypes": true
            },
            "linting": {
                "enabled": true,
                "flake8Args": [],
                "flake8CategorySeverity": {
                    "E": "Error",
                    "F": "Error",
                    "W": "Warning"
                },
                "flake8Enabled": false,
                "flake8Path": "flake8",
                "ignorePatterns": [
                    ".vscode/*.py",
                    "**/site-packages/**/*.py"
                ],
                "lintOnSave": true,
                "maxNumberOfProblems": 100,
                "banditArgs": [],
                "banditEnabled": false,
                "banditPath": "bandit",
                "mypyArgs": [
                    "--ignore-missing-imports",
                    "--follow-imports=silent",
                    "--show-column-numbers"
                ],
                "mypyCategorySeverity": {
                    "error": "Error",
                    "note": "Information"
                },
                "mypyEnabled": false,
                "mypyPath": "mypy",
                "pytypeEnabled": false,
                "pytypePath": "pytype",
                "pytypeArgs": [],
                "pycodestyleArgs": [],
                "pycodestyleCategorySeverity": {
                    "E": "Error",
                    "W": "Warning"
                },
                "pycodestyleEnabled": false,
                "pycodestylePath": "pycodestyle",
                "prospectorArgs": [],
                "prospectorEnabled": false,
                "prospectorPath": "prospector",
                "pydocstyleArgs": [],
                "pydocstyleEnabled": false,
                "pydocstylePath": "pydocstyle",
                "pylamaArgs": [],
                "pylamaEnabled": false,
                "pylamaPath": "pylama",
                "pylintArgs": [],
                "pylintCategorySeverity": {
                    "convention": "Information",
                    "error": "Error",
                    "fatal": "Error",
                    "refactor": "Hint",
                    "warning": "Warning"
                },
                "pylintEnabled": false,
                "pylintPath": "pylint",
                "pylintUseMinimalCheckers": true
            },
            "pythonPath": "python",
            "venvPath": "",
            "formatting": {
                "blackArgs": [],
                "blackPath": "black",
                "darkerArgs": [],
                "darkerPath": "darker",
                "yapfArgs": [],
                "yapfPath": "yapf",
                "autopep8Args": [],
                "autopep8Path": "autopep8",
                "blackdPath": "blackd",
                "blackdHTTPURL": "",
                "blackdHTTPHeaders": {},
                "provider": "autopep8"
            },
            "sortImports": {
                "path": "",
                "args": []
            }
        },
        "pyright": {
            "enable": true,
            "disableDiagnostics": false,
            "completion": {
                "snippetSupport": true
            },
            "organizeimports": {
                "provider": "pyright"
            },
            "trace": {
                "server": "verbose"
            }
        }
    }
}

[Trace - 2:54:04 PM] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "file:///home/alice/Documents/XJTLU/Python/Python/hellopython.py",
        "languageId": "python",
        "version": 1,
        "text": "print(\"--\" * 20)    #output \"--\" for 20 times\nname = \"jack\"\ncountry = \"USA\"\nprint(\"I am %s, from %s\" % (name, country)) #I am jack, from USA\n\nnum1 = 800\nprint(\"%06d\" % num1) # 前置0的个数\n\nnum2 = 0.25\nprint(\"%0.3f\" % num2)\n\nprint(\"%d %f\" % (num1, num2))\n\n# 2021/7/31\nimport random\nplayer = int(input(\"please enter a number\"))\ncomputer = random.randint(1,3)\nif ((player == 1 and computer == 2)\n        or(player == 2 and computer == 3)\n        or(player == 3 and computer ==1)):\n    print(\"you win !\")\nelse:\n    print(\"you lose!\")\n\n# while loop\n# 1. 定义重复次数计数器\ni = 1\n# 2. 使用 while 判断条件\nwhile i <= 5:\n    # 要重复执行的代码\n    print(\"Hello Python\")\n    # 处理计数器 i\n    i = i + 1\n\nprint(\"循环结束后的 i = %d\" % i)\n\n# c //= a equals to c = c // a 取整运算\n# c %= a equals to c = c % a 取模运算\n# **= 幂赋值运算\n\nc = 2\na = 3\nc **= a\nc1 = 2**3\nprint(\"c = %d\" % c)\nprint(\"c1 = %d\" % c1)\n\n\ndef print_line(char, times):\n    \"\"\"\n\n    :param char: the output char\n    :param times: repeat times of the char\n    \"\"\"\n    print(char * times)\n\n\ndef print_lines(char, times):\n    row = 0\n\n    while row < 5:\n        print_line(char, times) # ctrl + q to show the notation\n\n        row += 1\n\nprint_lines(1,3)\n\n\n\n\n"
    }
}

[Trace - 2:54:04 PM] Received request 'client/registerCapability - (0)'.
Params: {
    "registrations": [
        {
            "id": "7365f304-3e80-4622-9236-2b4eb3e7d1b1",
            "method": "workspace/didChangeWorkspaceFolders",
            "registerOptions": {}
        }
    ]
}

[Trace - 2:54:04 PM] Sending response 'client/registerCapability - (0)'. Processing request took 0ms
No result returned.

[Trace - 2:54:04 PM] Received request 'client/registerCapability - (1)'.
Params: {
    "registrations": [
        {
            "id": "0c6a4cde-2499-4908-aed3-dcafa575f1f6",
            "method": "workspace/didChangeWatchedFiles",
            "registerOptions": {
                "watchers": [
                    {
                        "globPattern": "**/pyrightconfig.json",
                        "kind": 7
                    },
                    {
                        "globPattern": "**",
                        "kind": 7
                    }
                ]
            }
        }
    ]
}

[Trace - 2:54:04 PM] Sending response 'client/registerCapability - (1)'. Processing request took 1ms
No result returned.

[Trace - 2:54:04 PM] Received request 'workspace/configuration - (2)'.
Params: {
    "items": [
        {
            "scopeUri": "file:///home/alice/Documents/XJTLU/Python/Python",
            "section": "python"
        }
    ]
}

[Trace - 2:54:04 PM] Sending response 'workspace/configuration - (2)'. Processing request took 1ms
Result: [
    {
        "analysis": {
            "extraPaths": [],
            "typeshedPaths": [],
            "autoImportCompletions": true,
            "autoSearchPaths": true,
            "stubPath": "typings",
            "diagnosticMode": "openFilesOnly",
            "diagnosticSeverityOverrides": {},
            "logLevel": "Information",
            "typeCheckingMode": "basic",
            "useLibraryCodeForTypes": true
        },
        "linting": {
            "enabled": true,
            "flake8Args": [],
            "flake8CategorySeverity": {
                "E": "Error",
                "F": "Error",
                "W": "Warning"
            },
            "flake8Enabled": false,
            "flake8Path": "flake8",
            "ignorePatterns": [
                ".vscode/*.py",
                "**/site-packages/**/*.py"
            ],
            "lintOnSave": true,
            "maxNumberOfProblems": 100,
            "banditArgs": [],
            "banditEnabled": false,
            "banditPath": "bandit",
            "mypyArgs": [
                "--ignore-missing-imports",
                "--follow-imports=silent",
                "--show-column-numbers"
            ],
            "mypyCategorySeverity": {
                "error": "Error",
                "note": "Information"
            },
            "mypyEnabled": false,
            "mypyPath": "mypy",
            "pytypeEnabled": false,
            "pytypePath": "pytype",
            "pytypeArgs": [],
            "pycodestyleArgs": [],
            "pycodestyleCategorySeverity": {
                "E": "Error",
                "W": "Warning"
            },
            "pycodestyleEnabled": false,
            "pycodestylePath": "pycodestyle",
            "prospectorArgs": [],
            "prospectorEnabled": false,
            "prospectorPath": "prospector",
            "pydocstyleArgs": [],
            "pydocstyleEnabled": false,
            "pydocstylePath": "pydocstyle",
            "pylamaArgs": [],
            "pylamaEnabled": false,
            "pylamaPath": "pylama",
            "pylintArgs": [],
            "pylintCategorySeverity": {
                "convention": "Information",
                "error": "Error",
                "fatal": "Error",
                "refactor": "Hint",
                "warning": "Warning"
            },
            "pylintEnabled": false,
            "pylintPath": "pylint",
            "pylintUseMinimalCheckers": true
        },
        "pythonPath": "/home/alice/Documents/XJTLU/Python/Python/venv/bin/python",
        "venvPath": "",
        "formatting": {
            "blackArgs": [],
            "blackPath": "black",
            "darkerArgs": [],
            "darkerPath": "darker",
            "yapfArgs": [],
            "yapfPath": "yapf",
            "autopep8Args": [],
            "autopep8Path": "autopep8",
            "blackdPath": "blackd",
            "blackdHTTPURL": "",
            "blackdHTTPHeaders": {},
            "provider": "autopep8"
        },
        "sortImports": {
            "path": "",
            "args": []
        }
    }
]

[Trace - 2:54:04 PM] Received request 'workspace/configuration - (3)'.
Params: {
    "items": [
        {
            "scopeUri": "file:///home/alice/Documents/XJTLU/Python/Python",
            "section": "python.analysis"
        }
    ]
}

[Trace - 2:54:04 PM] Sending response 'workspace/configuration - (3)'. Processing request took 0ms
Result: [
    {
        "extraPaths": [],
        "typeshedPaths": [],
        "autoImportCompletions": true,
        "autoSearchPaths": true,
        "stubPath": "typings",
        "diagnosticMode": "openFilesOnly",
        "diagnosticSeverityOverrides": {},
        "logLevel": "Information",
        "typeCheckingMode": "basic",
        "useLibraryCodeForTypes": true
    }
]

[Trace - 2:54:04 PM] Received request 'workspace/configuration - (4)'.
Params: {
    "items": [
        {
            "scopeUri": "file:///home/alice/Documents/XJTLU/Python/Python",
            "section": "pyright"
        }
    ]
}

[Trace - 2:54:04 PM] Sending response 'workspace/configuration - (4)'. Processing request took 0ms
Result: [
    {
        "enable": true,
        "disableDiagnostics": false,
        "completion": {
            "snippetSupport": true
        },
        "organizeimports": {
            "provider": "pyright"
        },
        "trace": {
            "server": "verbose"
        }
    }
]

[Trace - 2:54:04 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "No configuration file found."
}

[Info  - 2:54:04 PM] No configuration file found.
[Trace - 2:54:04 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "No pyproject.toml file found."
}

[Info  - 2:54:04 PM] No pyproject.toml file found.
[Trace - 2:54:04 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Setting pythonPath for service \"Python\": \"/home/alice/Documents/XJTLU/Python/Python/venv/bin/python\""
}

[Info  - 2:54:04 PM] Setting pythonPath for service "Python": "/home/alice/Documents/XJTLU/Python/Python/venv/bin/python"
[Trace - 2:54:04 PM] Received notification 'window/logMessage'.
Params: {
    "type": 2,
    "message": "stubPath /home/alice/Documents/XJTLU/Python/Python/typings is not a valid directory."
}

[Warn  - 2:54:04 PM] stubPath /home/alice/Documents/XJTLU/Python/Python/typings is not a valid directory.
[Trace - 2:54:04 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Assuming Python version 3.8"
}

[Info  - 2:54:04 PM] Assuming Python version 3.8
[Trace - 2:54:04 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Assuming Python platform Linux"
}

[Info  - 2:54:04 PM] Assuming Python platform Linux
Exception received when installing recursive file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
Exception received when installing recursive file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
[Trace - 2:54:04 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Searching for source files"
}

[Info  - 2:54:04 PM] Searching for source files
[Trace - 2:54:04 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Auto-excluding /home/alice/Documents/XJTLU/Python/Python/venv"
}

[Info  - 2:54:04 PM] Auto-excluding /home/alice/Documents/XJTLU/Python/Python/venv
[Trace - 2:54:04 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Found 1 source file"
}

[Info  - 2:54:04 PM] Found 1 source file
[Trace - 2:54:05 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///home/alice/Documents/XJTLU/Python/Python/hellopython.py",
    "diagnostics": []
}

[Trace - 2:54:08 PM] Sending notification 'textDocument/didChange'.
Params: {
    "textDocument": {
        "version": 2,
        "uri": "file:///home/alice/Documents/XJTLU/Python/Python/hellopython.py"
    },
    "contentChanges": [
        {
            "range": {
                "start": {
                    "line": 66,
                    "character": 0
                },
                "end": {
                    "line": 66,
                    "character": 0
                }
            },
            "rangeLength": 0,
            "text": "p"
        }
    ]
}

[Trace - 2:54:09 PM] Sending notification 'textDocument/didChange'.
Params: {
    "textDocument": {
        "version": 3,
        "uri": "file:///home/alice/Documents/XJTLU/Python/Python/hellopython.py"
    },
    "contentChanges": [
        {
            "range": {
                "start": {
                    "line": 66,
                    "character": 1
                },
                "end": {
                    "line": 66,
                    "character": 1
                }
            },
            "rangeLength": 0,
            "text": "r"
        }
    ]
}

[Trace - 2:54:09 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///home/alice/Documents/XJTLU/Python/Python/hellopython.py",
    "diagnostics": [
        {
            "range": {
                "start": {
                    "line": 66,
                    "character": 0
                },
                "end": {
                    "line": 66,
                    "character": 2
                }
            },
            "message": "\"pr\" is not defined",
            "severity": 1,
            "code": "reportUndefinedVariable",
            "source": "Pyright",
            "codeDescription": {
                "href": "https://github.com/microsoft/pyright/blob/main/docs/configuration.md"
            }
        }
    ]
}

[Trace - 2:54:09 PM] Sending notification 'textDocument/didChange'.
Params: {
    "textDocument": {
        "version": 4,
        "uri": "file:///home/alice/Documents/XJTLU/Python/Python/hellopython.py"
    },
    "contentChanges": [
        {
            "range": {
                "start": {
                    "line": 66,
                    "character": 1
                },
                "end": {
                    "line": 66,
                    "character": 2
                }
            },
            "rangeLength": 1,
            "text": ""
        }
    ]
}

[Trace - 2:54:09 PM] Sending notification 'textDocument/didChange'.
Params: {
    "textDocument": {
        "version": 5,
        "uri": "file:///home/alice/Documents/XJTLU/Python/Python/hellopython.py"
    },
    "contentChanges": [
        {
            "range": {
                "start": {
                    "line": 66,
                    "character": 0
                },
                "end": {
                    "line": 66,
                    "character": 1
                }
            },
            "rangeLength": 1,
            "text": ""
        }
    ]
}

[Trace - 2:54:09 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///home/alice/Documents/XJTLU/Python/Python/hellopython.py",
    "diagnostics": []
}
yaegassy commented 3 years ago

@yukinoyoyi pyright appears to be working. What is the problem?

By the way, do you have a minimal .vimrc?

e.g. minimal.vim (use vim-plug):

syntax on
filetype plugin indent on
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()

let g:coc_global_extensions = ["coc-pyright"]

I checked with docker in a configuration similar to your environment and it worked fine.

coc-pyright-issue-587
fannheyward commented 3 years ago

@yukinoyoyi the logs confirm that diagnostics are working, but missing completion requests, please input something like im and post the logs again.