File: workspace.go

package info (click to toggle)
golang-golang-x-tools 1%3A0.0~git20190125.d66bd3c%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, buster-backports
  • size: 8,912 kB
  • sloc: asm: 1,394; yacc: 155; makefile: 109; sh: 108; ansic: 17; xml: 11
file content (203 lines) | stat: -rw-r--r-- 3,800 bytes parent folder | download
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// This file contains the corresponding structures to the
// "Workspace" part of the LSP specification.

package protocol

type WorkspaceFolder struct {
	/**
	 * The associated URI for this workspace folder.
	 */
	URI string `json:"uri"`

	/**
	 * The name of the workspace folder. Defaults to the
	 * uri's basename.
	 */
	Name string `json:"name"`
}

type DidChangeWorkspaceFoldersParams struct {
	/**
	 * The actual workspace folder change event.
	 */
	Event WorkspaceFoldersChangeEvent `json:"event"`
}

/**
 * The workspace folder change event.
 */
type WorkspaceFoldersChangeEvent struct {
	/**
	 * The array of added workspace folders
	 */
	Added []WorkspaceFolder `json:"added"`

	/**
	 * The array of the removed workspace folders
	 */
	Removed []WorkspaceFolder `json:"removed"`
}

type DidChangeConfigurationParams struct {
	/**
	 * The actual changed settings
	 */
	Settings interface{} `json:"settings"`
}

type ConfigurationParams struct {
	Items []ConfigurationItem `json:"items"`
}

type ConfigurationItem struct {
	/**
	 * The scope to get the configuration section for.
	 */
	ScopeURI string `json:"scopeURI,omitempty"`

	/**
	 * The configuration section asked for.
	 */
	Section string `json:"section,omitempty"`
}

type DidChangeWatchedFilesParams struct {
	/**
	 * The actual file events.
	 */
	Changes []FileEvent `json:"changes"`
}

/**
 * An event describing a file change.
 */
type FileEvent struct {
	/**
	 * The file's URI.
	 */
	URI DocumentURI `json:"uri"`
	/**
	 * The change type.
	 */
	Type float64 `json:"type"`
}

/**
 * The file event type.
 */
type FileChangeType float64

const (
	/**
	 * The file got created.
	 */
	Created FileChangeType = 1
	/**
	 * The file got changed.
	 */
	Changed FileChangeType = 2
	/**
	 * The file got deleted.
	 */
	Deleted FileChangeType = 3
)

/**
 * Describe options to be used when registering for text document change events.
 */
type DidChangeWatchedFilesRegistrationOptions struct {
	/**
	 * The watchers to register.
	 */
	Watchers []FileSystemWatcher `json:"watchers"`
}

type FileSystemWatcher struct {
	/**
	 * The  glob pattern to watch
	 */
	GlobPattern string `json:"globPattern"`

	/**
	 * The kind of events of interest. If omitted it defaults
	 * to WatchKind.Create | WatchKind.Change | WatchKind.Delete
	 * which is 7.
	 */
	Kind float64 `json:"kind,omitempty"`
}

type WatchKind float64

const (
	/**
	 * Interested in create events.
	 */
	Create WatchKind = 1

	/**
	 * Interested in change events
	 */
	Change WatchKind = 2

	/**
	 * Interested in delete events
	 */
	Delete WatchKind = 4
)

/**
 * The parameters of a Workspace Symbol Request.
 */
type WorkspaceSymbolParams struct {
	/**
	 * A non-empty query string
	 */
	Query string `json:"query"`
}

type ExecuteCommandParams struct {

	/**
	 * The identifier of the actual command handler.
	 */
	Command string `json:"command"`
	/**
	 * Arguments that the command should be invoked with.
	 */
	Arguments []interface{} `json:"arguments,omitempty"`
}

/**
 * Execute command registration options.
 */
type ExecuteCommandRegistrationOptions struct {
	/**
	 * The commands to be executed on the server
	 */
	Commands []string `json:"commands"`
}

type ApplyWorkspaceEditParams struct {
	/**
	 * An optional label of the workspace edit. This label is
	 * presented in the user interface for example on an undo
	 * stack to undo the workspace edit.
	 */
	Label string `json:"label,omitempty"`

	/**
	 * The edits to apply.
	 */
	Edit WorkspaceEdit `json:"edit"`
}

type ApplyWorkspaceEditResponse struct {
	/**
	 * Indicates whether the edit was applied or not.
	 */
	Applied bool `json:"applied"`
}