Skip to content

Commit

Permalink
🏗️ Always use Anvil with default args in Sake
Browse files Browse the repository at this point in the history
  • Loading branch information
michprev committed Aug 3, 2024
1 parent 05ca330 commit 6c57b08
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions wake/lsp/sake.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
from typing_extensions import Literal

import wake.development.core
from wake.config import WakeConfig
from wake.development.call_trace import CallTrace
from wake.development.core import RequestType
from wake.development.globals import set_config
from wake.development.json_rpc import JsonRpcError
from wake.development.transactions import TransactionStatusEnum
from wake.lsp.context import LspContext
Expand Down Expand Up @@ -118,6 +120,16 @@ def launch_chain(f):
async def wrapper(context: SakeContext, *args, **kwargs):
if context.chain is None:
try:
config_clone = WakeConfig.fromdict(
context.lsp_context.config.todict(),
project_root_path=context.lsp_context.config.project_root_path,
)
# reset Anvil args & always use Anvil
config_clone.update(
{},
deleted_options=[("testing", "cmd"), ("testing", "anvil", "cmd_args")],
)
set_config(config_clone)
context.chain = Chain()
context.chain_handle = context.chain.connect()
context.chain_handle.__enter__()
Expand Down

0 comments on commit 6c57b08

Please sign in to comment.