VSCode Extension: SQLMesh LSP crashes on startup: ImportError: cannot import name 'WorkspaceDiagnosticRefreshRequest' with lsprotocol 2025.x

未關閉 適合新手
#5,768 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 4 天內回覆

@boomesh11 已經在處理了。

開始於 2026年11月16日。

  • #6220 來自 @boomesh11 —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
66/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
冷清
技術堆疊
python
領域
devtools

研究方向

首先,在乾淨的環境中使用回報的套件版本重現故障,接著檢查 sqlmesh.lsp.main 以及專案中關於 lsprotocol 和 pygls 的相依性宣告。使用支援的相依性版本時,SQLMesh 語言伺服器能夠啟動且不出現回報的匯入錯誤,即表示完成。

由索引模型根據 Issue 內容生成。

描述

Bug

Description

Starting the SQLMesh Language Server (via tcloud / enterprise LSP) fails during import: sqlmesh.lsp.main imports WorkspaceDiagnosticRefreshRequest from lsprotocol.types, but that symbol is not available in lsprotocol 2025.x, so the process exits and the VS Code extension reports a failed LSP connection.

Environment

  • OS: Windows
  • Editor: VS Code / Cursor + SQLMesh extension
  • Python: 3.11 (project .venv as workspace interpreter)

Steps to reproduce

  1. Install current tcloud in a clean venv (e.g. pip install tcloud).
  2. Open a SQLMesh project and use that venv as the Python interpreter.
  3. Trigger the SQLMesh extension / LSP (e.g. reload window).

Expected

Language server starts without import errors.

Actual

Server process exits with:
ImportError: cannot import name 'WorkspaceDiagnosticRefreshRequest' from 'lsprotocol.types'

(Extension may also show generic LSP errors such as “couldn’t create connection to server” or exit code 1.)

Versions

Package Version
tcloud 2.11.0
sqlmesh 0.232.0
lsprotocol 2025.0.0
pygls 2.1.1

Workaround

pip uninstall -y lsprotocol pygls
pip install "lsprotocol<2025" "pygls<2.0"
python -c "from lsprotocol.types import WorkspaceDiagnosticRefreshRequest; print('ok')"
主要語言
Python
星號
3.3k
分支
471
平均合併
6 天 7 小時
30 天內合併 PR
35

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

SQLMesh/sqlmesh 的其他 Issue

查看 SQLMesh/sqlmesh 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。