Skip to content

Commit

Permalink
Merge branch 'main' into vs-code-diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasWanke authored Dec 21, 2024
2 parents dd7b7cc + 52cbce4 commit 7d828aa
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 42 deletions.
14 changes: 4 additions & 10 deletions packages_v5/example.candy
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,6 @@ fun get(self: Text, index: Int) Maybe[Text] {
fun getRange(self: Text, startInclusive: Int, endExclusive: Int) Text {
self.builtinTextGetRange(startInclusive, endExclusive)
}
fun characterAt(self: Text, index: Int) Maybe[Text] {
switch index.isInRange(0, self.length()) {
false => none[Text](),
true => some(self.getRange(index, index.add(1))),
}
}
fun characters(self: Text) List[Text] {
listGenerate(self.length(), (i: Int) { self.get(i).unwrap() })
}
Expand Down Expand Up @@ -305,7 +299,7 @@ fun splitIf(self: Text, predicate: (Text) Bool) List[Text] {
self.splitIfHelper(predicate, 0, 0 listOf[Text]())
}
fun splitIfHelper(self: Text, predicate: (Text) Bool, currentStartOffset: Int, offset: Int, result: List[Text]) List[Text] {
switch self.characterAt(offset) {
switch self.get(offset) {
none => result.append(self.getRange(currentStartOffset, offset)),
some(char) => switch predicate(char) {
true => {
Expand Down Expand Up @@ -589,12 +583,12 @@ fun all[T](list: List[T], predicate: (T) Bool) Bool {
list.allHelper(predicate, 0)
}
fun allHelper[T](list: List[T], predicate: (T) Bool, index: Int) Bool {
switch index.isLessThan(list.length()) {
true => switch predicate(list.get(index).unwrap()) {
switch list.get(index) {
some(item) => switch predicate(item) {
true => list.allHelper(predicate, index.add(1)),
false => false,
},
false => true,
none => true,
}
}
fun any[T](list: List[T], predicate: (T) Bool) Bool {
Expand Down
44 changes: 22 additions & 22 deletions vscode_extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vscode_extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"test": "node ./out/test/runTest.js"
},
"dependencies": {
"@vscode/debugadapter": "^1.65.0",
"@vscode/debugadapter": "^1.68.0",
"vscode-languageclient": "^9.0.1"
},
"devDependencies": {
Expand All @@ -258,7 +258,7 @@
"eslint-plugin-prettier": "^5.2.1",
"glob": "^10.3.10",
"mocha": "^10.8.2",
"prettier": "^3.4.1",
"prettier": "^3.4.2",
"typescript": "^5.4.5",
"vscode-test": "^1.4.0"
},
Expand Down
14 changes: 7 additions & 7 deletions vscode_extension_v4/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vscode_extension_v4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.4.1",
"prettier": "^3.4.2",
"typescript": "^5.3.3"
},
"eslintConfig": {
Expand Down

0 comments on commit 7d828aa

Please sign in to comment.