Skip to content

Commit 02c933d

Browse files
authored
Merge pull request #404 from bash-lsp/ks/node-18
Workaround for node 18 support
2 parents 0ae47b5 + 9b08bcc commit 02c933d

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

server/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Bash Language Server
22

3+
## 3.0.3
4+
5+
- Workaround for emscripten node 18 support https://github.com/bash-lsp/bash-language-server/pull/404
6+
37
## 3.0.2
48

59
- Fix analyzer not being called when getHighlightParsingError is off https://github.com/bash-lsp/bash-language-server/pull/396

server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "A language server for Bash",
44
"author": "Mads Hartmann",
55
"license": "MIT",
6-
"version": "3.0.2",
6+
"version": "3.0.3",
77
"publisher": "mads-hartmann",
88
"main": "./out/server.js",
99
"typings": "./out/server.d.ts",

server/src/parser.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
import * as Parser from 'web-tree-sitter'
22

3+
const _global: any = global
4+
35
export async function initializeParser(): Promise<Parser> {
6+
if (_global.fetch) {
7+
// NOTE: temporary workaround for emscripten node 18 support.
8+
// emscripten is used for compiling tree-sitter to wasm.
9+
// https://github.com/emscripten-core/emscripten/issues/16915
10+
delete _global.fetch
11+
}
12+
413
await Parser.init()
514
const parser = new Parser()
615

0 commit comments

Comments
 (0)