server

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2026 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BASH_BUILTINS = [...]string{
	":",
	".",
	"[",
	"alias",
	"bg",
	"bind",
	"break",
	"builtin",
	"caller",
	"cd",
	"command",
	"compgen",
	"complete",
	"compopt",
	"continue",
	"declare",
	"dirs",
	"disown",
	"echo",
	"enable",
	"eval",
	"exec",
	"exit",
	"export",
	"false",
	"fc",
	"fg",
	"getopts",
	"hash",
	"help",
	"history",
	"jobs",
	"kill",
	"let",
	"local",
	"logout",
	"mapfile",
	"popd",
	"printf",
	"pushd",
	"pwd",
	"read",
	"readarray",
	"readonly",
	"return",
	"set",
	"shift",
	"shopt",
	"source",
	"suspend",
	"test",
	"times",
	"trap",
	"true",
	"type",
	"typeset",
	"ulimit",
	"umask",
	"unalias",
	"unset",
	"wait",
}
View Source
var BASH_KEYWORDS = [...]string{
	"if",
	"then",
	"elif",
	"else",
	"fi",
	"for",
	"in",
	"do",
	"done",
	"case",
	"esac",
	"select",
	"function",
	"{",
	"}",
	"[[",
	"]]",
	"!",
	"time",
	"until",
	"while",
	"coproc",
}
View Source
var SHEBANG = "#!/usr/bin/env bash\n\n"

Functions

This section is empty.

Types

type Config

type Config struct {
	ExcludeDirs            []string
	DiagnosticDebounceTime time.Duration
	ShellCheckOptions      shellcheck.Options
	FormatOptions          FormatOptions
}

type Document

type Document struct {
	Text         string
	SourcedFiles []Document
}

type FormatOptions

type FormatOptions struct {
	BinaryNextLine bool
	CaseIndent     bool
	SpaceRedirects bool
	FuncNextLine   bool
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(name, version string, state State, writer io.Writer) *Server

func (*Server) HandleMessage

func (s *Server) HandleMessage(method string, contents []byte)

func (*Server) Stop

func (s *Server) Stop()

type State

type State struct {
	Documents         map[string]Document
	EnvVars           map[string]string
	WorkspaceFolders  []lsp.WorkspaceFolder
	PathItems         []string
	Config            Config
	ShutdownRequested bool
}

func NewState

func NewState(config Config) State

func (*State) SetDocument

func (s *State) SetDocument(uri, documentText string)

func (*State) WorkspaceShFiles

func (s *State) WorkspaceShFiles() []string

Find sh-files and return their filepaths

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL