github.com/authzed/spicedb@v1.32.1-0.20240520085336-ebda56537386/internal/lsp/lspdefs.go (about) 1 package lsp 2 3 import ( 4 baselsp "github.com/sourcegraph/go-lsp" 5 ) 6 7 type InitializeResult struct { 8 Capabilities ServerCapabilities `json:"capabilities,omitempty"` 9 } 10 11 type ServerCapabilities struct { 12 TextDocumentSync *baselsp.TextDocumentSyncOptionsOrKind `json:"textDocumentSync,omitempty"` 13 CompletionProvider *baselsp.CompletionOptions `json:"completionProvider,omitempty"` 14 DocumentFormattingProvider bool `json:"documentFormattingProvider,omitempty"` 15 DiagnosticProvider *DiagnosticOptions `json:"diagnosticProvider,omitempty"` 16 HoverProvider bool `json:"hoverProvider,omitempty"` 17 } 18 19 type DiagnosticOptions struct { 20 Identifier string `json:"identifier"` 21 InterFileDependencies bool `json:"interFileDependencies"` 22 WorkspaceDiagnostics bool `json:"workspaceDiagnostics"` 23 } 24 25 type TextDocumentDiagnosticParams struct { 26 Identifier string `json:"identifier"` 27 TextDocument TextDocument `json:"textDocument"` 28 } 29 30 type TextDocument struct { 31 URI baselsp.DocumentURI `json:"uri"` 32 } 33 34 type FullDocumentDiagnosticReport struct { 35 Kind string `json:"kind"` 36 Items []baselsp.Diagnostic `json:"items"` 37 ResultID string `json:"resultId,omitempty"` 38 } 39 40 type InitializeParams struct { 41 ProcessID int `json:"processId,omitempty"` 42 43 // RootPath is DEPRECATED in favor of the RootURI field. 44 RootPath string `json:"rootPath,omitempty"` 45 46 RootURI baselsp.DocumentURI `json:"rootUri,omitempty"` 47 ClientInfo baselsp.ClientInfo `json:"clientInfo,omitempty"` 48 Trace baselsp.Trace `json:"trace,omitempty"` 49 InitializationOptions interface{} `json:"initializationOptions,omitempty"` 50 Capabilities ClientCapabilities `json:"capabilities"` 51 52 WorkDoneToken string `json:"workDoneToken,omitempty"` 53 } 54 55 type ClientCapabilities struct { 56 Diagnostics DiagnosticWorkspaceClientCapabilities `json:"diagnostics,omitempty"` 57 } 58 59 type DiagnosticWorkspaceClientCapabilities struct { 60 // RefreshSupport indicates whether the client supports the new 61 // `textDocument/diagnostic` request. 62 RefreshSupport bool `json:"refreshSupport,omitempty"` 63 } 64 65 type Hover struct { 66 Contents MarkupContent `json:"contents"` 67 Range *baselsp.Range `json:"range,omitempty"` 68 } 69 70 type MarkupContent struct { 71 Kind string `json:"kind,omitempty"` 72 Language string `json:"language,omitempty"` 73 Value string `json:"value"` 74 }