Skip to content

Commit b84b387

Browse files
committed
Get the pid of the current process using Foundation
1 parent 2dbc232 commit b84b387

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Sources/SourceKit/SourceKitServer.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,7 @@ public final class SourceKitServer: LanguageServer {
169169
return nil
170170
}
171171

172-
#if os(Windows)
173-
let pid: Int = unsafeBitCast(GetCurrentProcess(), to: Int.self)
174-
#else
175-
let pid: Int = Int(getpid())
176-
#endif
172+
let pid = Int(ProcessInfo.processInfo.processIdentifier)
177173
let resp = try service.sendSync(InitializeRequest(
178174
processId: pid,
179175
rootPath: nil,

0 commit comments

Comments
 (0)