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

no fidget progress for pylsp #817

Open
2 tasks done
fecet opened this issue Jun 23, 2023 · 10 comments
Open
2 tasks done

no fidget progress for pylsp #817

fecet opened this issue Jun 23, 2023 · 10 comments
Labels
bug Something isn't working lsp LSP related issues pylsp Python LSP Server related issues status:blocked-external Needs a third-party / external change or fix upstream Upstream (neovim/plugin) issues

Comments

@fecet
Copy link
Contributor

fecet commented Jun 23, 2023

Version confirmation

  • Confirm

Following prerequisites

  • Confirm

Neovim version

NVIM v0.10.0-dev-546+g3bf887f6e0

Operating system/version

Arch

Terminal name/version

alacritty

$TERM environment variable

No response

Branch info

main (Default/Latest)

Fetch Preferences

HTTPS (use_ssh = false)

Affected language servers

pylsp

How to reproduce the issue

open any python file

Actual behavior

no progress

Expected behavior

No response

Support info

Language client log: /home/rok/.local/state/nvim/lsp.log
Detected filetype: python

1 client(s) attached to this buffer:

Client: pylsp (id: 1, bufnr: [1])
filetypes: python
autostart: true
root directory: /home/rok/Nutstore Files/codes/tlem
cmd: /home/rok/.local/share/nvim/mason/bin/pylsp

Configured servers list: html, jsonls, pylsp, lua_ls, clangd, bashls
Installed
󰄳 bash-language-server bashls
󰄳 clang-format
󰄳 clangd
󰄳 html-lsp html
󰄳 json-lsp jsonls
󰄳 lua-language-server lua_ls
󰄳 prettier
󰄳 python-lsp-server pylsp
󰄳 rustfmt
󰄳 shfmt
󰄳 stylua
󰄳 vint

Logs

No response

Additional information

No response

@fecet fecet added bug Something isn't working lsp LSP related issues labels Jun 23, 2023
@Jint-lzxy
Copy link
Collaborator

We need more information to know what exactly happened:

First clean lsp logs:

truncate -c -s 0 ~/.local/state/nvim/lsp.log

Then add this line to the bottom of lsp.lua

vim.lsp.set_log_level(vim.log.levels.TRACE)

Send context(s) related to workDoneProgress here :)

@Jint-lzxy Jint-lzxy added the question Further information is requested label Jun 23, 2023
@ayamir
Copy link
Owner

ayamir commented Jun 23, 2023

IMO It's not a bug. pylsp loads too fast to show fidget progress because we have disabled lots of time-cost plugins like flake8 and pyflakes etc.

@fecet
Copy link
Contributor Author

fecet commented Jun 23, 2023

Hmm that's right, I can see progress after enable other plugins. But how to distinguish whether it's because black and ruff are too fast or they don't support progress?

@Jint-lzxy
Copy link
Collaborator

Hmm that's right, I can see progress after enable other plugins. But how to distinguish whether it's because black and ruff are too fast or they don't support progress?

@fecet Check lsp.log as I mentioned above. If workDoneProgress sent by neovim receives a response, then this server indeed supports progress.

@fecet
Copy link
Contributor Author

fecet commented Jun 23, 2023

I can see strings like "window/workDoneProgress/create" if enable flake8. Otherwise, workDoneProgress only have two matches and the context are

[TRACE][2023-06-24 01:42:18] .../lua/vim/lsp.lua:1428	"LSP[pylsp]"	"initialize_params"	{  capabilities = {    general = {      positionEncodings = { "utf-16" }    },    textDocument = {      callHierarchy = {        dynamicRegistration = false      },      codeAction = {        codeActionLiteralSupport = {          codeActionKind = {            valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }          }        },        dataSupport = true,        dynamicRegistration = true,        isPreferredSupport = true,        resolveSupport = {          properties = { "edit" }        }      },      completion = {        completionItem = {          commitCharactersSupport = true,          deprecatedSupport = true,          documentationFormat = { "markdown", "plaintext" },          insertReplaceSupport = true,          insertTextModeSupport = {            valueSet = { 1, 2 }          },          labelDetailsSupport = true,          preselectSupport = true,          resolveSupport = {            properties = { "documentation", "detail", "additionalTextEdits" }          },          snippetSupport = true,          tagSupport = {            valueSet = { 1 }          }        },        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 }        },        completionList = {          itemDefaults = { "commitCharacters", "editRange", "insertTextFormat", "insertTextMode", "data" }        },        contextSupport = true,        dynamicRegistration = false,        insertTextMode = 1      },      declaration = {        linkSupport = true      },      definition = {        dynamicRegistration = true,        linkSupport = true      },      documentHighlight = {        dynamicRegistration = false      },      documentSymbol = {        dynamicRegistration = false,        hierarchicalDocumentSymbolSupport = 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 }        }      },      formatting = {        dynamicRegistration = true      },      hover = {        contentFormat = { "markdown", "plaintext" },        dynamicRegistration = true      },      implementation = {        linkSupport = true      },      inlayHint = {        dynamicRegistration = false,        resolveSupport = {          properties = {}        }      },      publishDiagnostics = {        relatedInformation = true,        tagSupport = {          valueSet = { 1, 2 }        }      },      rangeFormatting = {        dynamicRegistration = true      },      references = {        dynamicRegistration = false      },      rename = {        dynamicRegistration = true,        prepareSupport = true      },      semanticTokens = {        augmentsSyntaxTokens = true,        dynamicRegistration = false,        formats = { "relative" },        multilineTokenSupport = false,        overlappingTokenSupport = true,        requests = {          full = {            delta = true          },          range = false        },        serverCancelSupport = false,        tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" },        tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" }      },      signatureHelp = {        dynamicRegistration = false,        signatureInformation = {          activeParameterSupport = true,          documentationFormat = { "markdown", "plaintext" },          parameterInformation = {            labelOffsetSupport = true          }        }      },      synchronization = {        didSave = true,        dynamicRegistration = false,        willSave = true,        willSaveWaitUntil = true      },      typeDefinition = {        linkSupport = true      }    },    window = {      showDocument = {        support = true      },      showMessage = {        messageActionItem = {          additionalPropertiesSupport = false        }      },      workDoneProgress = true    },    workspace = {      applyEdit = true,      configuration = true,      didChangeWatchedFiles = {        dynamicRegistration = true,        relativePatternSupport = true      },      inlayHint = {        refreshSupport = true      },      semanticTokens = {        refreshSupport = true      },      symbol = {        dynamicRegistration = false,        hierarchicalWorkspaceSymbolSupport = 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 }        }      },      workspaceEdit = {        resourceOperations = { "rename", "create", "delete" }      },      workspaceFolders = true    }  },  clientInfo = {    name = "Neovim",    version = "0.10.0"  },  initializationOptions = vim.empty_dict(),  processId = 1672930,  rootPath = "/home/rok/Nutstore Files/codes/tlem",  rootUri = "file:///home/rok/Nutstore%20Files/codes/tlem",  trace = "off",  workspaceFolders = { {      name = "/home/rok/Nutstore Files/codes/tlem",      uri = "file:///home/rok/Nutstore%20Files/codes/tlem"    } }}

so I guss that's indicate that ruff and black doesn't support progress?

@Jint-lzxy
Copy link
Collaborator

To streamline the message:

.../lua/vim/lsp.lua:1428	"LSP[pylsp]"	"initialize_params"	{ ... workDoneProgress = true ... },

So ys pylsp does support progress, but b/c pylsp doesn't need too much time to complete the work, it is not reflected in the information stack owned by fidget.

so I guss that's indicate that ruff and black doesn't support progress?

Not really, this is actually b/c we have blocked messages emitted by null-ls:

sources = {
["null-ls"] = { ignore = true },
},

We made this decision b/c null-ls would continuously (and uncontrollably) generate a large amount of irrelevant messages (e.g., starting document diagnosis, publishing document diagnosis, finished, etc.).

@Jint-lzxy Jint-lzxy added invalid This doesn't seem right wontfix This will not be worked on and removed bug Something isn't working question Further information is requested labels Jun 23, 2023
@fecet
Copy link
Contributor Author

fecet commented Jun 23, 2023

we don't use null-ls in python, ruff and black are integrated in pylsp as plugins

@Jint-lzxy
Copy link
Collaborator

we don't use null-ls in python, ruff and black are integrated in pylsp as plugins

Oh sorry about this - I forgot ruff and black have already been integrated into pylsp..
So how pylsp manages its plugins totally depends on its implementation. Plugins don't have unique client IDs that belong to them.

@Jint-lzxy
Copy link
Collaborator

@fecet is it gd to close this issue now?

@fecet fecet closed this as completed Jun 26, 2023
@Jint-lzxy Jint-lzxy closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2023
@fecet
Copy link
Contributor Author

fecet commented Jun 28, 2023

python-lsp/python-lsp-server#374

@Jint-lzxy Jint-lzxy added upstream Upstream (neovim/plugin) issues pylsp Python LSP Server related issues and removed invalid This doesn't seem right wontfix This will not be worked on labels Jun 28, 2023
@Jint-lzxy Jint-lzxy reopened this Jun 28, 2023
@Jint-lzxy Jint-lzxy added status:blocked-external Needs a third-party / external change or fix bug Something isn't working labels Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lsp LSP related issues pylsp Python LSP Server related issues status:blocked-external Needs a third-party / external change or fix upstream Upstream (neovim/plugin) issues
Projects
None yet
Development

No branches or pull requests

3 participants