From 6c57b08d1745bfa08c13f9ffd7016b04af2086e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20P=C5=99evr=C3=A1til?= Date: Sat, 3 Aug 2024 20:39:25 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=EF=B8=8F=20Always=20use=20Anvil=20?= =?UTF-8?q?with=20default=20args=20in=20Sake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wake/lsp/sake.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wake/lsp/sake.py b/wake/lsp/sake.py index fcc9cf84d..4cba7f4a5 100644 --- a/wake/lsp/sake.py +++ b/wake/lsp/sake.py @@ -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 @@ -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__()