fannheyward / coc-pyright

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

Completions stop appearing deep into use: No error, how to create a good debug report? #837

Closed tony closed 2 years ago

tony commented 2 years ago

Hi! Thank you for the project!

I would like to provide a solid minimal recreation of a longstanding pyright issue where completions stop.

Questions

  1. Debug commands / procedure for coc-pyright

    Is there a way I can have the logs related to vim / coc.nvim / coc-pyright / pyright / completions sent to file(s) so a debug report can be created?

  2. Minimum VIM Config

    Is their a minimum vim configuration with coc + coc plugins (like coc-pyright) that can be used for debugging / reports?

As of now

When using coc-pyright, completions stop appearing 10-15 minutes into normal use.

:CocCommand workspace.showOutput Pyright doesn't show anything interesting. Completions just stop.

What's the output of :CocCommand pyright.version

coc-pyright 1.1.275 with Pyright 1.1.277

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

Workspace: /home/tony/projects/python/project
Using python from /home/tony/projects/python/project/.venv/bin/python

[Info  - 12:06:56 PM] Pyright language server 1.1.277 starting
[Info  - 12:06:56 PM] Server root directory: /home/tony/.config/coc/extensions/node_modules/coc-pyright/node_modules/pyright/dist/
[Info  - 12:06:56 PM] Starting service instance "project"
[Info  - 12:06:56 PM] No configuration file found.
[Info  - 12:06:56 PM] pyproject.toml file found at /home/tony/projects/python/project.
[Info  - 12:06:56 PM] Setting pythonPath for service "project": "/home/tony/projects/python/project/.venv/bin/python"
[Info  - 12:06:56 PM] Loading pyproject.toml file at /home/tony/projects/python/project/pyproject.toml
[Error - 12:06:56 PM] Pyproject file "/home/tony/projects/python/project/pyproject.toml" is missing "[tool.pyright]" section.
[Warn  - 12:06:56 PM] stubPath /home/tony/projects/python/project/typings is not a valid directory.
[Info  - 12:06:56 PM] Assuming Python version 3.11
[Info  - 12:06:56 PM] Assuming Python platform Linux
[Info  - 12:06:56 PM] Searching for source files
[Info  - 12:06:56 PM] Found 22 source files
fannheyward commented 2 years ago

Thanks for your report.

I use this minimal vimrc to debug.

set nocompatible
set runtimepath^=/path/to/coc.nvim
filetype plugin indent on
syntax on
set hidden

set runtimepath^=~/src/coc-pyright

You can set "pyright.trace.server": "verbose" in your coc-settings.json, then :CocCommand workspace.showOutput Pyright will output verbose logs to Pyright.

tony commented 2 years ago

Thank you!

I will monitor this over the weekend and report back if completions stop (or not)

Since I wrote that last message, I haven't had any issues

activaigor commented 2 years ago

happens to me all the time as well. pyright server process goes into 100% CPU and does not respond to vim client. only CocRestart helps. just changed to the verbose mode, will monitor as well.

@fannheyward one quick question though. this verbose mode does produce tonns of messages. just after ~10mins of using i'm already getting more then 500k lines of verbose json events. looks like it might be difficult to find out what exactly causing this freezes. or do you think just a couple of last messages will bring a light into the issue?

also curious of whether these logs will be deleted after the session is over. they might be heavy for storing

tony commented 2 years ago

I am going to close my issue now - I've not recreated it.

@activaigor I am going to guess you - and future people who come along, may run into pyright issues that are hard to write reports on

@fannheyward Would it be providing instructions to https://github.com/fannheyward/coc-pyright/issues/837#issuecomment-1297890340 in the issue template?

@activaigor I am not sure if you have the same issue as me, or a different one, but to be sure you get yours heard, are you fine if I close this and you make a new issue?

tony commented 2 years ago

For now - I will close this

@activaigor and anyone else that runs into a issue where pyright stops in the future:

I invite you to still create a new issue and a see if you can can create a minimal recreation example (In my experience though - I've found this very hard to do. I am truly mystified by vim plugins and coc.nvim)

Instructions: for now this is what I've seen but better may come in the future