Skip to content

Commit d041dfb

Browse files
fix: quite console in lsp mode
1 parent 203002d commit d041dfb

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

codeflash/cli_cmds/console.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import logging
4+
import os
45
from contextlib import contextmanager
56
from itertools import cycle
67
from typing import TYPE_CHECKING
@@ -28,6 +29,10 @@
2829
DEBUG_MODE = logging.getLogger().getEffectiveLevel() == logging.DEBUG
2930

3031
console = Console()
32+
33+
if os.getenv("CODEFLASH_LSP"):
34+
console.quiet = True
35+
3136
logging.basicConfig(
3237
level=logging.INFO,
3338
handlers=[RichHandler(rich_tracebacks=True, markup=False, console=console, show_path=False, show_time=False)],

codeflash/lsp/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
# Silence the console module to prevent stdout pollution
2-
from codeflash.cli_cmds.console import console
3-
4-
console.quiet = True

codeflash/lsp/helpers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
import os
12
from functools import lru_cache
23

3-
from codeflash.cli_cmds.console import console
4-
54

65
@lru_cache(maxsize=1)
76
def is_LSP_enabled() -> bool:
8-
return console.quiet
7+
return os.getenv("CODEFLASH_LSP", default="false").lower() == "true"

0 commit comments

Comments
 (0)