Skip to content

Commit 6c9171e

Browse files
committed
all: add TextDocumentSaveReason prefix to TextDocumentSaveReason enum
1 parent b0adf03 commit 6c9171e

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

text.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,25 @@ type DidChangeTextDocumentParams struct {
3131
type TextDocumentSaveReason float64
3232

3333
const (
34-
// Manual is the manually triggered, e.g. by the user pressing save, by starting debugging,
34+
// TextDocumentSaveReasonManual is the manually triggered, e.g. by the user pressing save, by starting debugging,
3535
// or by an API call.
36-
Manual TextDocumentSaveReason = 1
36+
TextDocumentSaveReasonManual TextDocumentSaveReason = 1
3737

38-
// AfterDelay is the automatic after a delay.
39-
AfterDelay TextDocumentSaveReason = 2
38+
// TextDocumentSaveReasonAfterDelay is the automatic after a delay.
39+
TextDocumentSaveReasonAfterDelay TextDocumentSaveReason = 2
4040

41-
// FocusOut when the editor lost focus.
42-
FocusOut TextDocumentSaveReason = 3
41+
// TextDocumentSaveReasonFocusOut when the editor lost focus.
42+
TextDocumentSaveReasonFocusOut TextDocumentSaveReason = 3
4343
)
4444

4545
// String implements fmt.Stringer.
4646
func (t TextDocumentSaveReason) String() string {
4747
switch t {
48-
case Manual:
48+
case TextDocumentSaveReasonManual:
4949
return "Manual"
50-
case AfterDelay:
50+
case TextDocumentSaveReasonAfterDelay:
5151
return "AfterDelay"
52-
case FocusOut:
52+
case TextDocumentSaveReasonFocusOut:
5353
return "FocusOut"
5454
default:
5555
return strconv.FormatFloat(float64(t), 'f', -10, 64)

text_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,17 +226,17 @@ func TestTextDocumentSaveReason_String(t *testing.T) {
226226
}{
227227
{
228228
name: "Manual",
229-
k: Manual,
229+
k: TextDocumentSaveReasonManual,
230230
want: "Manual",
231231
},
232232
{
233233
name: "AfterDelay",
234-
k: AfterDelay,
234+
k: TextDocumentSaveReasonAfterDelay,
235235
want: "AfterDelay",
236236
},
237237
{
238238
name: "FocusOut",
239-
k: FocusOut,
239+
k: TextDocumentSaveReasonFocusOut,
240240
want: "FocusOut",
241241
},
242242
{
@@ -467,7 +467,7 @@ func testWillSaveTextDocumentParams(t *testing.T, marshal marshalFunc, unmarshal
467467
TextDocument: TextDocumentIdentifier{
468468
URI: uri.File("/path/to/test.go"),
469469
},
470-
Reason: FocusOut,
470+
Reason: TextDocumentSaveReasonFocusOut,
471471
}
472472
wantTypeNilAll := WillSaveTextDocumentParams{
473473
TextDocument: TextDocumentIdentifier{

0 commit comments

Comments
 (0)