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 {
126126 #endif
127127 if let pluginPaths {
128128 try setenv (
129- name: " SOURCEKIT_LSP_PLUGIN_SOURCEKITD_PATH_ \( pluginPaths. clientPlugin. filePath) " ,
129+ name: " SOURCEKIT_LSP_PLUGIN_SOURCEKITD_PATH_ \( pluginPaths. clientPlugin. realpath . filePath) " ,
130130 value: dylibPath. filePath,
131131 override: false
132132 )
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ public func sourcekitd_plugin_initialize(_ params: sourcekitd_api_plugin_initial
3333 var dlInfo = Dl_info ( )
3434 dladdr ( #dsohandle, & dlInfo)
3535 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
3738 while url. pathExtension != " framework " && url. lastPathComponent != " / " {
3839 url. deleteLastPathComponent ( )
3940 }
@@ -43,7 +44,10 @@ public func sourcekitd_plugin_initialize(_ params: sourcekitd_api_plugin_initial
4344 . appendingPathComponent ( " sourcekitd.framework " )
4445 . appendingPathComponent ( " sourcekitd " )
4546 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+ ]
4751 {
4852 // When using a SourceKit plugin from the build directory, we can't find sourcekitd relative to the plugin.
4953 // 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