Skip to content

Commit

Permalink
Fixes #333
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-bsaviano committed May 31, 2024
1 parent 1e61ba6 commit af6f537
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [2.5.1] - 2024-XX-XX
- Fix issue [#328](https://github.com/intersystems/language-server/issues/328): Fix namespace detection for Diagnostic computation
- Fix issue [#331](https://github.com/intersystems/language-server/issues/331): Fix display of method arguments with a colon in the default value
- Fix issue [#333](https://github.com/intersystems/language-server/issues/333): Fix folding ranges when routine labels that don't appear in the first column
- Parser changes:
- DP-430950: Support new `Requires` Query keyword

Expand Down
6 changes: 3 additions & 3 deletions server/src/providers/foldingRange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ export async function onFoldingRanges(params: FoldingRangeParams) {
}
}
if (
parsed[line][0].l === ld.cos_langindex && parsed[line][0].s === ld.cos_label_attrindex &&
firsttokentext !== routinename && (doc.languageId === "objectscript" || doc.languageId === "objectscript-int")
parsed[line][0].l == ld.cos_langindex && parsed[line][0].s == ld.cos_label_attrindex && parsed[line][0].p == 0 &&
firsttokentext != routinename && (doc.languageId == "objectscript" || doc.languageId == "objectscript-int")
) {
// This line starts with a routine label

Expand Down Expand Up @@ -195,7 +195,7 @@ export async function onFoldingRanges(params: FoldingRangeParams) {
// Don't fold comments that immediately precede the next label
precedingcomments++;
}
else if (parsed[nl][0].l === ld.cos_langindex && parsed[nl][0].s === ld.cos_label_attrindex) {
else if (parsed[nl][0].l == ld.cos_langindex && parsed[nl][0].s == ld.cos_label_attrindex && parsed[nl][0].p == 0) {
// This is the next label
openranges[openranges.length-1].endLine = nl-precedingcomments-1;
if (openranges[openranges.length-1].startLine < openranges[openranges.length-1].endLine) {
Expand Down

0 comments on commit af6f537

Please sign in to comment.