Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bash-language-server

Package Overview
Dependencies
Maintainers
2
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bash-language-server - npm Package Compare versions

Comparing version 4.10.0 to 4.10.1

4

CHANGELOG.md
# Bash Language Server
## 4.10.1
- Handle tree-sitter-bash parse errors gracefully
## 4.10.0

@@ -4,0 +8,0 @@

@@ -47,3 +47,10 @@ "use strict";

const fileContent = document.getText();
const tree = this.parser.parse(fileContent);
let tree;
try {
tree = this.parser.parse(fileContent);
}
catch (error) {
logger_1.logger.warn(`Tree sitter crashed while parsing ${uri}: ${error}`);
return [];
}
const globalDeclarations = (0, declarations_1.getGlobalDeclarations)({ tree, uri });

@@ -50,0 +57,0 @@ const sourceCommands = sourcing.getSourceCommands({

2

package.json

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "4.10.0",
"version": "4.10.1",
"main": "./out/server.js",

@@ -9,0 +9,0 @@ "typings": "./out/server.d.ts",

@@ -146,2 +146,20 @@ import { pathToFileURL } from 'node:url'

})
it('handles tree-sitter crashes gracefully', async () => {
const analyzer = await getAnalyzer({ runBackgroundAnalysis: false })
// Parse the file
analyzer.analyze({
uri: FIXTURE_URI.CRASH,
document: FIXTURE_DOCUMENT.CRASH,
})
expect(loggerWarn).toHaveBeenCalled()
expect(loggerWarn.mock.calls).toEqual([
[expect.stringContaining('Tree sitter crashed while parsing')],
])
const result = analyzer.findAllSourcedUris({ uri: FIXTURE_URI.CRASH })
expect(result).toEqual(new Set([]))
})
})

@@ -148,0 +166,0 @@

@@ -73,4 +73,10 @@ import * as fs from 'fs'

const fileContent = document.getText()
let tree: Parser.Tree
const tree = this.parser.parse(fileContent)
try {
tree = this.parser.parse(fileContent)
} catch (error) {
logger.warn(`Tree sitter crashed while parsing ${uri}: ${error}`)
return []
}

@@ -77,0 +83,0 @@ const globalDeclarations = getGlobalDeclarations({ tree, uri })

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc