Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Commit 99a2e68

Browse files
committed
Merge branch 'feature/v3_7_0'
2 parents d303240 + b9ef126 commit 99a2e68

File tree

8 files changed

+129
-23
lines changed

8 files changed

+129
-23
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace LanguageServer.Parameters.General
2+
{
3+
/// <summary>
4+
/// For <c>initialize</c>
5+
/// </summary>
6+
/// <seealso>Spec 3.7.0</seealso>
7+
public class PublishDiagnosticsCapabilities
8+
{
9+
/// <summary>
10+
/// Whether the clients accepts diagnostics with related information.
11+
/// </summary>
12+
/// <seealso>Spec 3.7.0</seealso>
13+
public bool? relatedInformation { get; set; }
14+
}
15+
}

LanguageServer/Parameters/General/TextDocumentClientCapabilities.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// <summary>
44
/// For <c>initialize</c>
55
/// </summary>
6-
/// <seealso>Spec 3.4.0</seealso>
6+
/// <seealso>Spec 3.7.0</seealso>
77
public class TextDocumentClientCapabilities
88
{
99
/// <summary>
@@ -112,5 +112,11 @@ public class TextDocumentClientCapabilities
112112
/// Capabilities specific to the <c>textDocument/rename</c>
113113
/// </summary>
114114
public RegistrationCapabilities rename { get; set; }
115+
116+
/// <summary>
117+
/// Capabilities specific to <c>textDocument/publishDiagnostics</c>.
118+
/// </summary>
119+
/// <seealso>Spec 3.7.0</seealso>
120+
public PublishDiagnosticsCapabilities publishDiagnostics { get; set; }
115121
}
116122
}
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
5-
namespace LanguageServer.Parameters.TextDocument
1+
namespace LanguageServer.Parameters.TextDocument
62
{
3+
/// <summary>
4+
/// For <c>textDocument/codeAction</c>
5+
/// </summary>
6+
/// <remarks>
7+
/// Contains additional diagnostic information about the context in which a code action is run.
8+
/// </remarks>
79
public class CodeActionContext
810
{
11+
/// <summary>
12+
/// An array of diagnostics.
13+
/// </summary>
914
public Diagnostic[] diagnostics { get; set; }
1015
}
1116
}

LanguageServer/Parameters/TextDocument/CodeActionParams.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
5-
namespace LanguageServer.Parameters.TextDocument
1+
namespace LanguageServer.Parameters.TextDocument
62
{
73
/// <summary>
84
/// For <c>textDocument/codeAction</c>

LanguageServer/Parameters/TextDocument/Diagnostic.cs

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,49 @@
22

33
namespace LanguageServer.Parameters.TextDocument
44
{
5-
public class Diagnostic
6-
{
7-
public Range range { get; set; }
5+
/// <summary>
6+
/// For <c>textDocument/codeAction</c> and <c>textDocument/publishDiagnostics</c>
7+
/// </summary>
8+
/// <seealso>Spec 3.7.0</seealso>
9+
public class Diagnostic
10+
{
11+
/// <summary>
12+
/// The range at which the message applies.
13+
/// </summary>
14+
public Range range { get; set; }
815

9-
public DiagnosticSeverity? severity { get; set; }
16+
/// <summary>
17+
/// The diagnostic's severity. Can be omitted.
18+
/// </summary>
19+
/// <remarks>
20+
/// If omitted it is up to the client to interpret diagnostics as error, warning, info or hint.
21+
/// </remarks>
22+
public DiagnosticSeverity? severity { get; set; }
1023

11-
public NumberOrString code { get; set; }
24+
/// <summary>
25+
/// The diagnostic's code. Can be omitted.
26+
/// </summary>
27+
public NumberOrString code { get; set; }
1228

13-
public string source { get; set; }
29+
/// <summary>
30+
/// A human-readable string describing the source of this diagnostic,
31+
/// e.g. <c>'typescript'</c> or <c>'super lint'</c>.
32+
/// </summary>
33+
public string source { get; set; }
1434

15-
public string message { get; set; }
16-
}
17-
}
35+
/// <summary>
36+
/// The diagnostic's message.
37+
/// </summary>
38+
public string message { get; set; }
39+
40+
/// <summary>
41+
/// An array of related diagnostic information.
42+
/// </summary>
43+
/// <remarks>
44+
/// e.g. when symbol-names within a scope collide
45+
/// all definitions can be marked via this property.
46+
/// </remarks>
47+
/// <seealso>Spec 3.7.0</seealso>
48+
public DiagnosticRelatedInformation[] relatedInformation { get; set; }
49+
}
50+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace LanguageServer.Parameters.TextDocument
2+
{
3+
/// <summary>
4+
/// Represents a related message and source code location for a diagnostic.
5+
/// For <c>textDocument/codeAction</c> and <c>textDocument/publishDiagnostics</c>
6+
/// </summary>
7+
/// <remarks>
8+
/// This should be used to point to code locations that cause or related to a diagnostics,
9+
/// e.g when duplicating a symbol in a scope.
10+
/// </remarks>
11+
/// <seealso>Spec 3.7.0</seealso>
12+
public class DiagnosticRelatedInformation
13+
{
14+
/// <summary>
15+
/// The location of this related diagnostic information.
16+
/// </summary>
17+
/// <seealso>Spec 3.7.0</seealso>
18+
public Location location { get; set; }
19+
20+
/// <summary>
21+
/// The message of this related diagnostic information.
22+
/// </summary>
23+
/// <seealso>Spec 3.7.0</seealso>
24+
public string message { get; set; }
25+
}
26+
}
Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
namespace LanguageServer.Parameters.TextDocument
22
{
3+
/// <summary>
4+
/// Diagnostic severities
5+
/// </summary>
36
public enum DiagnosticSeverity
47
{
8+
/// <summary>
9+
/// Reports an error.
10+
/// </summary>
511
Error = 1,
12+
13+
/// <summary>
14+
/// Reports a warning.
15+
/// </summary>
616
Warning = 2,
17+
18+
/// <summary>
19+
/// Reports an information.
20+
/// </summary>
721
Information = 3,
22+
23+
/// <summary>
24+
/// Reports a hint.
25+
/// </summary>
826
Hint = 4,
927
}
10-
}
28+
}
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
42

53
namespace LanguageServer.Parameters.TextDocument
64
{
5+
/// <summary>
6+
/// For <c>textDocument/publishDiagnostics</c>
7+
/// </summary>
78
public class PublishDiagnosticsParams
89
{
10+
/// <summary>
11+
/// The URI for which diagnostic information is reported.
12+
/// </summary>
913
public Uri uri { get; set; }
1014

15+
/// <summary>
16+
/// An array of diagnostic information items.
17+
/// </summary>
1118
public Diagnostic[] diagnostics { get; set; }
1219
}
1320
}

0 commit comments

Comments
 (0)