Skip to content

Commit

Permalink
chore: merge
Browse files Browse the repository at this point in the history
  • Loading branch information
TorchedSammy committed Dec 7, 2023
2 parents 1d64a57 + 1a4585a commit a0513c0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
29 changes: 29 additions & 0 deletions docs/api/hilbish/hilbish.completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Interface hilbish.completion
description: tab completions
layout: doc
menu:
docs:
parent: "API"
---

## Introduction
The completions interface deals with tab completions.

## Functions
### call(name, query, ctx, fields) -> completionGroups (table), prefix (string)
Calls a completer function. This is mainly used to call
a command completer, which will have a `name` in the form
of `command.name`, example: `command.git`.
You can check `doc completions` for info on the `completionGroups` return value.

### handler(line, pos)
The handler function is the callback for tab completion in Hilbish.
You can check the completions doc for more info.

### bins(query, ctx, fields) -> entries (table), prefix (string)
Returns binary/executale completion candidates based on the provided query.

### files(query, ctx, fields) -> entries (table), prefix (string)
Returns file completion candidates based on the provided query.

8 changes: 4 additions & 4 deletions emmyLuaDocs/hilbish.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ function hilbish.runner.setMode(cb) end
--- @param query string
--- @param ctx string
--- @param fields table
function hilbish.completions.call(name, query, ctx, fields) end
function hilbish.completion.call(name, query, ctx, fields) end

--- The handler function is the callback for tab completion in Hilbish.
--- You can check the completions doc for more info.
--- @param line string
--- @param pos string
function hilbish.completions.handler(line, pos) end
function hilbish.completion.handler(line, pos) end

--- Returns the current input line.
function hilbish.editor.getLine() end
Expand Down Expand Up @@ -175,13 +175,13 @@ function hilbish.jobs:background() end
--- @param query string
--- @param ctx string
--- @param fields table
function hilbish.completions.bins(query, ctx, fields) end
function hilbish.completion.bins(query, ctx, fields) end

--- Returns file completion candidates based on the provided query.
--- @param query string
--- @param ctx string
--- @param fields table
function hilbish.completions.files(query, ctx, fields) end
function hilbish.completion.files(query, ctx, fields) end

--- Puts a job in the foreground. This will cause it to run like it was
--- executed normally and wait for it to complete.
Expand Down

0 comments on commit a0513c0

Please sign in to comment.