Documentation
¶
Index ¶
- Constants
- type ClientCapabilities
- type DiagnosticClientCapabilities
- type DiagnosticOptions
- type DiagnosticRegistrationOptions
- type DiagnosticServerCancellationData
- type DocumentDiagnosticParams
- type DocumentDiagnosticReport
- type DocumentDiagnosticReportKind
- type DocumentDiagnosticReportPartialResult
- type FullDocumentDiagnosticReport
- type Handler
- type InitializeFunc
- type InitializeParams
- type InitializeResult
- type RelatedFullDocumentDiagnosticReport
- type RelatedUnchangedDocumentDiagnosticReport
- type ServerCapabilities
- type TextDocumentClientCapabilities
- type TextDocumentDiagnosticFunc
- type UnchangedDocumentDiagnosticReport
Constants ¶
View Source
const ( /** * A diagnostic report with a full * set of problems. */ DocumentDiagnosticReportKindFull = DocumentDiagnosticReportKind("full") /** * A report indicating that the last * returned report is still accurate. */ DocumentDiagnosticReportKindUnchanged = DocumentDiagnosticReportKind("unchanged") )
View Source
const MethodInitialize = protocol316.Method("initialize")
View Source
const MethodTextDocumentDiagnostic = protocol316.Method("textDocument/diagnostic")
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientCapabilities ¶
type ClientCapabilities struct {
protocol316.ClientCapabilities
TextDocument *TextDocumentClientCapabilities `json:"textDocument,omitempty"`
}
type DiagnosticClientCapabilities ¶
type DiagnosticClientCapabilities struct {
/**
* Whether implementation supports dynamic registration. If this is set to
* `true` the client supports the new
* `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
* return value for the corresponding server capability as well.
*/
DynamicRegistration bool `json:"dynamicRegistration"`
/**
* Whether the clients supports related documents for document diagnostic
* pulls.
*/
RelatedDocumentSupport bool `json:"relatedDocumentSupport"`
}
*
- Client capabilities specific to diagnostic pull requests. *
- @since 3.17.0
type DiagnosticOptions ¶
type DiagnosticOptions struct {
protocol316.WorkDoneProgressOptions
/**
* An optional identifier under which the diagnostics are
* managed by the client.
*/
Identifier *string `json:"identifier"`
/**
* Whether the language has inter file dependencies meaning that
* editing code in one file can result in a different diagnostic
* set in another file. Inter file dependencies are common for
* most programming languages and typically uncommon for linters.
*/
InterFileDependencies bool `json:"interFileDependencies"`
/**
* The server provides support for workspace diagnostics as well.
*/
WorkspaceDiagnostics bool `json:"workspaceDiagnostics"`
}
*
- Diagnostic options. *
- @since 3.17.0
type DiagnosticRegistrationOptions ¶
type DiagnosticRegistrationOptions struct {
protocol316.TextDocumentRegistrationOptions
DiagnosticOptions
protocol316.StaticRegistrationOptions
}
*
- Diagnostic registration options. *
- @since 3.17.0
type DiagnosticServerCancellationData ¶
type DiagnosticServerCancellationData struct {
RetriggerRequest bool `json:"retriggerRequest"`
}
*
- Cancellation data returned from a diagnostic request. *
- @since 3.17.0
type DocumentDiagnosticParams ¶
type DocumentDiagnosticParams struct {
protocol316.WorkDoneProgressParams
protocol316.PartialResultParams
/**
* The text document.
*/
TextDocument protocol316.TextDocumentIdentifier `json:"textDocument"`
/**
* The additional identifier provided during registration.
*/
Identifier *string `json:"identifier,omitempty"`
/**
* The result id of a previous response if provided.
*/
PreviousResultId *string `json:"previousResultId,omitempty"`
}
*
- Parameters of the document diagnostic request. *
- @since 3.17.0
type DocumentDiagnosticReport ¶
type DocumentDiagnosticReport any // RelatedFullDocumentDiagnosticReport | RelatedUnchangedDocumentDiagnosticReport
*
- The result of a document diagnostic pull request. A report can
- either be a full report containing all diagnostics for the
- requested document or a unchanged report indicating that nothing
- has changed in terms of diagnostics in comparison to the last
- pull request. *
- @since 3.17.0
type DocumentDiagnosticReportKind ¶
type DocumentDiagnosticReportKind string
*
- The document diagnostic report kinds. *
- @since 3.17.0
type DocumentDiagnosticReportPartialResult ¶
type DocumentDiagnosticReportPartialResult struct {
RelatedDocuments map[protocol316.DocumentUri]interface{} `json:"relatedDocuments"`
}
*
- A partial result for a document diagnostic report. *
- @since 3.17.0
type FullDocumentDiagnosticReport ¶
type FullDocumentDiagnosticReport struct {
/**
* A full document diagnostic report.
*/
Kind string `json:"kind"`
/**
* An optional result id. If provided it will
* be sent on the next diagnostic request for the
* same document.
*/
ResultID *string `json:"resultId,omitempty"`
/**
* The actual items.
*/
Items []protocol316.Diagnostic `json:"items"`
}
*
- A diagnostic report with a full set of problems. *
- @since 3.17.0
type Handler ¶
type Handler struct {
protocol316.Handler
Initialize InitializeFunc
TextDocumentDiagnostic TextDocumentDiagnosticFunc
// contains filtered or unexported fields
}
func (*Handler) CreateServerCapabilities ¶
func (self *Handler) CreateServerCapabilities() ServerCapabilities
func (*Handler) IsInitialized ¶
func (*Handler) SetInitialized ¶
type InitializeFunc ¶
type InitializeFunc func(context *glsp.Context, params *InitializeParams) (any, error)
Returns: InitializeResult | InitializeError
type InitializeParams ¶
type InitializeParams struct {
protocol316.InitializeParams
/**
* The capabilities provided by the client (editor or tool)
*/
Capabilities ClientCapabilities `json:"capabilities"`
}
type InitializeResult ¶
type InitializeResult struct {
/**
* The capabilities the language server provides.
*/
Capabilities ServerCapabilities `json:"capabilities"`
/**
* Information about the server.
*
* @since 3.15.0
*/
ServerInfo *protocol316.InitializeResultServerInfo `json:"serverInfo,omitempty"`
}
type RelatedFullDocumentDiagnosticReport ¶
type RelatedFullDocumentDiagnosticReport struct {
FullDocumentDiagnosticReport
/**
* Diagnostics of related documents. This information is useful
* in programming languages where code in a file A can generate
* diagnostics in a file B which A depends on. An example of
* such a language is C/C++ where marco definitions in a file
* a.cpp and result in errors in a header file b.hpp.
*
* @since 3.17.0
*/
RelatedDocuments map[protocol316.DocumentUri]interface{} `json:"relatedDocuments,omitempty"`
}
*
- A full diagnostic report with a set of related documents. *
- @since 3.17.0
type RelatedUnchangedDocumentDiagnosticReport ¶
type RelatedUnchangedDocumentDiagnosticReport struct {
UnchangedDocumentDiagnosticReport
/**
* Diagnostics of related documents. This information is useful
* in programming languages where code in a file A can generate
* diagnostics in a file B which A depends on. An example of
* such a language is C/C++ where marco definitions in a file
* a.cpp and result in errors in a header file b.hpp.
*
* @since 3.17.0
*/
RelatedDocuments map[protocol316.DocumentUri]interface{} `json:"relatedDocuments,omitempty"`
}
*
- An unchanged diagnostic report with a set of related documents. *
- @since 3.17.0
type ServerCapabilities ¶
type ServerCapabilities struct {
protocol316.ServerCapabilities
/**
* The server has support for pull model diagnostics.
*
* @since 3.17.0
*/
DiagnosticProvider any `json:"diagnosticProvider,omitempty"` // nil | DiagnosticOptions | DiagnosticRegistrationOptions
}
func (*ServerCapabilities) UnmarshalJSON ¶
func (self *ServerCapabilities) UnmarshalJSON(data []byte) error
type TextDocumentClientCapabilities ¶
type TextDocumentClientCapabilities struct {
protocol316.TextDocumentClientCapabilities
/**
* Capabilities specific to the diagnostic pull model.
*
* @since 3.17.0
*/
Diagnostic *DiagnosticClientCapabilities `json:"diagnostic,omitempty"`
}
*
- Text document specific client capabilities.
type TextDocumentDiagnosticFunc ¶
type TextDocumentDiagnosticFunc func(context *glsp.Context, params *DocumentDiagnosticParams) (any, error)
type UnchangedDocumentDiagnosticReport ¶
type UnchangedDocumentDiagnosticReport struct {
/**
* A document diagnostic report indicating
* no changes to the last result. A server can
* only return `unchanged` if result ids are
* provided.
*/
Kind string `json:"kind"`
/**
* A result id which will be sent on the next
* diagnostic request for the same document.
*/
ResultID string `json:"resultId"`
}
*
- A diagnostic report indicating that the last returned
- report is still accurate. *
- @since 3.17.0
Click to show internal directories.
Click to hide internal directories.