Skip to content

Commit

Permalink
Fixes #343, Prepare 2.6.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-bsaviano committed Aug 30, 2024
1 parent febc7f4 commit b38c457
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## [2.6.1] - 2024-08-30
- Fix issue [#343](https://github.com/intersystems/language-server/issues/343): foldingRange fails on some C-style block comments
- Fix issue [#344](https://github.com/intersystems/language-server/issues/344): Prevent errors during hover when no data was returned from the server

## [2.6.0] - 2024-08-29
Expand Down
5 changes: 3 additions & 2 deletions server/src/providers/foldingRange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,15 +699,16 @@ export async function onFoldingRanges(params: FoldingRangeParams) {
openranges.splice(prevrange,1);
}
else if (parsed[line][tkn].l == ld.cos_langindex && parsed[line][tkn].s == ld.cos_comment_attrindex) {
const commentText = doc.getText(Range.create(line,parsed[line][tkn].p,line,parsed[line][tkn].p+parsed[line][tkn].c)).trim();
const inCComment = openranges.length && openranges[openranges.length - 1].kind == "isc-ccomment";
if (!inCComment && doc.getText(Range.create(line,parsed[line][tkn].p,line,parsed[line][tkn].p+2)) == "/*") {
if (!inCComment && commentText.slice(0,2) == "/*") {
// Open a new C-style comment range
openranges.push({
startLine: line,
endLine: line,
kind: "isc-ccomment"
});
} else if (inCComment && doc.getText(Range.create(line,parsed[line][tkn].p+parsed[line][tkn].c-2,line,parsed[line][tkn].p+parsed[line][tkn].c)) == "*/") {
} else if (inCComment && commentText.slice(-2) == "*/") {
// Close the most recent C-style comment range
const cCommentRange = openranges.pop();
cCommentRange.endLine = line - 1;
Expand Down

0 comments on commit b38c457

Please sign in to comment.