Skip to content

Commit 5c52958

Browse files
Added prepare rename, and fixed build. Tests wip
1 parent 94eddef commit 5c52958

File tree

65 files changed

+763
-508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+763
-508
lines changed

LanguageServer/Protocol/Server/Capabilities/FoldingRangeProviderOptions.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

language-server-protocol.sha.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
-- This is the last commit we caught up with https://github.com/Microsoft/language-server-protocol/commits/gh-pages
2-
f39afb47038be65431ec684dc11725ff74e71f48
2+
9e2713d5f1618b8d5e05a91a4e2c637aa51e1ee0

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<Import Project="$([MSBuild]::GetPathOfFileAbove('Common.Build.props', '$(MSBuildThisFileDirectory)../'))" />
33
<PropertyGroup>
44
<PackageVersion Condition="'$(GitVersion_NuGetVersion)' != ''">$(GitVersion_NuGetVersion)</PackageVersion>
5+
<AssemblyVersion>0.0.9.9</AssemblyVersion>
56
<AssemblyVersion Condition="'$(GitVersion_AssemblySemVer)' != ''">$(GitVersion_Major).$(GitVersion_Minor).0.0</AssemblyVersion>
6-
<AssemblyVersion Condition="'$(AssemblyVersion)' == ''">0.0.9.9</AssemblyVersion>
77
<FileVersion Condition="'$(GitVersion_AssemblySemVer)' != ''">$(GitVersion_AssemblySemVer)</FileVersion>
88
<InformationalVersion Condition="'$(GitVersion_InformationalVersion)' != ''">$(GitVersion_InformationalVersion)</InformationalVersion>
99
<IsPackable>true</IsPackable>
Lines changed: 2 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;
12
using OmniSharp.Extensions.LanguageServer.Protocol.Server;
23

34
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
@@ -11,104 +12,6 @@ public class CodeActionCapability : DynamicCapability, ConnectedCapability<ICode
1112
/// Since 3.8.0
1213
/// </summary>
1314
[Optional]
14-
public CodeActionLiteralSupportCapability codeActionLiteralSupport { get; set; }
15-
}
16-
17-
public class CodeActionLiteralSupportCapability
18-
{
19-
20-
/// <summary>
21-
/// The code action kind is support with the following value
22-
/// set.
23-
/// </summary>
24-
25-
public CodeActionKindCapability CodeActionKind { get; set; }
26-
}
27-
28-
public class CodeActionKindCapability
29-
{
30-
/// <summary>
31-
/// The code action kind values the client supports. When this
32-
/// property exists the client also guarantees that it will
33-
/// handle values outside its set gracefully and falls back
34-
/// to a default value when unknown.
35-
/// </summary>
36-
public Container<CodeActionKind> ValueSet { get; set; }
37-
}
38-
39-
/// <summary>
40-
/// A set of predefined code action kinds
41-
/// </summary>
42-
[JsonConverter(typeof(CodeActionKindConverter))]
43-
public class CodeActionKind
44-
{
45-
/// <summary>
46-
/// Base kind for quickfix actions: 'quickfix'
47-
/// </summary>
48-
public static CodeActionKind QuickFix = new CodeActionKind("quickfix");
49-
50-
/// <summary>
51-
/// Base kind for refactoring actions: 'refactor'
52-
/// </summary>
53-
public static CodeActionKind Refactor = new CodeActionKind("refactor");
54-
55-
/// <summary>
56-
/// Base kind for refactoring extraction actions: 'refactor.extract'
57-
///
58-
/// Example extract actions:
59-
///
60-
/// - Extract method
61-
/// - Extract function
62-
/// - Extract variable
63-
/// - Extract interface from class
64-
/// - ...
65-
/// </summary>
66-
public static CodeActionKind RefactorExtract = new CodeActionKind("refactor.extract");
67-
68-
/// <summary>
69-
/// Base kind for refactoring inline actions: 'refactor.inline'
70-
///
71-
/// Example inline actions:
72-
///
73-
/// - Inline function
74-
/// - Inline variable
75-
/// - Inline constant
76-
/// - ...
77-
/// </summary>
78-
public static CodeActionKind RefactorInline = new CodeActionKind("refactor.inline");
79-
80-
/// <summary>
81-
/// Base kind for refactoring rewrite actions: 'refactor.rewrite'
82-
///
83-
/// Example rewrite actions:
84-
///
85-
/// - Convert JavaScript function to class
86-
/// - Add or remove parameter
87-
/// - Encapsulate field
88-
/// - Make method static
89-
/// - Move method to base class
90-
/// - ...
91-
/// </summary>
92-
public static CodeActionKind RefactorRewrite = new CodeActionKind("refactor.rewrite");
93-
94-
/// <summary>
95-
/// Base kind for source actions: `source`
96-
///
97-
/// Source code actions apply to the entire file.
98-
/// </summary>
99-
public static CodeActionKind Source = new CodeActionKind("source");
100-
101-
/// <summary>
102-
/// Base kind for an organize imports source action: `source.organizeImports`
103-
/// </summary>
104-
public static CodeActionKind SourceOrganizeImports = new CodeActionKind("source.organizeImports");
105-
106-
public CodeActionKind(string kind)
107-
{
108-
kind = kind;
109-
}
110-
111-
public string Kind { get; }
112-
15+
public CodeActionLiteralSupportCapability CodeActionLiteralSupport { get; set; }
11316
}
11417
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
2+
3+
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
4+
{
5+
public class CodeActionKindCapability
6+
{
7+
/// <summary>
8+
/// The code action kind values the client supports. When this
9+
/// property exists the client also guarantees that it will
10+
/// handle values outside its set gracefully and falls back
11+
/// to a default value when unknown.
12+
/// </summary>
13+
public Container<CodeActionKind> ValueSet { get; set; }
14+
}
15+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
2+
{
3+
public class CodeActionLiteralSupportCapability
4+
{
5+
6+
/// <summary>
7+
/// The code action kind is support with the following value
8+
/// set.
9+
/// </summary>
10+
11+
public CodeActionKindCapability CodeActionKind { get; set; }
12+
}
13+
}

src/Protocol/Client/Capabilities/ColorProviderCapability.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,4 @@
33
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
44
{
55
public class ColorProviderCapability : DynamicCapability, ConnectedCapability<IDocumentColorHandler>, ConnectedCapability<IColorPresentationHandler> { }
6-
public class FoldingRangeCapability : DynamicCapability, ConnectedCapability<IFoldingRangeHandler>, ConnectedCapability<IFoldingRangeHandler>
7-
{
8-
/// <summary>
9-
/// The maximum number of folding ranges that the client prefers to receive per document. The value serves as a
10-
/// hint, servers are free to follow the limit.
11-
/// </summary>
12-
[Optional]
13-
public int? RangeLimit { get; set; }
14-
15-
/// <summary>
16-
/// If set, the client signals that it only supports folding complete lines. If set, client will
17-
/// ignore specified `startCharacter` and `endCharacter` properties in a FoldingRange.
18-
/// </summary>
19-
public bool LineFoldingOnly { get; set; }
20-
}
216
}

src/Protocol/Client/Capabilities/DocumentSymbolCapability.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ public class DocumentSymbolCapability : DynamicCapability, ConnectedCapability<I
1616
/// Whether document symbol supports hierarchical `DocumentSymbol`s.
1717
/// </summary>
1818
[Optional]
19-
public bool? hierarchicalDocumentSymbolSupport { get; set; }
19+
public bool? HierarchicalDocumentSymbolSupport { get; set; }
2020
}
2121
}
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;
2+
using OmniSharp.Extensions.LanguageServer.Protocol.Server;
23

34
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
45
{
5-
public class FoldingRangeCapability : DynamicCapability
6+
public class FoldingRangeCapability : DynamicCapability, ConnectedCapability<IFoldingRangeHandler>
67
{
78
/// <summary>
89
/// The maximum number of folding ranges that the client prefers to receive per document. The value serves as a
910
/// hint, servers are free to follow the limit.
1011
/// </summary>
1112
[Optional]
12-
public long? RangeLimit { get; set; }
13+
public int? RangeLimit { get; set; }
1314

1415
/// <summary>
15-
/// set, the client signals that it only supports folding complete lines. If set, client will
16+
/// If set, the client signals that it only supports folding complete lines. If set, client will
1617
/// ignore specified `startCharacter` and `endCharacter` properties in a FoldingRange.
1718
/// </summary>
18-
[Optional]
1919
public bool LineFoldingOnly { get; set; }
2020
}
2121
}
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;
12
using OmniSharp.Extensions.LanguageServer.Protocol.Server;
23

34
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
45
{
5-
public class RenameCapability : DynamicCapability, ConnectedCapability<IRenameHandler> { }
6+
public class RenameCapability : DynamicCapability, ConnectedCapability<IRenameHandler>, ConnectedCapability<IPrepareRenameHandler>
7+
{
8+
/// <summary>
9+
/// Client supports testing for validity of rename operations
10+
/// before execution.
11+
/// </summary>
12+
[Optional]
13+
public bool PrepareSupport { get; set; }
14+
}
615
}

0 commit comments

Comments
 (0)