Skip to content

Commit

Permalink
Merge pull request #462 from flying-sheep/fix-lsp-crash
Browse files Browse the repository at this point in the history
  • Loading branch information
panekj authored Aug 19, 2023
2 parents 5bd9625 + 8f7b693 commit d363946
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 50 deletions.
11 changes: 10 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@
},
"args": [],
"cwd": "${workspaceFolder}"
}
},
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}/editors/vscode",
],
},
]
}
11 changes: 5 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/taplo-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ahash = { version = "0.7.6", features = ["serde"] }
ahash = { version = "0.8.3", features = ["serde"] }
anyhow = { version = "1.0.53", features = ["backtrace"] }
arc-swap = "1.5.0"
async-recursion = "1.0.0"
Expand Down
98 changes: 58 additions & 40 deletions crates/taplo-wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/taplo-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async-trait = "0.1.56"
clap = { version = "3.1.18", features = ["derive"] }
console_error_panic_hook = "0.1.7"
futures = "0.3.21"
getrandom = { version = "0.2.7", features = ["js"] }
getrandom = { version = "0.2.8", features = ["js"] }
indexmap = "~1.6"
js-sys = "0.3.57"
lsp-async-stub = { path = "../lsp-async-stub" }
Expand Down
2 changes: 1 addition & 1 deletion crates/taplo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ default = ["serde"]
schema = ["schemars"]

[dependencies]
ahash = "0.7.6"
ahash = "0.8.3"
arc-swap = "1.5.0"
either = "1.6.1"
globset = { version = "0.4.8" }
Expand Down
4 changes: 4 additions & 0 deletions editors/vscode/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { RpcMessage, TaploLsp } from "@taplo/lsp";
import fetch, { Headers, Request, Response } from "node-fetch";
import glob from "fast-glob";

import { webcrypto } from "node:crypto";
// https://docs.rs/getrandom/latest/getrandom/#nodejs-es-module-support
globalThis.crypto = webcrypto;

let taplo: TaploLsp;

process.on("message", async (d: RpcMessage) => {
Expand Down

0 comments on commit d363946

Please sign in to comment.