Skip to content

Commit 2b2282a

Browse files
committed
all: add Diagnostic prefix to DiagnosticSeverity enum
1 parent 96bd93d commit 2b2282a

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

basic.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,29 +134,29 @@ type Diagnostic struct {
134134
type DiagnosticSeverity float64
135135

136136
const (
137-
// SeverityError reports an error.
138-
SeverityError DiagnosticSeverity = 1
137+
// DiagnosticSeverityError reports an error.
138+
DiagnosticSeverityError DiagnosticSeverity = 1
139139

140-
// SeverityWarning reports a warning.
141-
SeverityWarning DiagnosticSeverity = 2
140+
// DiagnosticSeverityWarning reports a warning.
141+
DiagnosticSeverityWarning DiagnosticSeverity = 2
142142

143-
// SeverityInformation reports an information.
144-
SeverityInformation DiagnosticSeverity = 3
143+
// DiagnosticSeverityInformation reports an information.
144+
DiagnosticSeverityInformation DiagnosticSeverity = 3
145145

146-
// SeverityHint reports a hint.
147-
SeverityHint DiagnosticSeverity = 4
146+
// DiagnosticSeverityHint reports a hint.
147+
DiagnosticSeverityHint DiagnosticSeverity = 4
148148
)
149149

150150
// String implements fmt.Stringer.
151151
func (d DiagnosticSeverity) String() string {
152152
switch d {
153-
case SeverityError:
153+
case DiagnosticSeverityError:
154154
return "Error"
155-
case SeverityWarning:
155+
case DiagnosticSeverityWarning:
156156
return "Warning"
157-
case SeverityInformation:
157+
case DiagnosticSeverityInformation:
158158
return "Information"
159-
case SeverityHint:
159+
case DiagnosticSeverityHint:
160160
return "Hint"
161161
default:
162162
return strconv.FormatFloat(float64(d), 'f', -10, 64)

basic_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ func testDiagnostic(t *testing.T, marshal marshalFunc, unmarshal unmarshalFunc)
574574
Character: 3,
575575
},
576576
},
577-
Severity: SeverityError,
577+
Severity: DiagnosticSeverityError,
578578
Code: "foo/bar",
579579
CodeDescription: &CodeDescription{
580580
Href: uri.File("/path/to/test.go"),
@@ -653,7 +653,7 @@ func testDiagnostic(t *testing.T, marshal marshalFunc, unmarshal unmarshalFunc)
653653
Character: 3,
654654
},
655655
},
656-
Severity: SeverityError,
656+
Severity: DiagnosticSeverityError,
657657
CodeDescription: &CodeDescription{
658658
Href: uri.File("/path/to/test.go"),
659659
},
@@ -690,7 +690,7 @@ func testDiagnostic(t *testing.T, marshal marshalFunc, unmarshal unmarshalFunc)
690690
Character: 3,
691691
},
692692
},
693-
Severity: SeverityError,
693+
Severity: DiagnosticSeverityError,
694694
Code: "foo/bar",
695695
CodeDescription: &CodeDescription{
696696
Href: uri.File("/path/to/test.go"),
@@ -862,22 +862,22 @@ func TestDiagnosticSeverity_String(t *testing.T) {
862862
}{
863863
{
864864
name: "Error",
865-
d: SeverityError,
865+
d: DiagnosticSeverityError,
866866
want: "Error",
867867
},
868868
{
869869
name: "Warning",
870-
d: SeverityWarning,
870+
d: DiagnosticSeverityWarning,
871871
want: "Warning",
872872
},
873873
{
874874
name: "Information",
875-
d: SeverityInformation,
875+
d: DiagnosticSeverityInformation,
876876
want: "Information",
877877
},
878878
{
879879
name: "Hint",
880-
d: SeverityHint,
880+
d: DiagnosticSeverityHint,
881881
want: "Hint",
882882
},
883883
{

diagnostics_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func testPublishDiagnosticsParams(t *testing.T, marshal marshalFunc, unmarshal u
3232
Character: 3,
3333
},
3434
},
35-
Severity: SeverityError,
35+
Severity: DiagnosticSeverityError,
3636
Code: "foo/bar",
3737
Source: "test foo bar",
3838
Message: "foo bar",

language_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2792,7 +2792,7 @@ func testCodeActionParams(t *testing.T, marshal marshalFunc, unmarshal unmarshal
27922792
Character: 3,
27932793
},
27942794
},
2795-
Severity: SeverityError,
2795+
Severity: DiagnosticSeverityError,
27962796
Code: "foo/bar",
27972797
Source: "test foo bar",
27982798
Message: "foo bar",
@@ -3002,7 +3002,7 @@ func testCodeActionContext(t *testing.T, marshal marshalFunc, unmarshal unmarsha
30023002
Character: 3,
30033003
},
30043004
},
3005-
Severity: SeverityError,
3005+
Severity: DiagnosticSeverityError,
30063006
Code: "foo/bar",
30073007
Source: "test foo bar",
30083008
Message: "foo bar",
@@ -3132,7 +3132,7 @@ func testCodeAction(t *testing.T, marshal marshalFunc, unmarshal unmarshalFunc)
31323132
Character: 3,
31333133
},
31343134
},
3135-
Severity: SeverityError,
3135+
Severity: DiagnosticSeverityError,
31363136
Code: "foo/bar",
31373137
Source: "test foo bar",
31383138
Message: "foo bar",

0 commit comments

Comments
 (0)