Documentation
¶
Overview ¶
Package buflsp implements a language server for Protobuf.
The main entry-point of this package is the Serve() function, which creates a new LSP server.
Index ¶
Constants ¶
const CommandCheckPluginUpdates = "buf.generate.checkPluginUpdates"
CommandCheckPluginUpdates is the LSP workspace command to check for newer versions of remote plugins in a buf.gen.yaml file and publish informational diagnostics for any that are outdated.
const CommandRunGenerate = "buf.generate.run"
CommandRunGenerate is the LSP workspace command to run buf generate for a buf.gen.yaml file.
Variables ¶
This section is empty.
Functions ¶
func FilePathToURI ¶ added in v1.66.0
FilePathToURI converts a file path to a properly encoded URI.
func Serve ¶
func Serve( ctx context.Context, bufVersion string, wktBucket storage.ReadBucket, container appext.Container, controller bufctl.Controller, wasmRuntime wasm.Runtime, stream jsonrpc2.Stream, queryExecutor *incremental.Executor, moduleKeyProvider bufmodule.ModuleKeyProvider, graphProvider bufmodule.GraphProvider, curatedPluginVersionProvider CuratedPluginVersionProvider, options ...ServeOption, ) (jsonrpc2.Conn, error)
Serve spawns a new LSP server, listening on the given stream.
Returns a context for managing the server.
Types ¶
type CuratedPluginVersionProvider ¶ added in v1.69.0
type CuratedPluginVersionProvider interface {
// GetLatestVersion returns the latest semver version string for the plugin,
// or an empty string if the plugin is unknown or has no published versions.
GetLatestVersion(ctx context.Context, registry, owner, plugin string) (string, error)
}
CuratedPluginVersionProvider checks for the latest version of a BSR-hosted curated plugin.
type ServeOption ¶ added in v1.74.0
type ServeOption func(*lsp)
ServeOption is an option for Serve.
func WithConfigOverride ¶ added in v1.74.0
func WithConfigOverride(configOverride string) ServeOption
WithConfigOverride sets the buf.yaml file or data used to configure every workspace, in place of any buf.yaml found on disk.
When set, workspaces are resolved from the client's workspace root folder containing the file, matching the behavior of the --config flag on other commands run from that folder.
Source Files
¶
- buf_gen_yaml.go
- buf_gen_yaml_completion.go
- buf_gen_yaml_hover.go
- buf_lock.go
- buf_lock_hover.go
- buf_policy_yaml.go
- buf_policy_yaml_completion.go
- buf_policy_yaml_hover.go
- buf_yaml.go
- buf_yaml_completion.go
- buf_yaml_hover.go
- buflsp.go
- builtin.go
- cel.go
- completion.go
- completion_cel.go
- definition_cel.go
- deprecate.go
- diagnostic.go
- document_link.go
- file.go
- file_manager.go
- folding_range.go
- hover_cel.go
- image.go
- jsonrpc_wrappers.go
- lint_ignore.go
- nyi.go
- organize_imports.go
- reference_index.go
- semantic_tokens.go
- semantic_tokens_cel.go
- server.go
- symbol.go
- uri.go
- usage.gen.go
- workspace.go