-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple simultaneous requests to be sent to OmniSharp server #902
Merged
DustinCampbell
merged 6 commits into
dotnet:master
from
DustinCampbell:concurrent-server
Nov 11, 2016
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e93987a
Add queue helper classes for handling requests concurrently
DustinCampbell 44d2fec
Combine OmnisharpServer and StdioOmnisharpServer
DustinCampbell d4d748c
Rename OmnisharpServer to OmniSharpServer
DustinCampbell 26c71c9
Moar server work
DustinCampbell 9b50f56
Get server working again
DustinCampbell 64df4ec
Add a bit more logging
DustinCampbell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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,60 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import * as protocol from './protocol'; | ||
|
||
const priorityCommands = [ | ||
protocol.Requests.ChangeBuffer, | ||
protocol.Requests.FormatAfterKeystroke, | ||
protocol.Requests.FormatRange, | ||
protocol.Requests.UpdateBuffer | ||
]; | ||
|
||
const normalCommands = [ | ||
protocol.Requests.AutoComplete, | ||
protocol.Requests.FilesChanged, | ||
protocol.Requests.FindSymbols, | ||
protocol.Requests.FindUsages, | ||
protocol.Requests.GetCodeActions, | ||
protocol.Requests.GoToDefinition, | ||
protocol.Requests.RunCodeAction, | ||
protocol.Requests.SignatureHelp, | ||
protocol.Requests.TypeLookup | ||
]; | ||
|
||
const prioritySet = new Set<string>(priorityCommands); | ||
const normalSet = new Set<string>(normalCommands); | ||
const deferredSet = new Set<string>(); | ||
|
||
const nonDeferredSet = new Set<string>(); | ||
|
||
for (let command of priorityCommands) { | ||
nonDeferredSet.add(command); | ||
} | ||
|
||
for (let command of normalCommands) { | ||
nonDeferredSet.add(command); | ||
} | ||
|
||
export function isPriorityCommand(command: string) { | ||
return prioritySet.has(command); | ||
} | ||
|
||
export function isNormalCommand(command: string) { | ||
return normalSet.has(command); | ||
} | ||
|
||
export function isDeferredCommand(command: string) { | ||
if (deferredSet.has(command)) { | ||
return true; | ||
} | ||
|
||
if (nonDeferredSet.has(command)) { | ||
return false; | ||
} | ||
|
||
deferredSet.add(command); | ||
return true; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code looks awfully familiar. :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah. Pretty similar to https://github.com/OmniSharp/omnisharp-node-client/blob/master/lib/helpers/prioritization.ts. 😄