diff --git a/CHANGELOG.md b/CHANGELOG.md index fc82cba..8915926 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to R Console will be documented in this file. +## [0.4.4] - 2026-08-05 + +### Fixed + +- Fixed some valid R commands with balanced square brackets being incorrectly treated as incomplete during execution. + ## [0.4.3] - 2026-07-16 ### Recent changes diff --git a/package-lock.json b/package-lock.json index 02c6b4f..782a501 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vsc-r-console", - "version": "0.4.3", + "version": "0.4.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vsc-r-console", - "version": "0.4.3", + "version": "0.4.4", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@xterm/headless": "^6.0.0", diff --git a/package.json b/package.json index 0f6c454..393d4ae 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vsc-r-console", "displayName": "R Console for VS Code", "description": "A lightweight R console for VS Code", - "version": "0.4.3", + "version": "0.4.4", "publisher": "RConsole", "license": "SEE LICENSE IN LICENSE", "icon": "images/Rlogo.png", diff --git a/src/Language/parser.ts b/src/Language/parser.ts index 256ff4d..a5b9dd9 100644 --- a/src/Language/parser.ts +++ b/src/Language/parser.ts @@ -604,7 +604,6 @@ interface ParserState { parenDepth: number; braceDepth: number; bracketDepth: number; - dblBracketDepth: number; } export async function isExpressionCompleteAsync(code: string): Promise { @@ -648,7 +647,6 @@ function classifyExpressionHeuristic(code: string): LocalParseClassification { parenDepth: 0, braceDepth: 0, bracketDepth: 0, - dblBracketDepth: 0, }; let sawUnknownToken = false; @@ -685,18 +683,10 @@ function classifyExpressionHeuristic(code: string): LocalParseClassification { state.braceDepth -= 1; break; case TokenType.LeftBracket: - if (token.value === "[[") { - state.dblBracketDepth += 1; - } else { - state.bracketDepth += 1; - } + state.bracketDepth += token.value.length; break; case TokenType.RightBracket: - if (token.value === "]]") { - state.dblBracketDepth -= 1; - } else { - state.bracketDepth -= 1; - } + state.bracketDepth -= token.value.length; break; case TokenType.Unknown: sawUnknownToken = true; @@ -709,8 +699,7 @@ function classifyExpressionHeuristic(code: string): LocalParseClassification { if ( state.parenDepth > 0 || state.braceDepth > 0 || - state.bracketDepth > 0 || - state.dblBracketDepth > 0 + state.bracketDepth > 0 ) { return "incomplete"; }