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? {
112
112
package var sourceKitPluginPaths : PluginPaths {
113
113
get throws {
114
114
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
+ }
117
127
}
118
128
119
- var base =
129
+ let base =
120
130
if let pluginPaths = ProcessInfo . processInfo. environment [ " SOURCEKIT_LSP_TEST_PLUGIN_PATHS " ] {
121
131
URL ( fileURLWithPath: pluginPaths)
122
132
} else {
123
133
xctestBundle
124
134
}
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) {
127
138
return paths
128
139
}
129
- base = base . deletingLastPathComponent ( )
140
+ searchPath = searchPath . deletingLastPathComponent ( )
130
141
}
131
142
132
- throw PluginLoadingError ( )
143
+ throw PluginLoadingError ( searchBase : base )
133
144
}
134
145
}
You can’t perform that action at this time.
0 commit comments