Skip to content

Commit dcd19d2

Browse files
authored
Merge pull request #11 from joshraphael/update_functions
update RATools functions to match new spec
2 parents 0c8b556 + f6fa065 commit dcd19d2

4 files changed

Lines changed: 221 additions & 89 deletions

File tree

CHANGELOG.md

Lines changed: 83 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,29 @@ All notable changes to the "vscode-rascript" extension will be documented in thi
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [[0.3.2](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.3.2)] - 2025-XX-XX
8+
## [[0.4.0](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.4.0)] - 2025-09-18
99

10-
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.3.1...v0.3.2)
10+
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.3.1...v0.4.0)
1111

1212
### Added
1313

14+
- New built-in function definition `achievement_set()`
15+
1416
### Changed
1517

1618
- Syntax highlighting to use upstream [rascript-syntax](https://github.com/joshraphael/rascript-syntax) repo
17-
- Bug involving incorrect comment bounds detected for hover, definition and completion data
1819
- Unify document parser to align with language server
20+
- `achievement()` built-in function definition to support new `set` parameter
21+
- `leaderboard()` built-in function definition to support new `set` parameter
1922

2023
### Removed
2124

25+
### Fixed
26+
27+
- Bug involving incorrect comment bounds detected for hover, definition and completion data
28+
29+
### Security
30+
2231
## [[0.3.1](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.3.1)] - 2025-08-07
2332

2433
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.3.0...v0.3.1)
@@ -28,10 +37,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2837
### Changed
2938

3039
- Allow function names, parameters class names, and variables to start with an underscore
31-
- Fix extension package distribution pipeline
3240

3341
### Removed
3442

43+
### Fixed
44+
45+
- Extension package distribution pipeline
46+
47+
### Security
48+
3549
## [[0.3.0](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.3.0)] - 2025-08-03
3650

3751
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.2.4...v0.3.0)
@@ -46,12 +60,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4660
### Changed
4761

4862
- Fixed code jumping, hover text, and code completion to ignore any functions or classes defined in a comment
49-
- Duplicate function and variable names being show in auto completion
5063
- Improved illegal name detection on functions and parameters
51-
- Bump dependencies to fix multiple vulnerabilities [#3](https://github.com/joshraphael/vscode-rascript/security/dependabot/3), [#4](https://github.com/joshraphael/vscode-rascript/security/dependabot/4), [#5](https://github.com/joshraphael/vscode-rascript/security/dependabot/5), [#7](https://github.com/joshraphael/vscode-rascript/security/dependabot/7), [#10](https://github.com/joshraphael/vscode-rascript/security/dependabot/10)
5264

5365
### Removed
5466

67+
### Fixed
68+
69+
- Duplicate function and variable names being show in auto completion
70+
71+
### Security
72+
73+
- Bump dependencies to fix multiple vulnerabilities [#3](https://github.com/joshraphael/vscode-rascript/security/dependabot/3), [#4](https://github.com/joshraphael/vscode-rascript/security/dependabot/4), [#5](https://github.com/joshraphael/vscode-rascript/security/dependabot/5), [#7](https://github.com/joshraphael/vscode-rascript/security/dependabot/7), [#10](https://github.com/joshraphael/vscode-rascript/security/dependabot/10)
74+
5575
## [[0.2.4](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.2.4)] - 2025-06-16
5676

5777
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.2.3...v0.2.4)
@@ -64,6 +84,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6484

6585
### Removed
6686

87+
### Fixed
88+
89+
### Security
90+
6791
## [[0.2.3](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.2.3)] - 2025-06-15
6892

6993
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.2.2...v0.2.3)
@@ -76,6 +100,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
76100

77101
- File system check for language server before launch causing extension to not activate
78102

103+
### Fixed
104+
105+
### Security
106+
79107
## [[0.2.2](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.2.2)] - 2025-06-15
80108

81109
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.2.1...v0.2.2)
@@ -88,6 +116,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88116

89117
### Removed
90118

119+
### Fixed
120+
121+
### Security
122+
91123
## [[0.2.1](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.2.1)] - 2025-06-14
92124

93125
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.2.0...v0.2.1)
@@ -100,6 +132,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
100132

101133
### Removed
102134

135+
### Fixed
136+
137+
### Security
138+
103139
## [[0.2.0](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.2.0)] - 2025-06-14
104140

105141
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.1.3...v0.2.0)
@@ -110,10 +146,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
110146

111147
### Changed
112148

113-
- Bump `@vscode/test-web` to version 0.0.70 ([security vulnerability](https://github.com/joshraphael/vscode-rascript/security/dependabot/2))
114-
115149
### Removed
116150

151+
### Fixed
152+
153+
### Security
154+
155+
- Bump `@vscode/test-web` to version 0.0.70 ([security vulnerability](https://github.com/joshraphael/vscode-rascript/security/dependabot/2))
156+
117157
## [[0.1.3](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.1.3)] - 2025-06-05
118158

119159
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.1.2...v0.1.3)
@@ -126,6 +166,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
126166

127167
### Removed
128168

169+
### Fixed
170+
171+
### Security
172+
129173
## [[0.1.2](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.1.2)] - 2025-05-27
130174

131175
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.1.1...v0.1.2)
@@ -139,10 +183,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
139183

140184
### Changed
141185

142-
- Bump `@vscode/test-web` to version 0.0.69 ([security vulnerability](https://github.com/joshraphael/vscode-rascript/security/dependabot/1))
143-
144186
### Removed
145187

188+
### Fixed
189+
190+
### Security
191+
192+
- Bump `@vscode/test-web` to version 0.0.69 ([security vulnerability](https://github.com/joshraphael/vscode-rascript/security/dependabot/1))
193+
146194
## [[0.1.1](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.1.1)] - 2025-03-01
147195

148196
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.1.0...v0.1.1)
@@ -157,6 +205,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
157205

158206
### Removed
159207

208+
### Fixed
209+
210+
### Security
211+
160212
## [[0.1.0](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.1.0)] - 2025-02-28
161213

162214
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.0.4...v0.1.0)
@@ -171,6 +223,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
171223

172224
### Removed
173225

226+
### Fixed
227+
228+
### Security
229+
174230
## [[0.0.4](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.0.4)] - 2025-02-25
175231

176232
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.0.3...v0.0.4)
@@ -186,6 +242,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
186242

187243
### Removed
188244

245+
### Fixed
246+
247+
### Security
248+
189249
## [[0.0.3](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.0.3)] - 2025-02-24
190250

191251
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.0.2...v0.0.3)
@@ -205,6 +265,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
205265

206266
### Removed
207267

268+
### Fixed
269+
270+
### Security
271+
208272
## [[0.0.2](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.0.2)] - 2025-02-23
209273

210274
[diff](https://github.com/joshraphael/vscode-rascript/compare/v0.0.1...v0.0.2)
@@ -218,6 +282,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
218282

219283
### Removed
220284

285+
### Fixed
286+
287+
### Security
288+
221289
## [[0.0.1](https://github.com/joshraphael/vscode-rascript/releases/tag/v0.0.1)] - 2025-02-22
222290

223291
[diff](https://github.com/joshraphael/vscode-rascript/compare/8f97b037538abae0e892b19c86ba3e4cd9f87c73...v0.0.1)
@@ -241,4 +309,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
241309

242310
### Changed
243311

244-
### Removed
312+
### Removed
313+
314+
### Fixed
315+
316+
### Security

src/clients/shared/functionDefinitions.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ export const builtinFunctionDefinitions: readonly FunctionDefinition[] = [
604604
},
605605
{
606606
key: "achievement",
607-
url: "https://github.com/Jamiras/RATools/wiki/Achievement-Functions",
607+
url: "https://github.com/Jamiras/RATools/wiki/Achievement-Functions#achievementtitle-description-points-trigger-id0-published-modified-badge0-type-set0",
608608
args: [
609609
"title",
610610
"description",
@@ -615,6 +615,7 @@ export const builtinFunctionDefinitions: readonly FunctionDefinition[] = [
615615
"modified",
616616
"badge",
617617
"type",
618+
"set",
618619
],
619620
commentDoc: [
620621
"// Defines a new achievement with the specified `title` (string), `description` (string), `points` (integer), and `trigger`.",
@@ -640,6 +641,8 @@ export const builtinFunctionDefinitions: readonly FunctionDefinition[] = [
640641
'// | `"progression"` | Progression |',
641642
'// | `"win_condition"` | Win condition |',
642643
"// ",
644+
"// `set` specifies the unique identifier of the [achievement set](https://github.com/Jamiras/RATools/wiki/Achievement-Functions#achievement_settitle-typebonus-id0-game_id0) the achievement should be partitioned into.",
645+
"// ",
643646
"// #### Example",
644647
"// ",
645648
"// ```rascript",
@@ -661,6 +664,30 @@ export const builtinFunctionDefinitions: readonly FunctionDefinition[] = [
661664
"// ```",
662665
],
663666
},
667+
{
668+
key: "achievement_set",
669+
url: "https://github.com/Jamiras/RATools/wiki/Achievement-Functions#achievement_settitle-typebonus-id0-game_id0",
670+
args: ["title", "type", "id", "game_id"],
671+
commentDoc: [
672+
"// Defines a new achievement set (subset) with the specified `title`.",
673+
"// ",
674+
"// `type` defines how the subset is associated to the base set. Valid values are `BONUS`, `SPECIALTY`, and `EXCLUSIVE`.",
675+
"// ",
676+
"// `id` is the achievement set id. This should match the `set=` parameter from the game's subset page.",
677+
"// ",
678+
"// `game_id` is the legacy game ID for subsets created before sets were merged into the base game.",
679+
"// ",
680+
"// The return value is the unique identifier of the set to be passed to the achievement/leaderboard functions. If `id` is provided, it will be returned, otherwise a local value will be generated.",
681+
"// ",
682+
"// #### Example",
683+
"// ",
684+
"// ```rascript",
685+
'// bonus_set = achievement_set("Bonus")',
686+
'// achievement("Impossible", "Complete the game without dying", 100, set=bonus_set,',
687+
"// trigger = complete_game() && never(lives() < prev(lives))",
688+
"// ```",
689+
],
690+
},
664691
{
665692
key: "rich_presence_display",
666693
url: "https://github.com/Jamiras/RATools/wiki/Rich-Presence-Functions#rich_presence_displayformat_string-parameters",
@@ -819,6 +846,7 @@ export const builtinFunctionDefinitions: readonly FunctionDefinition[] = [
819846
"format",
820847
"lower_is_better",
821848
"id",
849+
"set",
822850
],
823851
commentDoc: [
824852
"// Defines a leaderboard. `title` and `description` must be strings.",
@@ -844,6 +872,8 @@ export const builtinFunctionDefinitions: readonly FunctionDefinition[] = [
844872
"// if `lower_is_better` is `true`, lower scores will be ranked higher in the leaderboard.",
845873
"// ",
846874
"// if `id` is provided when calling the `leaderboard` function, the script will generate a local leaderboard definition that the toolkit will merge into the existing leaderboard instead of putting as a separate local leaderboard.",
875+
"// ",
876+
"// `set` specifies the unique identifier of the [achievement set](https://github.com/Jamiras/RATools/wiki/Achievement-Functions#achievement_settitle-typebonus-id0-game_id0) the achievement should be partitioned into.",
847877
],
848878
},
849879
{

src/clients/shared/models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export interface ClassFunction {
3030
export interface HoverData {
3131
key: string;
3232
index: number;
33+
type: string;
3334
className: string;
3435
hover: vscode.Hover;
3536
args: string[];

0 commit comments

Comments
 (0)