-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into completion-on-part-of-typed-text
- Loading branch information
Showing
9 changed files
with
442 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/OmniSharp.Cake/Services/RequestHandlers/Completion/CompletionHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System.Composition; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using OmniSharp.Cake.Extensions; | ||
using OmniSharp.Mef; | ||
using OmniSharp.Models.v1.Completion; | ||
|
||
namespace OmniSharp.Cake.Services.RequestHandlers.Completion | ||
{ | ||
[Shared] | ||
[OmniSharpHandler(OmniSharpEndpoints.Completion, Constants.LanguageNames.Cake)] | ||
public class CompletionHandler : CakeRequestHandler<CompletionRequest, CompletionResponse> | ||
{ | ||
[ImportingConstructor] | ||
public CompletionHandler(OmniSharpWorkspace workspace) : base(workspace) | ||
{ | ||
} | ||
|
||
protected override Task<CompletionResponse> TranslateResponse(CompletionResponse response, CompletionRequest request) | ||
{ | ||
return response.TranslateAsync(Workspace, request); | ||
} | ||
} | ||
|
||
[Shared] | ||
[OmniSharpHandler(OmniSharpEndpoints.CompletionResolve, Constants.LanguageNames.Cake)] | ||
public class CompletionResolveHandler : CakeRequestHandler<CompletionResolveRequest, CompletionResolveResponse> | ||
{ | ||
[ImportingConstructor] | ||
public CompletionResolveHandler(OmniSharpWorkspace workspace) : base(workspace) | ||
{ | ||
} | ||
|
||
protected override Task<CompletionResolveResponse> TranslateResponse(CompletionResolveResponse response, CompletionResolveRequest request) | ||
{ | ||
// Due to the fact that AdditionalTextEdits return the complete buffer, we can't currently use that in Cake. | ||
// Revisit when we have a solution. At this point it's probably just best to remove AdditionalTextEdits. | ||
if (response.Item is object) | ||
{ | ||
response.Item.AdditionalTextEdits = null; | ||
} | ||
|
||
return Task.FromResult(response); | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/OmniSharp.Cake/Services/RequestHandlers/QuickInfoHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Composition; | ||
using OmniSharp.Mef; | ||
using OmniSharp.Models; | ||
|
||
namespace OmniSharp.Cake.Services.RequestHandlers | ||
{ | ||
[Shared] | ||
[OmniSharpHandler(OmniSharpEndpoints.QuickInfo, Constants.LanguageNames.Cake)] | ||
public class QuickInfoHandler : CakeRequestHandler<QuickInfoRequest, QuickInfoResponse> | ||
{ | ||
[ImportingConstructor] | ||
public QuickInfoHandler(OmniSharpWorkspace workspace) : base(workspace) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.