Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Glasgow Haskell Compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
195626fc
Commit
195626fc
authored
Jul 07, 2013
by
ian@well-typed.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs for ghci completion command for ghci; part of #5687. Patch from hvr.
parent
36a54173
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
0 deletions
+87
-0
docs/users_guide/ghci.xml
docs/users_guide/ghci.xml
+87
-0
No files found.
docs/users_guide/ghci.xml
View file @
195626fc
...
...
@@ -2178,6 +2178,93 @@ maybe :: b -> (a -> b) -> Maybe a -> b
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>
:complete
</literal>
<replaceable>
type
</replaceable>
<optional><replaceable>
n
</replaceable>
-
</optional><optional><replaceable>
m
</replaceable></optional>
<replaceable>
string-literal
</replaceable>
<indexterm><primary><literal>
:complete
</literal></primary></indexterm>
</term>
<listitem>
<para>
This command allows to request command completions
from GHCi even when interacting over a pipe instead of a
proper terminal and is designed for integrating GHCi's
completion with text editors and IDEs.
</para>
<para>
When called,
<literal>
:complete
</literal>
prints the
<replaceable>
n
</replaceable><superscript>
th
</superscript>
to
<replaceable>
m
</replaceable><superscript>
th
</superscript>
completion candidates for the partial input
<replaceable>
string-literal
</replaceable>
for the completion
domain denoted by
<replaceable>
type
</replaceable>
. Currently, only the
<literal>
repl
</literal>
domain is supported which denotes
the kind of completion that would be provided interactively
by GHCi at the input prompt.
</para>
<para>
If omitted,
<replaceable>
n
</replaceable>
and
<replaceable>
m
</replaceable>
default to the first or last
available completion candidate respectively. If there are
less candidates than requested via the range argument,
<replaceable>
n
</replaceable>
and
<replaceable>
m
</replaceable>
are implicitly capped to the
number of available completition candidates.
</para>
<para>
The output of
<literal>
:complete
</literal>
begins with
a header line containing three space-delimited fields:
<itemizedlist>
<listitem>
An integer denoting the number
<replaceable>
l
</replaceable>
of printed
completions,
</listitem>
<listitem>
an integer denoting the total number of
completions available, and finally
</listitem>
<listitem>
a string literal denoting a common
prefix to be added to the returned completion
candidates.
</listitem>
</itemizedlist>
The header line is followed by
<replaceable>
l
</replaceable>
lines each containing one completion candidate encoded as
(quoted) string literal. Here are some example invocations
showing the various cases:
</para>
<screen>
Prelude
>
:complete repl 0 ""
0 470 ""
Prelude
>
:complete repl 5 "import For"
5 21 "import "
"Foreign"
"Foreign.C"
"Foreign.C.Error"
"Foreign.C.String"
"Foreign.C.Types"
Prelude
>
:complete repl 5-10 "import For"
6 21 "import "
"Foreign.C.Types"
"Foreign.Concurrent"
"Foreign.ForeignPtr"
"Foreign.ForeignPtr.Safe"
"Foreign.ForeignPtr.Unsafe"
"Foreign.Marshal"
Prelude
>
:complete repl 20- "import For"
2 21 "import "
"Foreign.StablePtr"
"Foreign.Storable"
Prelude
>
:complete repl "map"
3 3 ""
"map"
"mapM"
"mapM_"
Prelude
>
:complete repl 5-10 "map"
0 3 ""
</screen>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>
:continue
</literal>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment