From 0049d4e50c9dd945f25f69b08b08fbf492001f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 4 Nov 2019 16:38:52 +0100 Subject: Refactor Worker and ThreadSafeState (#3242) * Split ThreadSafeState into State and GlobalState. State is a "local" state belonging to "Worker" while "GlobalState" is state shared by whole program. * Update "Worker" and ops to use "GlobalState" where applicable * Move and refactor "WorkerChannels" resource --- cli/ops/errors.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/ops/errors.rs') diff --git a/cli/ops/errors.rs b/cli/ops/errors.rs index 2d786b97d..3d94c05c4 100644 --- a/cli/ops/errors.rs +++ b/cli/ops/errors.rs @@ -30,7 +30,7 @@ fn op_format_error( _zero_copy: Option, ) -> Result { let args: FormatErrorArgs = serde_json::from_value(args)?; - let error = JSError::from_json(&args.error, &state.ts_compiler); + let error = JSError::from_json(&args.error, &state.global_state.ts_compiler); Ok(JsonOp::Sync(json!({ "error": error.to_string(), @@ -57,7 +57,7 @@ fn op_apply_source_map( args.line.into(), args.column.into(), &mut mappings_map, - &state.ts_compiler, + &state.global_state.ts_compiler, ); Ok(JsonOp::Sync(json!({ -- cgit v1.2.3