Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Jan 14, 2024
1 parent 4d216ce commit 0f517dc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ghcr.io/rsteube/carapace:latest

RUN curl -Lo /usr/local/bin/minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& chmod +x /usr/local/bin/minikube

RUN apt-get update && apt-get install -y npm

RUN npm install -g @microsoft/inshellisense
RUN cd /usr/local/lib/node_modules/@microsoft/inshellisense/ \
&& npm i @withfig/[email protected]
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3'

services:
bridge:
build: .
command: elvish
environment:
TARGET: /carapace-bridge/cmd/carapace-bridge/carapace-bridge
volumes:
- '.:/carapace-bridge/'
10 changes: 9 additions & 1 deletion pkg/actions/bridge/inshellisense.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ func ActionInshellisense(command ...string) carapace.Action {

args := append(command, c.Args...)
args = append(args, c.Value)
return carapace.ActionExecCommand("inshellisense", "complete", shlex.Join(args))(func(output []byte) carapace.Action {

input := shlex.Join(args)

if strings.HasSuffix(input, `""`) {
// TODO temporary fix as inshellisense can't handle quotes yet (won't work for those within)
input = input[:len(input)-2] + " "
}

return carapace.ActionExecCommand("inshellisense", "complete", input)(func(output []byte) carapace.Action {
var r struct {
Suggestions []struct {
Name string
Expand Down

0 comments on commit 0f517dc

Please sign in to comment.