klaaspieter / coc-sourcekit Goto Github PK
View Code? Open in Web Editor NEWSwift language server extension using sourcekit-lsp for coc.nvim.
License: MIT License
Swift language server extension using sourcekit-lsp for coc.nvim.
License: MIT License
Hi, I've installed Swift Development Snapshot Toolchain and set Xcode to use it.
However, when I open a Swift file in Neovim, coc-sourcekit doesn't start.
:CocCommand workspace.showOutput
doesn't show the language server as an option.
xcrun --toolchain swift --find sourcekit-lsp
correctly shows:
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2020-02-21-a.xctoolchain/usr/bin/sourcekit-lsp
Installation prompts me to install Xcode. I'm not running on macOS (I only use the mac as a build machine).
It it not possible to install this on non-mac devices? If not, is it somehow possible to run the LSP remotely?
I am aware it is still early days for sourcekit-lsp, I'm try to use autocomplete for iOS development under vim.
I saw the previously closed issue #6 with support / a workaround for UIKit support.
I managed to get it working for swift packages and in VSCode through the example but not files in a project.
Is this expected behaviour or am I missing something?
sourcekit-lsp
seems to be included as part of XCode 11.4. Does this mean downloading a toolchain is no longer necessary ?
Overwriting "sourcekit.commandPath" doesn't work if xcrun fails.
[coc.nvim] Error on active extension coc-sourcekit: Error: exited with 72
Error: Command failed: xcrun --toolchain swift --find sourcekit-lsp
xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find sourcekit-lsp 2> /dev/null' failed with exit code 17664: (null) (errno=No such file or directory)
xcrun: error: unable to find utility "sourcekit-lsp", not a developer tool or in PATH
xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find sourcekit-lsp 2> /dev/null' failed with exit code 17664: (null) (errno=No such file or directory)
xcrun: error: unable to find utility "sourcekit-lsp", not a developer tool or in PATH
at /Users/karim/dotfiles/vim/.vim/plugged/coc.nvim/lib/util/index.js:95:24
at ChildProcess.exithandler (child_process.js:302:5)
at ChildProcess.emit (events.js:210:5)
at maybeClose (internal/child_process.js:1023:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:281:5)
The arch is x86_64
or arm64
, the full target
(also referred to as a triple
) is what the parameter you have defined should actually be called.
You need a Package.swift
dummy file. sourcekit-lsp
only works for non-trivial setups if there's a package defined for that source file. So put all your sources in a directory and add a Package.swift
file.
You need something like this in your coc.nvim settings:
"sourcekit.sdk": "iphonesimulator",
"sourcekit.targetArch": "x86_64-apple-ios14.3-simulator"
I found a hack which make iOS Module work in vscode, can we able to make it work for coc-sourcekit
https://funnyitworkedlasttime.dev/posts/2020-01-10-swift-vscode-sourcekit-lsp/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.