Skip to content

inspector - "Client has stopped" error #208

@DetachHead

Description

@DetachHead

i'm not sure what the issue is here. if it's the server crashing ideally it would output the error from the server. instead it just says "Client has stopped" with no indication as to what caused it

to reproduce:

  1. install ruff
  2. run lsp-devtools client -- ruff server
  3. open a python file
  4. make a change in the file
$ lsp-devtools client -- ruff server
╭────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────╮
│ /home/me/basedpyright/.venv/lib/python3.13/site-packages/textual/widgets/_text_area.py:1630 in _on_key                                                                        │
│                                                                                                                                                                               │
│   1627 │   │   │   # None because we've checked that it's printable.                                                                                                          │
│   1628 │   │   │   assert insert is not None                                                                                                                                  │
│   1629 │   │   │   start, end = self.selection                                                                                                                                │
│ ❱ 1630 │   │   │   self._replace_via_keyboard(insert, start, end)                                                                                                             │
│   1631 │                                                                                                                                                                      │
│   1632 │   def _find_columns_to_next_tab_stop(self) -> int:                                                                                                                   │
│   1633 │   │   """Get the location of the next tab stop after the cursors position on the curre                                                                               │
│                                                                                                                                                                               │
│ ╭──────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────╮                                                           │
│ │           end = (19, 0)                                                                                         │                                                           │
│ │         event = Key(key='enter', character='\r', name='enter', is_printable=False, aliases=['enter', 'ctrl+m']) │                                                           │
│ │        insert = '\n'                                                                                            │                                                           │
│ │ insert_values = {'enter': '\n'}                                                                                 │                                                           │
│ │           key = 'enter'                                                                                         │                                                           │
│ │          self = TextEditor()                                                                                    │                                                           │
│ │         start = (19, 0)                                                                                         │                                                           │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                           │
│                                                                                                                                                                               │
│ /home/me/basedpyright/.venv/lib/python3.13/site-packages/textual/widgets/_text_area.py:2352 in _replace_via_keyboard                                                          │
│                                                                                                                                                                               │
│   2349 │   │   """                                                                              ╭─────── locals ────────╮                                                     │
│   2350 │   │   if self.read_only:                                                               │    end = (19, 0)      │                                                     │
│   2351 │   │   │   return None                                                                  │ insert = '\n'         │                                                     │
│ ❱ 2352 │   │   return self.replace(insert, start, end, maintain_selection_offset=False)         │   self = TextEditor() │                                                     │
│   2353 │                                                                                        │  start = (19, 0)      │                                                     │
│   2354 │   def action_delete_left(self) -> None:                                                ╰───────────────────────╯                                                     │
│   2355 │   │   """Deletes the character to the left of the cursor and updates the cursor locati                                                                               │
│                                                                                                                                                                               │
│ /home/me/basedpyright/.venv/lib/python3.13/site-packages/textual/widgets/_text_area.py:2306 in replace                                                                        │
│                                                                                                                                                                               │
│   2303 │   │   Returns:                                                                         ╭───────────────── locals ─────────────────╮                                  │
│   2304 │   │   │   An `EditResult` containing information about the edit.                       │                       end = (19, 0)      │                                  │
│   2305 │   │   """                                                                              │                    insert = '\n'         │                                  │
│ ❱ 2306 │   │   return self.edit(Edit(insert, start, end, maintain_selection_offset))            │ maintain_selection_offset = False        │                                  │
│   2307 │                                                                                        │                      self = TextEditor() │                                  │
│   2308 │   def clear(self) -> EditResult:                                                       │                     start = (19, 0)      │                                  │
│   2309 │   │   """Delete all text from the document.                                            ╰──────────────────────────────────────────╯                                  │
│                                                                                                                                                                               │
│ /home/me/basedpyright/.venv/lib/python3.13/site-packages/lsp_devtools/client/editor/text_editor.py:101 in edit                                                                │
│                                                                                                                                                                               │
│    98 │   │   start_line, start_col = edit.from_location                                                                                                                      │
│    99 │   │   end_line, end_col = edit.to_location                                                                                                                            │
│   100 │   │                                                                                                                                                                   │
│ ❱ 101 │   │   self.lsp_client.text_document_did_change(                                                                                                                       │
│   102 │   │   │   types.DidChangeTextDocumentParams(                                                                                                                          │
│   103 │   │   │   │   text_document=types.VersionedTextDocumentIdentifier(                                                                                                    │
│   104 │   │   │   │   │   version=self.version, uri=self.uri                                                                                                                  │
│                                                                                                                                                                               │
│ ╭───────────────────────────────────── locals ─────────────────────────────────────╮                                                                                          │
│ │       edit = Edit(                                                               │                                                                                          │
│ │              │   text='\n',                                                      │                                                                                          │
│ │              │   from_location=(19, 0),                                          │                                                                                          │
│ │              │   to_location=(19, 0),                                            │                                                                                          │
│ │              │   maintain_selection_offset=False,                                │                                                                                          │
│ │              │   _original_selection=Selection(start=(19, 0), end=(19, 0)),      │                                                                                          │
│ │              │   _updated_selection=Selection(start=(20, 0), end=(20, 0)),       │                                                                                          │
│ │              │   _edit_result=EditResult(                                        │                                                                                          │
│ │              │   │   end_location=(20, 0),                                       │                                                                                          │
│ │              │   │   replaced_text=''                                            │                                                                                          │
│ │              │   )                                                               │                                                                                          │
│ │              )                                                                   │                                                                                          │
│ │    end_col = 0                                                                   │                                                                                          │
│ │   end_line = 19                                                                  │                                                                                          │
│ │       self = TextEditor()                                                        │                                                                                          │
│ │  start_col = 0                                                                   │                                                                                          │
│ │ start_line = 19                                                                  │                                                                                          │
│ ╰──────────────────────────────────────────────────────────────────────────────────╯                                                                                          │
│                                                                                                                                                                               │
│ /home/me/basedpyright/.venv/lib/python3.13/site-packages/pygls/lsp/client.py:1820 in text_document_did_change                                                                 │
│                                                                                                                                                                               │
│   1817 │   │   changes to a text document.                                                                                                                                    │
│   1818 │   │   """                                                                                                                                                            │
│   1819 │   │   if self.stopped:                                                                                                                                               │
│ ❱ 1820 │   │   │   raise RuntimeError("Client has been stopped.")                                                                                                             │
│   1821 │   │                                                                                                                                                                  │
│   1822 │   │   self.protocol.notify("textDocument/didChange", params)                                                                                                         │
│   1823                                                                                                                                                                        │
│                                                                                                                                                                               │
│ ╭──────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────╮                                                   │
│ │ params = DidChangeTextDocumentParams(                                                                                   │                                                   │
│ │          │   text_document=VersionedTextDocumentIdentifier(                                                             │                                                   │
│ │          │   │   version=1,                                                                                             │                                                   │
│ │          │   │   uri='file:///home/me/basedpyright/pdm_build.py'                                                        │                                                   │
│ │          │   ),                                                                                                         │                                                   │
│ │          │   content_changes=[                                                                                          │                                                   │
│ │          │   │   TextDocumentContentChangeEvent_Type1(                                                                  │                                                   │
│ │          │   │   │   range=Range(start=Position(line=19, character=0), end=Position(line=19, character=0)),             │                                                   │
│ │          │   │   │   text='\n',                                                                                         │                                                   │
│ │          │   │   │   range_length=None                                                                                  │                                                   │
│ │          │   │   )                                                                                                      │                                                   │
│ │          │   ]                                                                                                          │                                                   │
│ │          )                                                                                                              │                                                   │
│ │   self = <lsp_devtools.client.lsp.LanguageClient object at 0x779d0bbcecf0>                                              │                                                   │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                   │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
RuntimeError: Client has been stopped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglsp-devtoolsIssues affecting the lsp-devtools package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions