@@ -232,46 +232,42 @@ local solution_discovery_semaphore = nio.control.semaphore(1)
232232--- lists all projects in solution.
233233--- Falls back to listing all project in directory.
234234--- @async
235- --- @param root string
235+ --- @param solution_path string
236236--- @return { solution : string ?, projects : DotnetProjectInfo[] }
237- function dotnet_utils .get_solution_projects (root )
237+ function dotnet_utils .get_solution_projects (solution_path )
238238 solution_discovery_semaphore .acquire ()
239239 if project_cache then
240240 solution_discovery_semaphore .release ()
241241 return project_cache
242242 end
243243
244- local solution = vim .fs .find (function (name )
245- return name :match (" %.slnx?$" )
246- end , { upward = false , type = " file" , path = root , limit = 1 })[1 ]
247-
248- local solution_dir = vim .fs .dirname (solution )
244+ local solution_dir = vim .fs .dirname (solution_path )
249245
250246 local projects = {}
251247
252- if solution then
248+ if solution_path then
253249 local _ , res = lib .process .run ({
254250 " dotnet" ,
255251 " sln" ,
256- solution ,
252+ solution_path ,
257253 " list" ,
258254 }, {
259255 stderr = false ,
260256 stdout = true ,
261257 })
262258
263- logger .debug (" neotest-vstest: dotnet sln " .. solution .. " list output:" )
259+ logger .debug (" neotest-vstest: dotnet sln " .. solution_path .. " list output:" )
264260 logger .debug (res .stdout )
265261
266262 local relative_path_projects = vim .list_slice (nio .fn .split (res .stdout , " \n " ), 3 )
267263 for _ , project in ipairs (relative_path_projects ) do
268264 projects [# projects + 1 ] = vim .fs .joinpath (solution_dir , project )
269265 end
270266 else
271- logger .info (" found no solution file in " .. root )
267+ logger .info (" found no solution file in " .. solution_path )
272268 projects = vim .fs .find (function (name , _ )
273269 return name :match (" %.[cf]sproj$" )
274- end , { upward = false , type = " file" , path = root })
270+ end , { upward = false , type = " file" , path = solution_path })
275271 end
276272
277273 local test_projects = {}
@@ -283,10 +279,10 @@ function dotnet_utils.get_solution_projects(root)
283279 end
284280 end
285281
286- logger .info (" found test projects in " .. root )
282+ logger .info (" found test projects in " .. solution_dir )
287283 logger .info (test_projects )
288284
289- local res = { solution = solution , projects = test_projects }
285+ local res = { solution = solution_path , projects = test_projects }
290286
291287 project_cache = res
292288
0 commit comments