[BUG] LSP hover and documentSymbol operations return empty results while diagnostics work correctly (Python/Pyright)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
LSP operations hover and documentSymbol return empty results, while diagnostics work correctly. This suggests the LSP server (Pyright) is running and analyzing files, but interactive operations are not functioning.
Tested in multiple terminals with the same result:
- PowerShell
- PyCharm Extension (PowerShell)
- Windows Terminal
Observed behavior:
- Diagnostics - Working correctly. Pyright reports errors like
reportMissingImportsin the LSP output.
- Hover - Returns:
"No hover information available. This may occur if the cursor is not on a symbol, or if the LSP server has not fully indexed the file."
- documentSymbol - Returns:
"No symbols found in document. This may occur if the file is empty, not supported by the LSP server, or if the server has not fully indexed the file."
Example LSP hover call:
LSP operation: hover
File: src/my_module.py
Line: 25
Character: 10
Result:
No hover information available. This may occur if the cursor is not on a symbol, or if the LSP server has not fully indexed the file.
But diagnostics show (proving Pyright is running):
✘ [Line 1:6] Import "my_package.some_module" could not be resolved [reportMissingImports] (Pyright)
✘ [Line 2:6] Import "config.settings" could not be resolved [reportMissingImports] (Pyright)
What Should Happen?
When running LSP hover on a valid symbol (function definition, variable, etc.), it should return:
- Type information
- Documentation/docstring
- Function signature
When running documentSymbol, it should return a list of all symbols (classes, functions, variables) in the file.
Error Messages/Logs
No hover information available. This may occur if the cursor is not on a symbol, or if the LSP server has not fully indexed the file.
Steps to Reproduce
- Install the official
pyright-lspplugin from Claude Code marketplace - Install Pyright both ways:
npm install -g pyrightpip install pyright
- Create
pyrightconfig.jsonin the project root with basic configuration - Restart Claude Code
- Try various LSP operations on Python files:
hover- returns "No hover information available"documentSymbol- returns "No symbols found in document"goToDefinition- returns empty result
- Note: Pyright diagnostics DO appear in the output (e.g.,
reportMissingImportserrors), proving the LSP server is running and analyzing files - Tested on multiple Python files including standard library imports like
asyncio- same result
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
-
Claude Code Version
2.1.6
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
pyrightconfig.json:
```json
{
"include": ["src", "tests"],
"exclude": ["**/__pycache__", ".venv"],
"extraPaths": ["."],
"venvPath": ".",
"venv": ".venv",
"pythonVersion": "3.13",
"typeCheckingMode": "basic"
}
Environment:
- Node.js installed
- Pyright installed via both npm install -g pyright and pip install pyright
- Python 3.13
Related Issues:
- #16360 - C# LSP not working, all operations return empty
The partial functionality (diagnostics work, interactive operations don't) suggests LSP may be running in a "diagnostics-only" mode.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗