-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #598 from nickspoons/project-management
Project management
- Loading branch information
Showing
23 changed files
with
663 additions
and
345 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
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,38 @@ | ||
let s:save_cpo = &cpoptions | ||
set cpoptions&vim | ||
|
||
let s:attempts = 0 | ||
|
||
function! OmniSharp#actions#workspace#Get(job) abort | ||
let opts = { | ||
\ 'ResponseHandler': function('s:ProjectsRH', [a:job]) | ||
\} | ||
let s:attempts += 1 | ||
call OmniSharp#stdio#RequestGlobal(a:job, '/projects', opts) | ||
endfunction | ||
|
||
function! s:ProjectsRH(job, response) abort | ||
" If this request fails, retry up to 5 times | ||
if !a:response.Success | ||
if s:attempts < 5 | ||
call OmniSharp#actions#workspace#Get(a:job) | ||
endif | ||
return | ||
endif | ||
" If no projects have been loaded by the time this callback is reached, there | ||
" are no projects and the job can be marked as ready | ||
let projects = get(get(a:response.Body, 'MsBuild', {}), 'Projects', {}) | ||
let a:job.projects = map(projects, | ||
\ {_,project -> {"name": project.AssemblyName, "path": project.Path}}) | ||
if get(a:job, 'projects_total', 0) > 0 | ||
call OmniSharp#log#Log(a:job, 'Workspace complete: ' . a:job.projects_total . ' project(s)') | ||
else | ||
call OmniSharp#log#Log(a:job, 'Workspace complete: no projects') | ||
call OmniSharp#project#RegisterLoaded(a:job) | ||
endif | ||
endfunction | ||
|
||
let &cpoptions = s:save_cpo | ||
unlet s:save_cpo | ||
|
||
" vim:et:sw=2:sts=2 |
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.