Skip to content

Commit a92794e

Browse files
Merge branch 'main' into lsp/message-id-tag
2 parents 5aaf5ab + b804aca commit a92794e

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
@@ -116,6 +116,10 @@ def enhanced_log(
116116
actual_log_fn(clean_msg, *args, **kwargs)
117117
return
118118

119+
if not lsp_enabled:
120+
# it's for LSP and LSP is disabled
121+
return
122+
119123
# ---- LSP logging path ----
120124
if is_normal_text_message:
121125
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
@@ -6,7 +6,7 @@
66
from pathlib import Path
77
from typing import Any, Optional
88

9-
from codeflash.lsp.helpers import replace_quotes_with_backticks, simplify_worktree_paths
9+
from codeflash.lsp.helpers import is_LSP_enabled, replace_quotes_with_backticks, simplify_worktree_paths
1010

1111
json_primitive_types = (str, float, int, bool)
1212
max_code_lines_before_collapse = 45
@@ -42,6 +42,8 @@ def type(self) -> str:
4242
raise NotImplementedError
4343

4444
def serialize(self) -> str:
45+
if not is_LSP_enabled():
46+
return ""
4547
from codeflash.lsp.beta import server
4648

4749
execution_ctx = server.execution_context_vars.get()

0 commit comments

Comments
 (0)