Skip to content

Commit

Permalink
fix: remove extra // on Jbang header completion
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon committed Jan 4, 2023
1 parent 6fb0d73 commit 1d11dbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/completion/DirectivesCompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ export class DirectivesCompletion implements CompletionParticipant {

async provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken, context: CompletionContext): Promise<CompletionList | CompletionItem[]> {
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);
Expand Down

0 comments on commit 1d11dbd

Please sign in to comment.