-
Notifications
You must be signed in to change notification settings - Fork 10
/
lsp_general.go
155 lines (125 loc) · 4.84 KB
/
lsp_general.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
//
// Copyright 2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
package lsp
import (
"go.bug.st/json"
"go.bug.st/lsp/jsonrpc"
)
type InitializeParams struct {
WorkDoneProgressParams
// The process Id of the parent process that started the server. Is null if
// the process has not been started by another process. If the parent
// process is not alive then the server should exit (see exit notification)
// its process.
ProcessID *int `json:"processId,required"`
// Information about the client
//
// @since 3.15.0
ClientInfo *struct {
// The name of the client as defined by the client.
Name string `json:"name,required"`
// The client's version as defined by the client.
Version *string `json:"version,omitempty"`
} `json:"clientInfo,omitempty"`
// The locale the client is currently showing the user interface
// in. This must not necessarily be the locale of the operating
// system.
//
// Uses IETF language tags as the value's syntax
// (See https://en.wikipedia.org/wiki/IETF_language_tag)
//
// @since 3.16.0
Locale *string `json:"locale,omitempty"`
// The rootPath of the workspace. Is null
// if no folder is open.
//
// @deprecated in favour of `rootUri`.
RootPath string `json:"rootPath,omitempty"`
// The rootUri of the workspace. Is null if no
// folder is open. If both `rootPath` and `rootUri` are set
// `rootUri` wins.
//
// @deprecated in favour of `workspaceFolders`
RootURI DocumentURI `json:"rootUri,required"`
// User provided initialization options.
InitializationOptions json.RawMessage `json:"initializationOptions,omitempty"`
// The capabilities provided by the client (editor or tool)
Capabilities ClientCapabilities `json:"capabilities,required"`
// The initial trace setting. If omitted trace is disabled ('off').
Trace *TraceValue `json:"trace,omitempty"`
// The workspace folders configured in the client when the server starts.
// This property is only available if the client supports workspace folders.
// It can be `null` if the client supports workspace folders but none are
// configured.
//
// @since 3.6.0
WorkspaceFolders *[]WorkspaceFolder `json:"workspaceFolders"`
}
type TraceValue string
const TraceValueOff TraceValue = "off"
const TraceValueMessages TraceValue = "messages"
const TraceValueVerbose TraceValue = "verbose"
type WorkspaceFolder struct {
// The associated URI for this workspace folder.
URI DocumentURI `json:"uri,required"`
// The name of the workspace folder. Used to refer to this
// workspace folder in the user interface.
Name string `json:"name,required"`
}
type InitializeResult struct {
// The capabilities the language server provides.
Capabilities ServerCapabilities `json:"capabilities,required"`
// Information about the server.
//
// @since 3.15.0
ServerInfo *InitializeResultServerInfo `json:"serverInfo,omitempty"`
}
type InitializeResultServerInfo struct {
// The name of the server as defined by the server.
Name string `json:"name,required"`
// The server's version as defined by the server.
Version string `json:"version,omitempty"`
}
// InitializeErrorUnknownProtocolVersion If the protocol version provided by the client can't be handled by the
// server.
//
// @deprecated This initialize error got replaced by client capabilities.
// There is no version handshake in version 3.0x
const InitializeErrorUnknownProtocolVersion jsonrpc.ErrorCode = 1
type InitializeError struct {
// Indicates whether the client execute the following retry logic:
// (1) show the message provided by the ResponseError to the user
// (2) user selects retry or cancel
// (3) if user selected retry the initialize method is sent again.
Retry bool `json:"retry,required"`
}
// InitializedParams The initialized notification is sent from the client
// to the server after the client received the result of the initialize
// equest but before the client is sending any other request or notification
// to the server. The server can use the initialized notification for
// example to dynamically register capabilities. The initialized
// notification may only be sent once.
type InitializedParams struct{}
type LogTraceParams struct {
// The message to be logged.
Message string `json:"message,required"`
// Additional information that can be computed if the `trace` configuration
// is set to `'verbose'`
Verbose *string `json:"verbose,omitempty"`
}
type SetTraceParams struct {
// The new value that should be assigned to the trace setting.
Value TraceValue `json:"value,required"`
}
type ConfigurationParams struct {
Items []ConfigurationItem `json:"items,required"`
}
type ConfigurationItem struct {
// The scope to get the configuration section for.
ScopeURI DocumentURI `json:"scopeUri,omitempty"`
// The configuration section asked for.
Section string `json:"section,omitempty"`
}