Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added terraform-ls #1325

Merged
merged 1 commit into from
Sep 29, 2022
Merged
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
23 changes: 23 additions & 0 deletions completers/terraform-ls_completer/cmd/inspectModule.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var inspectModuleCmd = &cobra.Command{
Use: "inspect-module",
Short: "Lists available debug items",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(inspectModuleCmd).Standalone()
inspectModuleCmd.Flags().BoolS("verbose", "verbose", false, "whether to enable verbose output")

rootCmd.AddCommand(inspectModuleCmd)

carapace.Gen(inspectModuleCmd).PositionalCompletion(
carapace.ActionFiles(),
)
}
23 changes: 23 additions & 0 deletions completers/terraform-ls_completer/cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
Use: "terraform-ls",
Short: "Terraform Language Server",
Long: "https://github.com/hashicorp/terraform-ls",
Run: func(cmd *cobra.Command, args []string) {},
}

func Execute() error {
return rootCmd.Execute()
}
func init() {
carapace.Gen(rootCmd).Standalone()

rootCmd.Flags().BoolP("version", "v", false, "show version")
rootCmd.PersistentFlags().BoolP("help", "h", false, "show help")
}
31 changes: 31 additions & 0 deletions completers/terraform-ls_completer/cmd/serve.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/pkg/actions/net"
"github.com/spf13/cobra"
)

var serveCmd = &cobra.Command{
Use: "serve",
Short: "Starts the Language Server",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(serveCmd).Standalone()

serveCmd.Flags().StringS("cpuprofile", "cpuprofile", "", "file into which to write CPU profile")
serveCmd.Flags().StringS("log-file", "log-file", "", "path to a file to log into with support for variables")
serveCmd.Flags().StringS("memprofile", "memprofile", "", "file into which to write memory profile")
serveCmd.Flags().StringS("port", "port", "", "port number to listen on")
serveCmd.Flags().StringS("req-concurrency", "req-concurrency", "", "number of RPC requests to process concurrently")
rootCmd.AddCommand(serveCmd)

carapace.Gen(serveCmd).FlagCompletion(carapace.ActionMap{
"cpuprofile": carapace.ActionFiles(),
"log-file": carapace.ActionFiles(),
"memprofile": carapace.ActionFiles(),
"port": net.ActionPorts(),
})
}
19 changes: 19 additions & 0 deletions completers/terraform-ls_completer/cmd/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var versionCmd = &cobra.Command{
Use: "version",
Short: "Displays the version of the language server",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(versionCmd).Standalone()
versionCmd.Flags().BoolS("json", "json", false, "output the version information as a JSON object")

rootCmd.AddCommand(versionCmd)
}
7 changes: 7 additions & 0 deletions completers/terraform-ls_completer/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/rsteube/carapace-bin/completers/terraform-ls_completer/cmd"

func main() {
cmd.Execute()
}