File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
SwiftSourceKitClientPlugin Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ package actor DynamicallyLoadedSourceKitD: SourceKitD {
126
126
#endif
127
127
if let pluginPaths {
128
128
try setenv (
129
- name: " SOURCEKIT_LSP_PLUGIN_SOURCEKITD_PATH_ \( pluginPaths. clientPlugin. filePath) " ,
129
+ name: " SOURCEKIT_LSP_PLUGIN_SOURCEKITD_PATH_ \( pluginPaths. clientPlugin. realpath . filePath) " ,
130
130
value: dylibPath. filePath,
131
131
override: false
132
132
)
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ public func sourcekitd_plugin_initialize(_ params: sourcekitd_api_plugin_initial
33
33
var dlInfo = Dl_info ( )
34
34
dladdr ( #dsohandle, & dlInfo)
35
35
let path = String ( cString: dlInfo. dli_fname)
36
- var url = URL ( fileURLWithPath: path, isDirectory: false )
36
+ let clientPluginDylibUrl = URL ( fileURLWithPath: path, isDirectory: false )
37
+ var url = clientPluginDylibUrl
37
38
while url. pathExtension != " framework " && url. lastPathComponent != " / " {
38
39
url. deleteLastPathComponent ( )
39
40
}
@@ -43,7 +44,10 @@ public func sourcekitd_plugin_initialize(_ params: sourcekitd_api_plugin_initial
43
44
. appendingPathComponent ( " sourcekitd.framework " )
44
45
. appendingPathComponent ( " sourcekitd " )
45
46
if !FileManager. default. fileExists ( at: url) ,
46
- let sourcekitdPath = ProcessInfo . processInfo. environment [ " SOURCEKIT_LSP_PLUGIN_SOURCEKITD_PATH_ \( path) " ]
47
+ let clientPluginDylibUrlRealpath = try ? clientPluginDylibUrl. realpath. filePath,
48
+ let sourcekitdPath = ProcessInfo . processInfo. environment [
49
+ " SOURCEKIT_LSP_PLUGIN_SOURCEKITD_PATH_ \( clientPluginDylibUrlRealpath) "
50
+ ]
47
51
{
48
52
// When using a SourceKit plugin from the build directory, we can't find sourcekitd relative to the plugin.
49
53
// Respect the sourcekitd path that was passed to us via an environment variable from
You can’t perform that action at this time.
0 commit comments