Skip to content

Workaround for node 18 support #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Bash Language Server

## 3.0.3

- Workaround for emscripten node 18 support https://github.com/bash-lsp/bash-language-server/pull/404

## 3.0.2

- Fix analyzer not being called when getHighlightParsingError is off https://github.com/bash-lsp/bash-language-server/pull/396
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"description": "A language server for Bash",
"author": "Mads Hartmann",
"license": "MIT",
"version": "3.0.2",
"version": "3.0.3",
"publisher": "mads-hartmann",
"main": "./out/server.js",
"typings": "./out/server.d.ts",
9 changes: 9 additions & 0 deletions server/src/parser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import * as Parser from 'web-tree-sitter'

const _global: any = global

export async function initializeParser(): Promise<Parser> {
if (_global.fetch) {
// NOTE: temporary workaround for emscripten node 18 support.
// emscripten is used for compiling tree-sitter to wasm.
// https://github.com/emscripten-core/emscripten/issues/16915
delete _global.fetch
}

await Parser.init()
const parser = new Parser()