From eb5ffab1cbc010424aa1764005f71dcd67525dc1 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sun, 15 May 2022 14:41:37 -0400 Subject: fix(lsp): correct positions in some scenarios (#14359) --- cli/build.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'cli/build.rs') diff --git a/cli/build.rs b/cli/build.rs index 019f8d02d..e7a2da236 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -197,6 +197,14 @@ fn create_compiler_snapshot( false } + #[op] + fn op_script_version( + _state: &mut OpState, + _args: Value, + ) -> Result, AnyError> { + Ok(Some("1".to_string())) + } + #[op] // using the same op that is used in `tsc.rs` for loading modules and reading // files, but a slightly different implementation at build time. @@ -211,7 +219,7 @@ fn create_compiler_snapshot( if args.specifier == build_specifier { Ok(json!({ "data": r#"console.log("hello deno!");"#, - "hash": "1", + "version": "1", // this corresponds to `ts.ScriptKind.TypeScript` "scriptKind": 3 })) @@ -230,7 +238,7 @@ fn create_compiler_snapshot( let data = std::fs::read_to_string(path)?; Ok(json!({ "data": data, - "hash": "1", + "version": "1", // this corresponds to `ts.ScriptKind.TypeScript` "scriptKind": 3 })) @@ -255,6 +263,7 @@ fn create_compiler_snapshot( op_cwd::decl(), op_exists::decl(), op_load::decl(), + op_script_version::decl(), ]) .state(move |state| { state.put(op_crate_libs.clone()); -- cgit v1.2.3