Skip to content

Commit efe373a

Browse files
handle lsp only tag
1 parent a41d7cf commit efe373a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

codeflash/lsp/lsp_logger.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ def enhanced_log(
110110
actual_log_fn(clean_msg, *args, **kwargs)
111111
return
112112

113+
if not lsp_enabled:
114+
# it's for LSP and LSP is disabled
115+
return
116+
113117
# ---- LSP logging path ----
114118
if is_normal_text_message:
115119
clean_msg = add_heading_tags(clean_msg, tags)

codeflash/lsp/lsp_message.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pathlib import Path
66
from typing import Any, Optional
77

8-
from codeflash.lsp.helpers import replace_quotes_with_backticks, simplify_worktree_paths
8+
from codeflash.lsp.helpers import is_LSP_enabled, replace_quotes_with_backticks, simplify_worktree_paths
99

1010
json_primitive_types = (str, float, int, bool)
1111
max_code_lines_before_collapse = 45
@@ -34,6 +34,8 @@ def type(self) -> str:
3434
raise NotImplementedError
3535

3636
def serialize(self) -> str:
37+
if not is_LSP_enabled():
38+
return ""
3739
from codeflash.lsp.beta import server
3840

3941
execution_ctx = server.execution_context_vars.get()

0 commit comments

Comments
 (0)