mirror of https://github.com/Hilbis/Hilbish
Compare commits
No commits in common. "1a4585aa7a3173705edb2de984f1a2aab2a96010" and "29e14c1aee7a505339fcfecc9eb117de4f775d67" have entirely different histories.
1a4585aa7a
...
29e14c1aee
2
api.go
2
api.go
|
@ -140,9 +140,7 @@ func hilbishLoad(rtm *rt.Runtime) (rt.Value, func()) {
|
||||||
|
|
||||||
// hilbish.completion table
|
// hilbish.completion table
|
||||||
hshcomp := completionLoader(rtm)
|
hshcomp := completionLoader(rtm)
|
||||||
// TODO: REMOVE "completion" AND ONLY USE "completions" WITH AN S
|
|
||||||
mod.Set(rt.StringValue("completion"), rt.TableValue(hshcomp))
|
mod.Set(rt.StringValue("completion"), rt.TableValue(hshcomp))
|
||||||
mod.Set(rt.StringValue("completions"), rt.TableValue(hshcomp))
|
|
||||||
|
|
||||||
// hilbish.runner table
|
// hilbish.runner table
|
||||||
runnerModule := runnerModeLoader(rtm)
|
runnerModule := runnerModeLoader(rtm)
|
||||||
|
|
10
complete.go
10
complete.go
|
@ -188,7 +188,7 @@ func escapeFilename(fname string) string {
|
||||||
return escapeReplaer.Replace(fname)
|
return escapeReplaer.Replace(fname)
|
||||||
}
|
}
|
||||||
|
|
||||||
// #interface completion
|
// #interface completions
|
||||||
// tab completions
|
// tab completions
|
||||||
// The completions interface deals with tab completions.
|
// The completions interface deals with tab completions.
|
||||||
func completionLoader(rtm *rt.Runtime) *rt.Table {
|
func completionLoader(rtm *rt.Runtime) *rt.Table {
|
||||||
|
@ -205,7 +205,7 @@ func completionLoader(rtm *rt.Runtime) *rt.Table {
|
||||||
return mod
|
return mod
|
||||||
}
|
}
|
||||||
|
|
||||||
// #interface completion
|
// #interface completions
|
||||||
// handler(line, pos)
|
// handler(line, pos)
|
||||||
// The handler function is the callback for tab completion in Hilbish.
|
// The handler function is the callback for tab completion in Hilbish.
|
||||||
// You can check the completions doc for more info.
|
// You can check the completions doc for more info.
|
||||||
|
@ -215,7 +215,7 @@ func completionHandler(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
return c.Next(), nil
|
return c.Next(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// #interface completion
|
// #interface completions
|
||||||
// call(name, query, ctx, fields) -> completionGroups (table), prefix (string)
|
// call(name, query, ctx, fields) -> completionGroups (table), prefix (string)
|
||||||
// Calls a completer function. This is mainly used to call
|
// Calls a completer function. This is mainly used to call
|
||||||
// a command completer, which will have a `name` in the form
|
// a command completer, which will have a `name` in the form
|
||||||
|
@ -265,7 +265,7 @@ func callLuaCompleter(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
return cont, nil
|
return cont, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// #interface completion
|
// #interface completions
|
||||||
// files(query, ctx, fields) -> entries (table), prefix (string)
|
// files(query, ctx, fields) -> entries (table), prefix (string)
|
||||||
// Returns file completion candidates based on the provided query.
|
// Returns file completion candidates based on the provided query.
|
||||||
// --- @param query string
|
// --- @param query string
|
||||||
|
@ -287,7 +287,7 @@ func luaFileComplete(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
return c.PushingNext(t.Runtime, rt.TableValue(luaComps), rt.StringValue(pfx)), nil
|
return c.PushingNext(t.Runtime, rt.TableValue(luaComps), rt.StringValue(pfx)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// #interface completion
|
// #interface completions
|
||||||
// bins(query, ctx, fields) -> entries (table), prefix (string)
|
// bins(query, ctx, fields) -> entries (table), prefix (string)
|
||||||
// Returns binary/executale completion candidates based on the provided query.
|
// Returns binary/executale completion candidates based on the provided query.
|
||||||
// --- @param query string
|
// --- @param query string
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
---
|
|
||||||
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.
|
|
||||||
|
|
|
@ -22,13 +22,13 @@ function hilbish.runner.setMode(cb) end
|
||||||
--- @param query string
|
--- @param query string
|
||||||
--- @param ctx string
|
--- @param ctx string
|
||||||
--- @param fields table
|
--- @param fields table
|
||||||
function hilbish.completion.call(name, query, ctx, fields) end
|
function hilbish.completions.call(name, query, ctx, fields) end
|
||||||
|
|
||||||
--- The handler function is the callback for tab completion in Hilbish.
|
--- The handler function is the callback for tab completion in Hilbish.
|
||||||
--- You can check the completions doc for more info.
|
--- You can check the completions doc for more info.
|
||||||
--- @param line string
|
--- @param line string
|
||||||
--- @param pos string
|
--- @param pos string
|
||||||
function hilbish.completion.handler(line, pos) end
|
function hilbish.completions.handler(line, pos) end
|
||||||
|
|
||||||
--- Returns the current input line.
|
--- Returns the current input line.
|
||||||
function hilbish.editor.getLine() end
|
function hilbish.editor.getLine() end
|
||||||
|
@ -175,13 +175,13 @@ function hilbish.jobs:background() end
|
||||||
--- @param query string
|
--- @param query string
|
||||||
--- @param ctx string
|
--- @param ctx string
|
||||||
--- @param fields table
|
--- @param fields table
|
||||||
function hilbish.completion.bins(query, ctx, fields) end
|
function hilbish.completions.bins(query, ctx, fields) end
|
||||||
|
|
||||||
--- Returns file completion candidates based on the provided query.
|
--- Returns file completion candidates based on the provided query.
|
||||||
--- @param query string
|
--- @param query string
|
||||||
--- @param ctx string
|
--- @param ctx string
|
||||||
--- @param fields table
|
--- @param fields table
|
||||||
function hilbish.completion.files(query, ctx, fields) end
|
function hilbish.completions.files(query, ctx, fields) end
|
||||||
|
|
||||||
--- Puts a job in the foreground. This will cause it to run like it was
|
--- Puts a job in the foreground. This will cause it to run like it was
|
||||||
--- executed normally and wait for it to complete.
|
--- executed normally and wait for it to complete.
|
||||||
|
|
Loading…
Reference in New Issue