wojciech-kulik / ios-dev-starter-nvim

Bootstrap for iOS development in Neovim + LazyVim
MIT License
79 stars 2 forks source link

How to make it works for cocoapods and vscode #3

Closed weaming closed 7 months ago

weaming commented 7 months ago

I generated buildServer.json by following the steps in your blog https://wojciechkulik.pl/ios/the-complete-guide-to-ios-macos-development-in-neovim, but do not know how to make it works for cocoapods (xxx.xcworkspace which works in Xcode) and vscode. By the way, I use https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang extension to start sourcekit-lsp.

{
    "name": "xcode build server",
    "version": "0.2",
    "bspVersion": "2.0",
    "languages": [
        "c",
        "cpp",
        "objective-c",
        "objective-cpp",
        "swift"
    ],
    "argv": [
        "/usr/local/bin/xcode-build-server"
    ],
    "workspace": "/Users/xxx/src/swift/iPush/iPush.xcworkspace",
    "build_root": "/Users/garden/Library/Developer/Xcode/DerivedData/iPush-dpxqkztzxzphizacjbclljrvvxvy",
    "scheme": "iPush",
    "kind": "xcode"
}
wojciech-kulik commented 7 months ago

Did you configure LSP? It should work out of the box if buildServer.json is generated.

If LSP doesn't work properly usually it helps to clean build the project from Xcode, run xcode-build-server command again and run vim. Make sure that buildServer.json is in your root dir and that your root dir is properly set in LSP. Run: :LspInfo and :LspLog.

weaming commented 7 months ago

But I use VS Code, not vim. Forget it if you do not familiar with VSCode.

wojciech-kulik commented 7 months ago

It should work out of the box if LSP is properly configured and buildServer.json is generated. Probably your LSP sets incorrectly root.

Here is my small guide to VS Code, you can check it out as well: https://wojciechkulik.pl/ios/how-to-develop-ios-and-macos-apps-in-other-ides-like-neovim-or-vs-code