Documentation ¶
Index ¶
Constants ¶
const ( SeverityErr = Severity(protocol.SeverityError) SeverityWarn = Severity(protocol.SeverityWarning) SeverityInfo = Severity(protocol.SeverityInformation) SeverityHint = Severity(protocol.SeverityHint) )
const ( DiagnosticTextPropID = 0 ReferencesTextPropID = 1 )
Variables ¶
var SeverityHighlight = map[Severity]config.Highlight{ SeverityErr: config.HighlightErr, SeverityWarn: config.HighlightWarn, SeverityInfo: config.HighlightInfo, SeverityHint: config.HighlightHint, }
SeverityHighlight returns corresponding highlight name for a severity.
var SeverityHoverHighlight = map[Severity]config.Highlight{ SeverityErr: config.HighlightHoverErr, SeverityWarn: config.HighlightHoverWarn, SeverityInfo: config.HighlightHoverInfo, SeverityHint: config.HighlightHoverHint, }
SeverityHoverHighlight returns corresponding hover highlight name for a severity.
var SeverityPriority = map[Severity]int{ SeverityErr: 14, SeverityWarn: 12, SeverityInfo: 10, SeverityHint: 8, }
SeverityPriority is used when placing signs and text property highlights. Values are based on the default value for signs, 10.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct { Num int Name string Version int32 // Listener is the ID of the listener for the buffer. Listeners number from // 1 so the zero value indicates this buffer does not have a listener. Listener int // Loaded reflects vim's "loaded" buffer state. See :help bufloaded() for details. Loaded bool // Fset is the fileset used in parsing the buffer contents. Access to Fset // must be guarded by a receive on ASTWait. Fset *token.FileSet // AST is the parsed result of the Buffer. Access to Fset must be guarded by // a receive on ASTWait. AST *ast.File // ASTWait is used to sychronise access to AST and Fset. ASTWait chan bool // contains filtered or unexported fields }
A Buffer is govim's representation of the current state of a buffer in Vim i.e. it is versioned.
TODO: we need to reflect somehow whether a buffer is file-based or not. A preview window is not, for example.
func (*Buffer) Contents ¶
Contents returns a Buffer's contents. These contents must not be mutated. To update a Buffer's contents, call SetContents
func (*Buffer) SetContents ¶
SetContents updates a Buffer's contents to byts
func (*Buffer) ToTextDocumentIdentifier ¶
func (b *Buffer) ToTextDocumentIdentifier() protocol.TextDocumentIdentifier
ToTextDocumentIdentifier converts b to a protocol.TextDocumentIdentifier
type CursorPosition ¶ added in v0.0.31
type CursorPosition struct { *Point BufNr int WinNr int WinID int ScreenRow int ScreenCol int ScreenEndCol int ScreenCursCol int }
CursorPosition represents a cursor position within a window
type Diagnostic ¶ added in v0.0.25
type Diagnostic struct { Filename string Source string Range Range Text string Buf int Severity Severity }
Diagnostic is the govim internal representation of a LSP diagnostic, used to populate quickfix list, place signs, highlight text ranges etc.
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
Point represents a position within a Buffer
func VisualPointFromPosition ¶ added in v0.0.27
func (Point) Col ¶
Col refers to the byte index (1-based) in Line() in the buffer. This is often referred to as the column number, but is definitely not the visual column as seen on screen. This is how Vim refers to column positions.
func (Point) GoplsLine ¶
GoplsLine is the 0-index line in the buffer, returned as a float64 value. This is how gopls refers to lines.
func (Point) Line ¶
Line refers to the 1-indexed line in the buffer. This is how Vim refers to line numbers.
func (Point) ToPosition ¶
ToPosition converts p to a protocol.Position
type PopupLine ¶ added in v0.0.32
PopupLine is the internal representation of a single text line with text propertiesin a vim popup. When creating popups using popup_create, the first arg can be either a buffer number, a string, a list of strings or a list of text lines with text properties.
type PopupProp ¶ added in v0.0.32
PopupProp is the internal representation of a single text property used in a popup line. It describes where on that line the property begin (where Col is 1-indexed) and the length. Type must be an existing text property type (defined by calling prop_type_add in vim).
type ProgressInitiator ¶ added in v0.0.33
type ProgressInitiator string
const ( GoTest ProgressInitiator = "GoTest" WorkDoneProgressCreate ProgressInitiator = "WorkDoneProgressCreate" )
type ProgressPopup ¶ added in v0.0.32
type ProgressPopup struct { ID int Text strings.Builder LinePos int Initiator ProgressInitiator }
ProgressPopup represents a vim popup placed in the upper right corner used to show LSP progress. LinePos is used to stack multiple visible progress popups. Initiator is a optional field used to describe who initiated this progress (if known), e.g. "GoTest" when running GOVIMGoTest. This allow us to handle text from different commands to be handled differently (or even suppressed).
type Severity ¶ added in v0.0.25
type Severity int
Severity is the govim internal representation of the LSP DiagnosticSeverites
type TextPropID ¶ added in v0.0.28
type TextPropID int
TextPropID is the govim internal mapping of ID used when adding/removing text properties
type WatchedFile ¶
A WatchedFile is a file we are watching but that is not loaded as a buffer in Vim
func (*WatchedFile) URI ¶
func (w *WatchedFile) URI() span.URI