[FIX][LSP] Set the console to quiet in the package init #500
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
importing a module like
codeflash.cli_cmds.consoleor any module that imports it, sets the logging level toINFObefore the LSP server starts.As a result,
pyglslogs messages tostdoutat theINFOlevel, so the vscode lsp client try to treat those as RPC messages and fails.This was resolved by setting
console.quietin__init__.py.PR Type
Bug fix, Enhancement
Description
Silence console globally to prevent stdout pollution
Remove redundant console silencing in entrypoint
Add return type annotation to setup_logging()
Tidy imports, mappings, and formatting
Changes walkthrough 📝
__init__.py
Silence console module on importcodeflash/lsp/init.py
consolefromcodeflash.cli_cmds.consoleconsole.quiet = Trueon package importserver.py
Format imports and log mappingcodeflash/lsp/server.py
lsprotocol.typesimportsshow_message_logserver_entry.py
Refactor entrypoint comments and typingcodeflash/lsp/server_entry.py
setup_logging()return type