Documentation ¶
Index ¶
- func ComputeEdits(before, after string) []types.TextEdit
- func FmtCommand(args []string) types.Command
- func FmtV1Command(args []string) types.Command
- func NewConnectionFromLanguageServer(ctx context.Context, handler ConnectionHandlerFunc, opts *ConnectionOptions) *jsonrpc2.Conn
- func NoWhiteSpaceCommentCommand(args []string) types.Command
- func TokenFoldingRanges(policy string) []types.FoldingRange
- func UseAssignmentOperatorCommand(args []string) types.Command
- type BuiltInCall
- type BuiltinPosition
- type Cache
- func (c *Cache) ClearAggregateDiagnostics()
- func (c *Cache) ClearFileDiagnostics()
- func (c *Cache) Delete(uri string)
- func (c *Cache) GetAggregateDiagnostics(uri string) ([]types.Diagnostic, bool)
- func (c *Cache) GetAllDiagnosticsForURI(uri string) []types.Diagnostic
- func (c *Cache) GetAllFiles() map[string]string
- func (c *Cache) GetAllModules() map[string]*ast.Module
- func (c *Cache) GetBuiltinPositions(uri string) (map[uint][]BuiltinPosition, bool)
- func (c *Cache) GetFileContents(uri string) (string, bool)
- func (c *Cache) GetFileDiagnostics(uri string) ([]types.Diagnostic, bool)
- func (c *Cache) GetModule(uri string) (*ast.Module, bool)
- func (c *Cache) GetParseErrors(uri string) ([]types.Diagnostic, bool)
- func (c *Cache) SetAggregateDiagnostics(uri string, diags []types.Diagnostic)
- func (c *Cache) SetBuiltinPositions(uri string, positions map[uint][]BuiltinPosition)
- func (c *Cache) SetFileContents(uri string, content string)
- func (c *Cache) SetFileDiagnostics(uri string, diags []types.Diagnostic)
- func (c *Cache) SetModule(uri string, module *ast.Module)
- func (c *Cache) SetParseErrors(uri string, diags []types.Diagnostic)
- type ConnectionHandlerFunc
- type ConnectionLoggingConfig
- type ConnectionOptions
- type HoverResponse
- type LanguageServer
- func (l *LanguageServer) Handle(ctx context.Context, conn *jsonrpc2.Conn, req *jsonrpc2.Request) (result any, err error)
- func (l *LanguageServer) SetConn(conn *jsonrpc2.Conn)
- func (l *LanguageServer) StartCommandWorker(ctx context.Context)
- func (l *LanguageServer) StartConfigWorker(ctx context.Context)
- func (l *LanguageServer) StartDiagnosticsWorker(ctx context.Context)
- func (l *LanguageServer) StartHoverWorker(ctx context.Context)
- type LanguageServerOptions
- type OpKind
- type StdOutReadWriteCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeEdits ¶ added in v0.21.0
ComputeEdits computes diff edits from 2 string inputs.
func FmtCommand ¶ added in v0.21.0
func FmtV1Command ¶ added in v0.21.0
func NewConnectionFromLanguageServer ¶ added in v0.21.0
func NewConnectionFromLanguageServer( ctx context.Context, handler ConnectionHandlerFunc, opts *ConnectionOptions, ) *jsonrpc2.Conn
func NoWhiteSpaceCommentCommand ¶ added in v0.21.0
func TokenFoldingRanges ¶ added in v0.21.0
func TokenFoldingRanges(policy string) []types.FoldingRange
func UseAssignmentOperatorCommand ¶ added in v0.21.0
Types ¶
type BuiltInCall ¶ added in v0.20.0
func AllBuiltinCalls ¶ added in v0.20.0
func AllBuiltinCalls(module *ast.Module) []BuiltInCall
AllBuiltinCalls returns all built-in calls in the module, excluding operators and any other function identified by an infix.
type BuiltinPosition ¶ added in v0.20.0
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is used to store: current file contents (which includes unsaved changes), the latest parsed modules, and diagnostics for each file (including diagnostics gathered from linting files alongside other files).
func (*Cache) ClearAggregateDiagnostics ¶
func (c *Cache) ClearAggregateDiagnostics()
func (*Cache) ClearFileDiagnostics ¶
func (c *Cache) ClearFileDiagnostics()
func (*Cache) GetAggregateDiagnostics ¶
func (c *Cache) GetAggregateDiagnostics(uri string) ([]types.Diagnostic, bool)
func (*Cache) GetAllDiagnosticsForURI ¶
func (c *Cache) GetAllDiagnosticsForURI(uri string) []types.Diagnostic
func (*Cache) GetAllFiles ¶
func (*Cache) GetBuiltinPositions ¶ added in v0.20.0
func (c *Cache) GetBuiltinPositions(uri string) (map[uint][]BuiltinPosition, bool)
func (*Cache) GetFileDiagnostics ¶
func (c *Cache) GetFileDiagnostics(uri string) ([]types.Diagnostic, bool)
func (*Cache) GetParseErrors ¶
func (c *Cache) GetParseErrors(uri string) ([]types.Diagnostic, bool)
func (*Cache) SetAggregateDiagnostics ¶
func (c *Cache) SetAggregateDiagnostics(uri string, diags []types.Diagnostic)
func (*Cache) SetBuiltinPositions ¶ added in v0.20.0
func (c *Cache) SetBuiltinPositions(uri string, positions map[uint][]BuiltinPosition)
func (*Cache) SetFileContents ¶
func (*Cache) SetFileDiagnostics ¶
func (c *Cache) SetFileDiagnostics(uri string, diags []types.Diagnostic)
func (*Cache) SetParseErrors ¶
func (c *Cache) SetParseErrors(uri string, diags []types.Diagnostic)
type ConnectionHandlerFunc ¶ added in v0.21.0
type ConnectionLoggingConfig ¶ added in v0.21.0
type ConnectionLoggingConfig struct { Writer io.Writer LogInbound bool LogOutbound bool // IncludeMethods is a list of methods to include in the request log. // If empty, all methods are included. IncludeMethods takes precedence // over ExcludeMethods. IncludeMethods []string // ExcludeMethods is a list of methods to exclude from the request log. ExcludeMethods []string }
func (*ConnectionLoggingConfig) ShouldLog ¶ added in v0.21.0
func (cfg *ConnectionLoggingConfig) ShouldLog(method string) bool
type ConnectionOptions ¶ added in v0.21.0
type ConnectionOptions struct {
LoggingConfig ConnectionLoggingConfig
}
type HoverResponse ¶ added in v0.20.0
type HoverResponse struct { Contents types.MarkupContent `json:"contents"` Range types.Range `json:"range"` }
type LanguageServer ¶
type LanguageServer struct {
// contains filtered or unexported fields
}
func NewLanguageServer ¶
func NewLanguageServer(opts *LanguageServerOptions) *LanguageServer
func (*LanguageServer) SetConn ¶
func (l *LanguageServer) SetConn(conn *jsonrpc2.Conn)
func (*LanguageServer) StartCommandWorker ¶ added in v0.21.0
func (l *LanguageServer) StartCommandWorker(ctx context.Context)
func (*LanguageServer) StartConfigWorker ¶ added in v0.21.0
func (l *LanguageServer) StartConfigWorker(ctx context.Context)
func (*LanguageServer) StartDiagnosticsWorker ¶
func (l *LanguageServer) StartDiagnosticsWorker(ctx context.Context)
func (*LanguageServer) StartHoverWorker ¶ added in v0.20.0
func (l *LanguageServer) StartHoverWorker(ctx context.Context)
type LanguageServerOptions ¶
type OpKind ¶ added in v0.21.0
type OpKind int
OpKind is used to denote the type of operation a line represents.
const ( // Delete is the operation kind for a line that is present in the input // but not in the output. Delete OpKind = iota // Insert is the operation kind for a line that is new in the output. Insert // Equal is the operation kind for a line that is the same in the input and // output, often used to provide context around edited lines. Equal )
type StdOutReadWriteCloser ¶
type StdOutReadWriteCloser struct{}
func (StdOutReadWriteCloser) Close ¶
func (StdOutReadWriteCloser) Close() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.