Open mikeroher opened 3 years ago
Cheers for reporting! I'll aim to push out a fix for this soon, and try to put it behind a version gate so users of older Sorbets don't get errors when we pass an unexpected argument.
@mikeroher I'm afraid I don't seem to be able to reproduce this on the latest Sorbet (0.5.9058) - what version of Sorbet are you using?
Either way, the form of -p file-table-json
where an argument is passed seems to be valid on even relatively old versions of Sorbet, so if the no-argument form is causing problems somewhere, I see no harm in changing how we invoke it :)
@AaronC81 Ah strange, not sure what was causing it then! In any case, thank you for looking into it!!!
Fwiw, here's an excerpt of my Gemfile.lock:
parlour (6.0.1)
commander (~> 4.5)
parser
rainbow (~> 3.0)
sorbet-runtime (>= 0.5)
sorbet (0.5.9057)
sorbet-static (= 0.5.9057)
sorbet-runtime (0.5.9057)
sorbet-static (0.5.9057-universal-darwin-14)
Describe the bug TypeLoader#load_project fails due to changes in the Sorbet file-table-json generator.
The Sorbet
file-table-json
default parameter behaviour seems to have changed. Parlour's code changes into the user provided directory and calls the generator without passing in any folder path, under the assumption that the generator will use the current working directory if no path is provided. However, the generator now requires the folder path to be provided explicitly.To Reproduce Call TypeLoader.load_project on any folder.
Expected behavior TypeLoader.load_project should return the RbiObjects.
Actual behavior
How to Fix The fix for this is to add the root folderpath as a parameter to the generator. This occurs on line 58 of
type_loader.rb
.Current code:
Corrected code: