# Xcode project support?

**URL:** <https://forums.swift.org/t/xcode-project-support/20927>\
**Category:** SourceKit-LSP\
**Created:** [February 26, 2019, 9:42pm UTC](https://forums.swift.org/t/xcode-project-support/20927 "2019-02-26T21:42:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Martin](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/daniel_martin/32/4130_2.png) [@Daniel\_Martin](https://forums.swift.org/u/Daniel_Martin)\
**Post date:** [February 26, 2019, 9:42pm UTC](https://forums.swift.org/t/xcode-project-support/20927/1 "2019-02-26T21:42:54Z")

</div>

Is it planned/wanted to have support for Xcode projects in SourceKit-LSP, alongside SPM? I don't know if there's any strategic/technical reason to not offer that, or it is simply that nobody has worked on this yet. I think it would greatly help with the adoption of SourceKit-LSP, as most of the people that have contacted me about the project want to use it with an existing Xcode project.

One problem is that the Xcode build system has traditionally been very hermetic and there's not a clear and documented way to extract compilation flags.

---

<div class="post-metadata">

**Author:** ![Jon\_Shier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jon_shier/32/921_2.png) [@Jon\_Shier](https://forums.swift.org/u/Jon_Shier)\
**Post date:** [February 26, 2019, 9:53pm UTC](https://forums.swift.org/t/xcode-project-support/20927/2 "2019-02-26T21:53:15Z")

</div>

This is likely something Apple won’t comment on, given Xcode is an Apple product. Hopefully we’ll see something at WWDC. Personally I’m not holding my breath. Xcode support for LSP by this summer would be blisteringly fast for them.

---

<div class="post-metadata">

**Author:** ![Jon\_Shier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jon_shier/32/921_2.png) [@Jon\_Shier](https://forums.swift.org/u/Jon_Shier)\
**Post date:** [February 27, 2019, 12:07am UTC](https://forums.swift.org/t/xcode-project-support/20927/3 "2019-02-27T00:07:17Z")

</div>

I should say that when the official Swift LSP implementation support was announced, they state there would be eventual Xcode support. When that will ship and what it will look like are still up in the air. I would hope it means we'd get better integration with SPM, but I wouldn't count on it. Xcode already uses as least some parts of SPM's `llbuild` under the hood (IIUC), but who knows how much of a leap it would be from that build system to supporting SPM's. It's extremely irritating not knowing where the tools you use every day are going and not being able to fix the issues you find, but that's Apple.

---

<div class="post-metadata">

**Author:** ![akyrtzi](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/akyrtzi/32/4963_2.png) [@akyrtzi](https://forums.swift.org/u/akyrtzi)\
**Post date:** [February 27, 2019, 3:26am UTC](https://forums.swift.org/t/xcode-project-support/20927/4 "2019-02-27T03:26:07Z")

</div>

Hey Daniel, I've replied to a similar question [previously here](https://forums.swift.org/t/whats-the-plan-for-index/18441/4).

---

<div class="post-metadata">

**Author:** ![Daniel\_Martin](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/daniel_martin/32/4130_2.png) [@Daniel\_Martin](https://forums.swift.org/u/Daniel_Martin)\
**Post date:** [February 27, 2019, 8:55am UTC](https://forums.swift.org/t/xcode-project-support/20927/5 "2019-02-27T08:55:58Z")

</div>

Oh, thanks, I missed that conversation. Makes sense, we'll have to wait for the Xcode build system to export the compile flags somehow. There's already options, like some existing tools that parse the `xcodebuild.log` to do that, but those tools always seemed clunky to me.

---

<div class="post-metadata">

**Author:** ![Keith](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/keith/32/291_2.png) [@Keith](https://forums.swift.org/u/Keith)\
**Post date:** [February 27, 2019, 4:38pm UTC](https://forums.swift.org/t/xcode-project-support/20927/6 "2019-02-27T16:38:27Z")

</div>

FWIW if you're interested in parsing the build logs for this, and you're using the new build system, parsing the structured llbuild definition is much easier. You can find the definition of the format [here](https://github.com/apple/swift-llbuild/blob/master/docs/buildsystem.rst) and an example we wrote for parsing the command line arguments for each file [here](https://github.com/jpsim/Selfish/pull/1)

---

<div class="post-metadata">

**Author:** ![SolaWing](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/solawing/32/21701_2.png) [@SolaWing](https://forums.swift.org/u/SolaWing)\
**Post date:** [November 22, 2020, 1:48pm UTC](https://forums.swift.org/t/xcode-project-support/20927/7 "2020-11-22T13:48:47Z")

</div>

SourceKit-LSP supported BSP as a external build extension. And I extract compiler info from xcode build logs By [GitHub - SolaWing/xcode-build-server: a build server protocol implementation for integrate xcode with sourcekit-lsp](https://github.com/SolaWing/xcode-build-server) . This basicly works. except the index not accurate or update.
