Skip to content

Commit dcb96c6

Browse files
authored
feat: update to Cedar SDK 4.9.1 (#46)
Signed-off-by: Kevin Hakanson <kevhak@amazon.com>
1 parent 574c7ea commit dcb96c6

File tree

11 files changed

+474
-330
lines changed

11 files changed

+474
-330
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## v0.10.3 (Preview) 2026-03-18
2+
3+
- Update to Cedar SDK 4.9.1
4+
- IntelliSense for built-in function signatures
5+
16
## v0.10.2 (Preview) 2026-02-26
27

38
- Update to Cedar SDK 4.9.0

package-lock.json

Lines changed: 211 additions & 159 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
"url": "https://github.com/cedar-policy/vscode-cedar/issues"
1313
},
1414
"qna": "https://github.com/cedar-policy/vscode-cedar/issues",
15-
"version": "0.10.2",
15+
"version": "0.10.3",
1616
"preview": true,
1717
"icon": "icons/cedar-policy.png",
1818
"engines": {
19-
"vscode": "^1.83.0"
19+
"vscode": "^1.83.0",
20+
"node": ">=18.0.0"
2021
},
2122
"categories": [
2223
"Programming Languages",
@@ -303,12 +304,12 @@
303304
"@types/mocha": "^10.0.10",
304305
"@types/node": "=18.15.0",
305306
"@types/vscode": "=1.83.0",
306-
"@typescript-eslint/eslint-plugin": "^8.56.1",
307-
"@typescript-eslint/parser": "^8.56.1",
307+
"@typescript-eslint/eslint-plugin": "^8.57.1",
308+
"@typescript-eslint/parser": "^8.57.1",
308309
"@vscode/test-cli": "^0.0.12",
309310
"@vscode/test-electron": "^2.5.2",
310311
"@vscode/vsce": "^3.7.1",
311-
"eslint": "^9.39.3",
312+
"eslint": "^9.39.4",
312313
"js-yaml": "^4.1.1",
313314
"mocha": "^11.7.5",
314315
"typescript": "^5.9.3"

src/about.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,15 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import * as vscode from 'vscode';
5-
import * as path from 'node:path';
6-
import * as fs from 'node:fs';
75
import * as cedar from 'vscode-cedar-wasm';
86

9-
const packageJsonFile = path.join(__dirname, '..', 'package.json');
10-
const packageJson = JSON.parse(fs.readFileSync(packageJsonFile, 'utf8'));
11-
const packageVersion = `${packageJson.publisher}.${packageJson.name}: ${packageJson.version}\n`;
12-
const vsCodeVersion = `Visual Studio Code: ${vscode.version}\n`;
13-
const nodeVersion = process.versions.node
14-
? `node: ${process.versions.node}\n`
15-
: '';
16-
17-
export async function aboutExtension(): Promise<void> {
7+
export async function aboutExtension(context: vscode.ExtensionContext): Promise<void> {
8+
const pkg = context.extension.packageJSON;
189
const extensionDetails =
19-
packageVersion +
10+
`${pkg.publisher}.${pkg.name}: ${pkg.version}\n` +
2011
`Cedar SDK: ${cedar.getCedarSDKVersion()}\n` +
21-
vsCodeVersion +
22-
nodeVersion;
12+
`Visual Studio Code: ${vscode.version}\n` +
13+
(process.versions.node ? `node: ${process.versions.node}\n` : '');
2314

2415
const result = await vscode.window.showInformationMessage(
2516
extensionDetails,

src/extension.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ import {
7575
CedarSchemaCompletionItemProvider,
7676
} from './completion';
7777
import { CedarHoverProvider, CedarEntitiesJSONHoverProvider } from './hover';
78+
import { CedarSignatureHelpProvider } from './signaturehelp';
7879
import { aboutExtension } from './about';
7980
import * as cedar from 'vscode-cedar-wasm';
8081
import { ValidateWithSchemaCodeLensProvider } from './codelens';
@@ -150,6 +151,15 @@ export async function activate(context: vscode.ExtensionContext) {
150151
)
151152
);
152153

154+
context.subscriptions.push(
155+
vscode.languages.registerSignatureHelpProvider(
156+
{ language: 'cedar' },
157+
new CedarSignatureHelpProvider(),
158+
'(', // trigger: opening a function call
159+
',' // retrigger: moving to the next argument
160+
)
161+
);
162+
153163
context.subscriptions.push(
154164
vscode.languages.registerCodeLensProvider(
155165
{ language: 'cedar' },
@@ -218,7 +228,7 @@ export async function activate(context: vscode.ExtensionContext) {
218228
*/
219229
context.subscriptions.push(
220230
vscode.commands.registerCommand(COMMAND_CEDAR_ABOUT, (args: any[]) => {
221-
aboutExtension();
231+
aboutExtension(context);
222232
})
223233
);
224234
context.subscriptions.push(
@@ -257,9 +267,11 @@ export async function activate(context: vscode.ExtensionContext) {
257267
}
258268
)
259269
);
260-
vscode.workspace.registerTextDocumentContentProvider(
261-
CedarTextDocumentContentProvider.scheme,
262-
new CedarTextDocumentContentProvider()
270+
context.subscriptions.push(
271+
vscode.workspace.registerTextDocumentContentProvider(
272+
CedarTextDocumentContentProvider.scheme,
273+
new CedarTextDocumentContentProvider()
274+
)
263275
);
264276
context.subscriptions.push(
265277
vscode.commands.registerTextEditorCommand(

src/generate.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ export const generateDiagram = (
8585

8686
let commonTypes: string[] = [];
8787
if (cedarschema[namespace].commonTypes) {
88-
// @ts-ignore
89-
commonTypes = Object.keys(cedarschema[namespace]?.commonTypes);
88+
commonTypes = Object.keys(cedarschema[namespace].commonTypes);
9089
commonTypes.forEach((name) => {
91-
// @ts-ignore
92-
const e = cedarschema[namespace]?.commonTypes[name];
90+
const e = cedarschema[namespace].commonTypes![name];
9391
let properties = '\n';
9492
if (e?.attributes) {
9593
const attributes = e.attributes;

0 commit comments

Comments
 (0)