Documentation
¶
Overview ¶
Package entity contains the domain logic for the ulsp-daemon service.
Index ¶
Constants ¶
const MonorepoConfigKey = "monorepos"
MonorepoConfigKey is the key that contains monorepo specific configuration.
const SessionContextKey keyType = "SessionUUID"
SessionContextKey indicates the key to be used to identify the session UUID in the context.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientName ¶
type ClientName string
ClientName identifies the name that the will be set in the initialization parameters for a given client.
const ( // ClientNameVSCode is the name of the VSCode client. ClientNameVSCode ClientName = "Visual Studio Code" // ClientNameCursor is the name of the Cursor client. ClientNameCursor ClientName = "Cursor" )
func (ClientName) IsVSCodeBased ¶
func (c ClientName) IsVSCodeBased() bool
IsVSCodeBased returns true if the client is a VS Code based client.
type FormatterConfig ¶
type FormatterConfig struct {
// Relative path within the monorepo to the formatter to be run.
BinaryPath string `yaml:"binaryPath"`
// Language (e.g. Go) which will be matched based on TextDocumentIdentifier.
Language protocol.LanguageIdentifier `yaml:"language"`
// Glob patterns to be used for selecting relevant files.
FilterPatterns []string `yaml:"filterPatterns"`
}
FormatterConfig configures a formatter to be run based on language and filter patterns. If a document matches multiple patterns, multiple formatters will be run in the order listed.
type MonorepoConfigEntry ¶
type MonorepoConfigEntry struct {
Bazel string `yaml:"bazel"`
Aspects []string `yaml:"aspects"`
Scip ScipConfig `yaml:"scip"`
ProjectViewPaths []string `yaml:"projectViewPaths"`
BSPVersionOverride string `yaml:"bspVersionOverride"`
Formatters []FormatterConfig `yaml:"formatters"`
Languages []string `yaml:"languages"`
BuildEnvOverrides []string `yaml:"buildEnvOverrides"`
RegistryFeatureFlags map[string]bool `yaml:"registryFeatureFlags"`
}
MonorepoConfigEntry defines the properties and types of each config entry
func (MonorepoConfigEntry) EnableJavaSupport ¶
func (mce MonorepoConfigEntry) EnableJavaSupport() bool
func (MonorepoConfigEntry) EnableScalaSupport ¶
func (mce MonorepoConfigEntry) EnableScalaSupport() bool
type MonorepoConfigs ¶
type MonorepoConfigs map[MonorepoName]MonorepoConfigEntry
MonorepoConfigs contain the config entries that differ between monorepos
func (MonorepoConfigs) RelevantJavaRepos ¶
func (configs MonorepoConfigs) RelevantJavaRepos() map[MonorepoName]struct{}
func (MonorepoConfigs) RelevantScalaRepos ¶
func (configs MonorepoConfigs) RelevantScalaRepos() map[MonorepoName]struct{}
type ScipConfig ¶
type ScipConfig struct {
LoadFromBazel bool `yaml:"loadFromBazel"`
LoadFromDirectories bool `yaml:"loadFromDirectories"`
Directories []string `yaml:"directories"`
}
ScipConfig configures enabled SCIP features
type Session ¶
type Session struct {
UUID uuid.UUID `json:"uuid" zap:"uuid"`
InitializeParams *protocol.InitializeParams `json:"-" zap:"-"`
Conn *jsonrpc2.Conn `json:"-" zap:"-"`
WorkspaceRoot string `json:"workspaceRoot" zap:"workspaceRoot"`
Monorepo MonorepoName `json:"monorepo" zap:"monorepo"`
Env []string `json:"-" zap:"-"`
UlspEnabled bool `json:"ulspEnabled" zap:"ulspEnabled"`
}
Session entity representing a single IDE session.
type TextDocumentIdenfitierWithSession ¶
type TextDocumentIdenfitierWithSession struct {
Document protocol.TextDocumentIdentifier
SessionUUID uuid.UUID
}
TextDocumentIdenfitierWithSession is a wrapper around TextDocumentIdentifier to include the session UUID.
type UlspDaemon ¶
type UlspDaemon struct {
Name string `json:"name" zap:"name"`
UUID uuid.UUID `json:"uuid" zap:"uuid"`
}
UlspDaemon placeholder entity.
func (*UlspDaemon) RequestKey ¶
func (f *UlspDaemon) RequestKey() string
RequestKey implements logger.RequestMarshaler.
func (*UlspDaemon) ResponseKey ¶
func (f *UlspDaemon) ResponseKey() string
ResponseKey implements logger.ResponseMarshaler.