From c32f4af36e7fb25b7b48568fc12cc7cf7ef8d85c Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Sun, 17 Nov 2024 17:14:44 -0600 Subject: [PATCH] Add auto completions for scaffolds. --- package-lock.json | 4 ++-- package.json | 2 +- src/pg-parser.ts | 13 +++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b05c4c1..8ed773f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openwebwork/codemirror-lang-pg", - "version": "0.0.1-beta.13", + "version": "0.0.1-beta.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@openwebwork/codemirror-lang-pg", - "version": "0.0.1-beta.13", + "version": "0.0.1-beta.14", "license": "MIT", "dependencies": { "@codemirror/language": "^6.10.2", diff --git a/package.json b/package.json index e262449..59f9d39 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openwebwork/codemirror-lang-pg", - "version": "0.0.1-beta.13", + "version": "0.0.1-beta.14", "description": "PG language support for CodeMirror", "author": "The WeBWorK Project", "license": "MIT", diff --git a/src/pg-parser.ts b/src/pg-parser.ts index 3e49dfb..0d062e4 100644 --- a/src/pg-parser.ts +++ b/src/pg-parser.ts @@ -107,6 +107,19 @@ export const pgCompletion = (isTop = false) => { ); } } + + for (const part of ['Scaffold', 'Section']) { + for (const position of ['Begin', 'End']) { + completionOptions.push( + snippetCompletion(`${part}::${position}(\${});\${}`, { + label: `${part}::${position}`, + info: `${part}::${position}();`, + type: 'variable', + section: { name: 'PG Methods' } + }) + ); + } + } } return completeFromList(completionOptions)(context);