diff --git a/CHANGELOG.md b/CHANGELOG.md index f9dcb51..c570d09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to the **JBang** extension will be documented in this file. ## [0.4.2] TBD - Display `Run JBang` menu on `jar` files +- Fixed JBang header completion ## [0.4.1] 03/01/2023 - Ignore Java's `Picked up JAVA_TOOL_OPTIONS` message that broke Gitpod integration diff --git a/src/completion/DirectivesCompletion.ts b/src/completion/DirectivesCompletion.ts index 760cc42..d307dc3 100644 --- a/src/completion/DirectivesCompletion.ts +++ b/src/completion/DirectivesCompletion.ts @@ -25,14 +25,15 @@ export class DirectivesCompletion implements CompletionParticipant { async provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken, context: CompletionContext): Promise { const items: CompletionItem[] = []; + const range = new Range(new Position(position.line, 0), position); if (position.line === 0) { items.push({ label: "///usr/bin/env jbang \"$0\" \"$@\" ; exit $?", kind: CompletionItemKind.Text, - detail: "JBang header" + detail: "JBang header", + range }); } - const range = new Range(new Position(position.line, 0), position); const scanner = new DirectiveScanner(); const retriggerCompletion = { command: 'editor.action.triggerSuggest', title: 'Re-trigger completions...' }; scanner.scan(document);