@@ -85,7 +85,7 @@ interface Command {
8585
8686function projectsToCommands ( projects : protocol . ProjectDescriptor [ ] ) : Promise < Command > [ ] {
8787 return projects . map ( project => {
88- let projectDirectory = project . Path ;
88+ let projectDirectory = project . Directory ;
8989
9090 return new Promise < Command > ( ( resolve , reject ) => {
9191 fs . lstat ( projectDirectory , ( err , stats ) => {
@@ -98,7 +98,7 @@ function projectsToCommands(projects: protocol.ProjectDescriptor[]): Promise<Com
9898 }
9999
100100 resolve ( {
101- label : `dotnet restore - (${ project . Name || path . basename ( project . Path ) } )` ,
101+ label : `dotnet restore - (${ project . Name || path . basename ( project . Directory ) } )` ,
102102 description : projectDirectory ,
103103 execute ( ) {
104104 return dotnetRestore ( projectDirectory ) ;
@@ -117,13 +117,13 @@ export function dotnetRestoreAllProjects(server: OmniSharpServer) {
117117
118118 return serverUtils . requestWorkspaceInformation ( server ) . then ( info => {
119119
120- let projectDescriptors = protocol . getDotNetCoreProjectDescriptors ( info ) ;
120+ let descriptors = protocol . getDotNetCoreProjectDescriptors ( info ) ;
121121
122- if ( projectDescriptors . length === 0 ) {
122+ if ( descriptors . length === 0 ) {
123123 return Promise . reject ( "No .NET Core projects found" ) ;
124124 }
125125
126- let commandPromises = projectsToCommands ( projectDescriptors ) ;
126+ let commandPromises = projectsToCommands ( descriptors ) ;
127127
128128 return Promise . all ( commandPromises ) . then ( commands => {
129129 return vscode . window . showQuickPick ( commands ) ;
@@ -135,40 +135,38 @@ export function dotnetRestoreAllProjects(server: OmniSharpServer) {
135135 } ) ;
136136}
137137
138- export function dotnetRestoreForProject ( server : OmniSharpServer , fileName : string ) {
138+ export function dotnetRestoreForProject ( server : OmniSharpServer , filePath : string ) {
139139
140140 if ( ! server . isRunning ( ) ) {
141141 return Promise . reject ( 'OmniSharp server is not running.' ) ;
142142 }
143143
144144 return serverUtils . requestWorkspaceInformation ( server ) . then ( info => {
145145
146- let projectDescriptors = protocol . getDotNetCoreProjectDescriptors ( info ) ;
146+ let descriptors = protocol . getDotNetCoreProjectDescriptors ( info ) ;
147147
148- if ( projectDescriptors . length === 0 ) {
148+ if ( descriptors . length === 0 ) {
149149 return Promise . reject ( "No .NET Core projects found" ) ;
150150 }
151151
152- let directory = path . dirname ( fileName ) ;
153-
154- for ( let projectDescriptor of projectDescriptors ) {
155- if ( projectDescriptor . Path === fileName ) {
156- return dotnetRestore ( directory , fileName ) ;
152+ for ( let descriptor of descriptors ) {
153+ if ( descriptor . FilePath === filePath ) {
154+ return dotnetRestore ( descriptor . Directory , filePath ) ;
157155 }
158156 }
159157 } ) ;
160158}
161159
162- function dotnetRestore ( cwd : string , fileName ?: string ) {
160+ function dotnetRestore ( cwd : string , filePath ?: string ) {
163161 return new Promise < void > ( ( resolve , reject ) => {
164162 channel . clear ( ) ;
165163 channel . show ( ) ;
166164
167165 let cmd = 'dotnet' ;
168166 let args = [ 'restore' ] ;
169167
170- if ( fileName ) {
171- args . push ( fileName ) ;
168+ if ( filePath ) {
169+ args . push ( filePath ) ;
172170 }
173171
174172 let dotnet = cp . spawn ( cmd , args , { cwd : cwd , env : process . env } ) ;
0 commit comments