The difficulty for Sublime, of course, is that the file being edited won't always be in the same directory as the pubspec. One solution would be for the Sublime plugin to look at the file's path and find the most deeply nested directory that contains a packages directory. It could then pass the path to the packages directory in as the value of the --package-root argument.
Brian
I don't follow, isn't that why the packages/ directory is created in each sub folder (except lib)?
Matt,I don't follow, isn't that why the packages/ directory is created in each sub folder (except lib)?First, to the best of my knowledge, pub only creates a packages directory in each sub folder under Windows. I know that it does not do so for me when I'm running on my Mac and using Dart Editor to run pub for me.
Second, I omitted a small detail because I didn't think it was relevant. If there is no --package-root argument, analyzer will run pub in the current directory asking for a package map (a table mapping package names to the root directory used to resolve package: URI's for that package). Pub needs to be run from the directory containing the pubspec. Hence, dartanalyzer needs to be run from the directory containing the pubspec unless you explicitly provide a package root.
Brian
On Friday, October 24, 2014 12:16:15 PM UTC-3, Brian Wilkerson wrote:Matt,
I don't follow, isn't that why the packages/ directory is created in each sub folder (except lib)?
First, to the best of my knowledge, pub only creates a packages directory in each sub folder under Windows. I know that it does not do so for me when I'm running on my Mac and using Dart Editor to run pub for me.
I'm not sure on Mac, but they are created in Linux but they're simply not displayed in the Dart Editor. (ls -l shows them from the test directory on my package in linux for exmaple).
It is there on Mac as well in each subfolder, DartEditor simply hides these symlinks.
https://www.dartlang.org/tools/pub/glossary.html#entrypoint-directory
Brian
https://www.dartlang.org/tools/pub/glossary.html#entrypoint-directory