Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/go/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def go_mod(
out = "/**/BUILD",
deps = {"cfg": godeps_cfg},
runtime_deps = {"deps": godeps_deps},
hash_deps = [imports, gomodsum],
hash_deps = [gomodsum, imports] + mod_pkg_modsums,
tools = godeps,
env = {
"GOOS": get_os(),
Expand Down
46 changes: 46 additions & 0 deletions cmd/heph/lsp.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package main

import (
"fmt"

"github.com/hephbuild/heph/bootstrap"
"github.com/hephbuild/heph/lsp"
"github.com/spf13/cobra"
)

func init() {
lspCommand.AddCommand(servelspCmd)
}

var lspCommand = &cobra.Command{
Use: "lsp",
Aliases: []string{"lsp"},
Short: "Heph Language Server",
Args: cobra.RangeArgs(0, 1),
RunE: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf("run heph Language Server with `serve`")
},
}

var servelspCmd = &cobra.Command{
Use: "serve",
Short: "Serve LSP",
Aliases: []string{"s"},
ValidArgsFunction: ValidArgsFunctionTargets,
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()

localOpt := bootstrap.BootOpts{}
bs, err := bootstrap.BootBase(ctx, localOpt)
if err != nil {
return err
}

server, err := lsp.NewHephServer(bs.Root)
if err != nil {
return err
}

return server.Serve()
},
}
1 change: 1 addition & 0 deletions cmd/heph/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func init() {
rootCmd.AddCommand(runCmd)
rootCmd.AddCommand(cleanCmd)
rootCmd.AddCommand(queryCmd)
rootCmd.AddCommand(lspCommand)
rootCmd.AddCommand(cloudCmd)
rootCmd.AddCommand(gcCmd)
rootCmd.AddCommand(validateCmd)
Expand Down
10 changes: 2 additions & 8 deletions cmd/heph/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ func ValidArgsFunctionTargets(cmd *cobra.Command, args []string, toComplete stri
}

directive := cobra.ShellCompDirectiveNoFileComp
isFuzzy, suggestions := autocompleteTargetName(targets, toComplete)
if isFuzzy {
directive |= cobra.ShellCompDirectiveNoMatching
}
_, suggestions := autocompleteTargetName(targets, toComplete)

return suggestions, directive
}
Expand All @@ -26,10 +23,7 @@ func ValidArgsFunctionLabelsOrTargets(cmd *cobra.Command, args []string, toCompl
}

directive := cobra.ShellCompDirectiveNoFileComp
isFuzzy, suggestions := autocompleteLabelOrTarget(targets, labels, toComplete)
if isFuzzy {
directive |= cobra.ShellCompDirectiveNoMatching
}
_, suggestions := autocompleteLabelOrTarget(targets, labels, toComplete)

return suggestions, directive
}
68 changes: 39 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
module github.com/hephbuild/heph

go 1.22
go 1.25.1

replace github.com/spf13/cobra v1.7.0 => github.com/raphaelvigee/cobra v0.0.0-20221020122344-217ca52feee0

require (
cloud.google.com/go/storage v1.34.1
github.com/Khan/genqlient v0.6.0
github.com/aarondl/json v0.0.0-20221020222930-8b0db17ef1bf
github.com/aarondl/opt v0.0.0-20230313190023-85d93d668fec
Expand All @@ -18,24 +17,28 @@ require (
github.com/charmbracelet/bubbletea v0.26.2
github.com/charmbracelet/lipgloss v0.9.1
github.com/coreos/go-semver v0.3.1
github.com/creack/pty v1.1.20
github.com/creack/pty v1.1.24
github.com/dlsniper/debugger v0.6.0
github.com/fsnotify/fsnotify v1.7.0
github.com/google/uuid v1.4.0
github.com/fsnotify/fsnotify v1.9.0
github.com/google/uuid v1.6.0
github.com/heimdalr/dag v1.3.1
github.com/hinshun/vt10x v0.0.0-20220301184237-5011da428d02
github.com/itchyny/gojq v0.12.13
github.com/lithammer/fuzzysearch v1.1.8
github.com/mattn/go-isatty v0.0.20
github.com/mitchellh/go-homedir v1.1.0
github.com/muesli/reflow v0.3.0
github.com/muesli/termenv v0.15.2
github.com/muesli/termenv v0.16.0
github.com/olekukonko/tablewriter v0.0.5
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
github.com/shirou/gopsutil/v3 v3.23.10
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
github.com/spf13/cobra v1.10.1
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.10.0
github.com/tliron/commonlog v0.2.21
github.com/tliron/glsp v0.2.2
github.com/tree-sitter/go-tree-sitter v0.25.0
github.com/tree-sitter/tree-sitter-python v0.25.0
github.com/viney-shih/go-lock v1.1.2
github.com/vmihailenco/msgpack/v5 v5.4.1
github.com/zeebo/xxh3 v1.0.2
Expand All @@ -46,18 +49,17 @@ require (
go.starlark.net v0.0.0-20231101134539-556fd59b42f6
go.uber.org/multierr v1.11.0
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
golang.org/x/net v0.17.0
golang.org/x/sys v0.20.0
golang.org/x/term v0.20.0
google.golang.org/api v0.149.0
golang.org/x/net v0.43.0
golang.org/x/sys v0.36.0
golang.org/x/term v0.35.0
gopkg.in/yaml.v3 v3.0.1
)

require (
cloud.google.com/go v0.110.10 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/compute/metadata v0.3.0 // indirect
cloud.google.com/go/iam v1.1.5 // indirect
cloud.google.com/go/storage v1.34.1 // indirect
github.com/RoaringBitmap/roaring v1.6.0 // indirect
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/alexflint/go-arg v1.4.3 // indirect
Expand All @@ -80,10 +82,10 @@ require (
github.com/blevesearch/zapx/v13 v13.3.10 // indirect
github.com/blevesearch/zapx/v14 v14.3.10 // indirect
github.com/blevesearch/zapx/v15 v15.3.13 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect
Expand All @@ -93,6 +95,8 @@ require (
github.com/google/s2a-go v0.1.7 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/itchyny/timefmt-go v0.1.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
Expand All @@ -103,41 +107,47 @@ require (
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-pointer v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/petermattis/goid v0.0.0-20250813065127-a731cc31b4fe // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/sftp v1.13.6 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
github.com/rivo/uniseg v0.4.6 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f // indirect
github.com/sasha-s/go-deadlock v0.3.6 // indirect
github.com/segmentio/ksuid v1.0.4 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/stretchr/objx v0.5.1 // indirect
github.com/sourcegraph/jsonrpc2 v0.2.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/tliron/go-kutil v0.4.0 // indirect
github.com/vektah/gqlparser/v2 v2.5.10 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.14.0 // indirect
golang.org/x/crypto v0.42.0 // indirect
golang.org/x/mod v0.27.0 // indirect
golang.org/x/oauth2 v0.27.0 // indirect
golang.org/x/sync v0.17.0 // indirect
golang.org/x/text v0.29.0 // indirect
golang.org/x/tools v0.36.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/api v0.149.0 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.36.9 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading