sublimelsp / LSP

Client implementation of the Language Server Protocol for Sublime Text
https://lsp.sublimetext.io/
MIT License
1.65k stars 182 forks source link

KeyError on file-watcher #2483

Closed yaroslavyaroslav closed 5 months ago

yaroslavyaroslav commented 5 months ago

Describe the bug

Sometimes traceback appears in sublime console.

To Reproduce

Actually I'm not sure what's causing this error. Maybe it's some garbage collection on watcher side. Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

Traceback (most recent call last):
  File "/Users/user/Library/Application Support/Sublime Text/Packages/LSP/plugin/core/transports.py", line 156, in invoke
    callback_object.on_payload(p)
  File "/Users/user/Library/Application Support/Sublime Text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 248, in on_payload
KeyError: '71'
Traceback (most recent call last):
  File "/Users/user/Library/Application Support/Sublime Text/Packages/LSP/plugin/core/transports.py", line 156, in invoke
    callback_object.on_payload(p)
  File "/Users/user/Library/Application Support/Sublime Text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 233, in on_payload
KeyError: '71'
Traceback (most recent call last):
  File "/Users/user/Library/Application Support/Sublime Text/Packages/LSP/plugin/core/transports.py", line 156, in invoke
    callback_object.on_payload(p)
  File "/Users/user/Library/Application Support/Sublime Text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 248, in on_payload
KeyError: '73'
Traceback (most recent call last):
  File "/Users/user/Library/Application Support/Sublime Text/Packages/LSP/plugin/core/transports.py", line 156, in invoke
    callback_object.on_payload(p)
  File "/Users/user/Library/Application Support/Sublime Text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 233, in on_payload
KeyError: '71'
Traceback (most recent call last):
  File "/Users/user/Library/Application Support/Sublime Text/Packages/LSP/plugin/core/transports.py", line 156, in invoke
    callback_object.on_payload(p)
  File "/Users/user/Library/Application Support/Sublime Text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 233, in on_payload
KeyError: '71'

Logs

I believe this is server agnostic issue.

# Troubleshooting: LSP-basedpyright
## Version
 - LSP: 2.1.0
 - Sublime Text: 4175
## Server Test Run
 - exit code: 0
 - output
## Server Configuration
 - command
```json
[
  "${node_bin}",
  "${server_path}",
  "--stdio"
]

Active view

Project / Workspace

LSP configuration

{
  "inhibit_snippet_completions": false,
  "inhibit_word_completions": true,
  "initially_folded": [
    "comment"
  ],
  "popup_max_characters_width": 100
}

System PATH

Environment (please complete the following information):

Additional context

predragnikolic commented 5 months ago

Duplicate of https://github.com/sublimelsp/LSP-file-watcher-chokidar/issues/7

I will close this one, we can continue the discussion in LSP-file-watcher-chokidar.

Does this error happen only when you edit and save files for a Sublime Text package? (Which might cause ST to reload the package and maybe cause this error)

Or does error happen for files in any project?

yaroslavyaroslav commented 5 months ago

Yeah, this might be the case, and thanks for highlighting that one