forked from bugst/go-lsp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
lsp_window.go
86 lines (67 loc) · 2.3 KB
/
lsp_window.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
//
// 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
type ShowMessageParams struct {
// The message type. See {@link MessageType}.
Type MessageType `json:"type,required"`
// The actual message.
Message string `json:"message,required"`
}
type MessageType int
// MessageTypeError An error message.
const MessageTypeError MessageType = 1
// MessageTypeWarning A warning message.
const MessageTypeWarning MessageType = 2
// MessageTypeInfo An information message.
const MessageTypeInfo MessageType = 3
// MessageTypeLog A log message.
const MessageTypeLog MessageType = 4
type ShowMessageRequestParams struct {
// The message type. See {@link MessageType}
Type MessageType `json:"type,required"`
// The actual message
Message string `json:"message,required"`
// The message action items to present.
Actions []MessageActionItem `json:"actions,omitempty"`
}
type MessageActionItem struct {
// A short title like 'Retry', 'Open Log' etc.
Title string `json:"title,required"`
}
// ShowDocumentParams Params to show a document.
//
// @since 3.16.0
type ShowDocumentParams struct {
// The document uri to show.
URI URI `json:"uri,omitempty"`
// Indicates to show the resource in an external program.
// To show for example `https://code.visualstudio.com/`
// in the default WEB browser set `external` to `true`.
External bool `json:"external,omitempty"`
// An optional property to indicate whether the editor
// showing the document should take focus or not.
// Clients might ignore this property if an external
// program is started.
TakeFocus bool `json:"takeFocus,omitempty"`
// An optional selection range if the document is a text
// document. Clients might ignore the property if an
// external program is started or the file is not a text
// file.
Selection Range `json:"selection,omitempty"`
}
// ShowDocumentResult The result of an show document request.
//
// @since 3.16.0
type ShowDocumentResult struct {
// A boolean indicating if the show was successful.
Success bool `json:"success,required"`
}
type LogMessageParams struct {
// The message type. See {@link MessageType}
Type MessageType `json:"type,required"`
// The actual message
Message string `json:"message,required"`
}