Skip to content

Commit

Permalink
Add gnopls serve cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
harry-hov committed Sep 22, 2023
1 parent 40ac8b4 commit 3d14f2b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package cmd

import (
"fmt"
"log/slog"
Expand All @@ -20,6 +21,7 @@ func GnoplsCmd() *cobra.Command {
}

cmd.CompletionOptions.DisableDefaultCmd = true
cmd.AddCommand(CmdServe())
cmd.AddCommand(CmdVersion())

return cmd
Expand Down
24 changes: 24 additions & 0 deletions cmd/serve.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cmd

import (
"log/slog"
"github.com/spf13/cobra"
)

func CmdServe() *cobra.Command {
var gnoroot string
cmd := &cobra.Command{
Use: "serve",
Short: "Run a server for Gno code using the Language Server Protocol",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
slog.Info("Initializing Server...")

return nil
},
}

cmd.Flags().StringVarP(&gnoroot, "gnoroot", "", "", "specify the GNOROOT")

return cmd
}

0 comments on commit 3d14f2b

Please sign in to comment.