File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -112,23 +112,34 @@ private func pluginPaths(relativeTo base: URL) -> PluginPaths? {
112112package var sourceKitPluginPaths : PluginPaths {
113113 get throws {
114114 struct PluginLoadingError : Error , CustomStringConvertible {
115- var description : String =
116- " Could not find SourceKit plugin. Ensure that you build the entire SourceKit-LSP package before running tests. "
115+ let searchBase : URL
116+ var description : String {
117+ // We can't declare a dependency from the test *target* on the SourceKit plugin *product*
118+ // (https://github.com/swiftlang/swift-package-manager/issues/8245).
119+ // We thus require a build before running the tests to ensure the plugin dylibs are in the build products
120+ // folder.
121+ """
122+ Could not find SourceKit plugin. Ensure that you build the entire SourceKit-LSP package before running tests.
123+
124+ Searching for plugin relative to \( searchBase)
125+ """
126+ }
117127 }
118128
119- var base =
129+ let base =
120130 if let pluginPaths = ProcessInfo . processInfo. environment [ " SOURCEKIT_LSP_TEST_PLUGIN_PATHS " ] {
121131 URL ( fileURLWithPath: pluginPaths)
122132 } else {
123133 xctestBundle
124134 }
125- while base. pathComponents. count > 1 {
126- if let paths = pluginPaths ( relativeTo: base) {
135+ var searchPath = base
136+ while searchPath. pathComponents. count > 1 {
137+ if let paths = pluginPaths ( relativeTo: searchPath) {
127138 return paths
128139 }
129- base = base . deletingLastPathComponent ( )
140+ searchPath = searchPath . deletingLastPathComponent ( )
130141 }
131142
132- throw PluginLoadingError ( )
143+ throw PluginLoadingError ( searchBase : base )
133144 }
134145}
You can’t perform that action at this time.
0 commit comments