diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c42e75..42ada54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,14 @@ All notable changes to the **JBang** extension will be documented in this file. -## [0.7.0] TBD +## [0.7.0] 23/06/2023 - Update JBang catalog schema (from jbang-idea) +- Added completion for `//PREVIEW` (requires JBang 0.108.0+) ## [0.6.0] 24/02/2023 - Added autocompletion for [`jbang-catalog.json`](https://www.jbang.dev/documentation/guide/latest/alias_catalogs.html) files. -- Added completion for `//MODULE` and `//MAIN` directives (require JBang 0.104.0+) +- Added completion for `//MODULE` and `//MAIN` directives (requires JBang 0.104.0+) - Added JBang debug icon - Fixed hover failing over LATEST versions - Allowed completion for several `//DESCRIPTION` directives diff --git a/package-lock.json b/package-lock.json index e080e01..7884b77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "jbang-vscode", - "version": "0.6.1", + "version": "0.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f5281ea..f0561ff 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "jbang-vscode", "displayName": "JBang", "description": "JBang support for VS Code Java", - "version": "0.6.1", + "version": "0.7.0", "icon": "icons/jbang.png", "publisher": "jbangdev", "license": "MIT", diff --git a/src/completion/DirectivesCompletion.ts b/src/completion/DirectivesCompletion.ts index 5f54f2d..414be69 100644 --- a/src/completion/DirectivesCompletion.ts +++ b/src/completion/DirectivesCompletion.ts @@ -18,6 +18,7 @@ const GROOVY = "//GROOVY "; const KOTLIN = "//KOTLIN "; const MODULE = "//MODULE "; const MAIN = "//MAIN "; +const PREVIEW = "//PREVIEW"; export class DirectivesCompletion implements CompletionParticipant { applies(lineText: string, position: Position): boolean { @@ -96,6 +97,9 @@ export class DirectivesCompletion implements CompletionParticipant { if (!scanner.found(NATIVE_OPTIONS)) { items.push(getCompletion(NATIVE_OPTIONS, "Options passed to the native image builder", range)); } + if (!scanner.found(PREVIEW)) { + items.push(getCompletion(PREVIEW, "Enable Java preview features", range)); + } return items; } } @@ -111,7 +115,7 @@ class DirectiveScanner { scan(document: TextDocument) { const checkedDirectives = [ - JAVA, JAVAC_OPTIONS, COMPILE_OPTIONS, DESCRIPTION, CDS, GAV, JAVAAGENT, MANIFEST, JAVA_OPTIONS, RUNTIME_OPTIONS, NATIVE_OPTIONS, KOTLIN, GROOVY, MAIN, MODULE + JAVA, JAVAC_OPTIONS, COMPILE_OPTIONS, DESCRIPTION, CDS, GAV, JAVAAGENT, MANIFEST, JAVA_OPTIONS, RUNTIME_OPTIONS, NATIVE_OPTIONS, KOTLIN, GROOVY, MAIN, MODULE, PREVIEW ]; const lines = document.getText().split(/\r?\n/); for (let i = 0; i < lines.length && checkedDirectives.length > 0; i++) {