Documentation ¶
Overview ¶
Runs a Language Server Protocol (LSP) server ready to comminicate with any editor/IDE.
This command is not intended to be invoked by end-users directly. Instead respective editor plugins will manage the instances of LSP server as needed.
Index ¶
- func NewLSPCmd() *cobra.Command
- func WriteOverlay(underlying fs.ReadDirFS) *writeOverlay
- type FnWorkspace
- func (ws *FnWorkspace) AbsPathForPkgName(ctx context.Context, pkgName string) (string, error)
- func (ws *FnWorkspace) AbsRoot() string
- func (ws *FnWorkspace) EvalPackage(ctx context.Context, pkgName string) (cue.Value, error)
- func (ws *FnWorkspace) FS() fs.ReadDirFS
- func (ws *FnWorkspace) PkgNameInMainModule(relPath string) string
- func (ws *FnWorkspace) SnapshotDir(ctx context.Context, pkgname schema.PackageName, opts memfs.SnapshotOpts) (*fncue.PackageContents, error)
- type OpenFiles
- func (of *OpenFiles) DidChange(params *protocol.DidChangeTextDocumentParams) (err error)
- func (of *OpenFiles) DidClose(params *protocol.DidCloseTextDocumentParams) (err error)
- func (of *OpenFiles) DidOpen(params *protocol.DidOpenTextDocumentParams) (err error)
- func (of *OpenFiles) Read(uri protocol.URI) (Snapshot, error)
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteOverlay ¶
Types ¶
type FnWorkspace ¶
type FnWorkspace struct {
// contains filtered or unexported fields
}
Represents an Fn workspace with its partially-parsed Cue files. An Fn workspace is rooted in a directory with a `workspace.ns.textpb“ file. There may be multiple FnWorkspace's in an editor workspace. Roughly corresponds to a parsing.Root, schema.Workspace and [loader.PackageLoader].
func (*FnWorkspace) AbsPathForPkgName ¶
Real filesystem path for the package name (example.com/module/package/file.cue). Supports external modules and may download them on-demand (hence [ctx]).
func (*FnWorkspace) AbsRoot ¶
func (ws *FnWorkspace) AbsRoot() string
func (*FnWorkspace) EvalPackage ¶
func (*FnWorkspace) FS ¶
func (ws *FnWorkspace) FS() fs.ReadDirFS
func (*FnWorkspace) PkgNameInMainModule ¶
func (ws *FnWorkspace) PkgNameInMainModule(relPath string) string
Take a relative path (package/file.cue) and returns a fully-qualified package name (example.com/module/package/file.cue) within the main workspace module.
func (*FnWorkspace) SnapshotDir ¶
func (ws *FnWorkspace) SnapshotDir(ctx context.Context, pkgname schema.PackageName, opts memfs.SnapshotOpts) (*fncue.PackageContents, error)
type OpenFiles ¶
type OpenFiles struct {
// contains filtered or unexported fields
}
Implements LSP document sync protocol to maintain a view into currently open files. For the open files the authoritative content is stored in the editor memory instead of the filesystem. TODO: Implement delta sync.
func NewOpenFiles ¶
func NewOpenFiles() *OpenFiles
func (*OpenFiles) DidChange ¶
func (of *OpenFiles) DidChange(params *protocol.DidChangeTextDocumentParams) (err error)
func (*OpenFiles) DidClose ¶
func (of *OpenFiles) DidClose(params *protocol.DidCloseTextDocumentParams) (err error)