Coder Social home page Coder Social logo

klaaspieter / coc-sourcekit Goto Github PK

View Code? Open in Web Editor NEW
72.0 4.0 9.0 65 KB

Swift language server extension using sourcekit-lsp for coc.nvim.

License: MIT License

JavaScript 52.65% TypeScript 45.88% Shell 1.47%
swift coc sourcekit sourcekit-lsp vim neovim

coc-sourcekit's People

Contributors

dependabot[bot] avatar keith avatar klaaspieter avatar lebje avatar supermarin avatar zoho-gold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

coc-sourcekit's Issues

How to use this extension

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

Running outside macOS?

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?

Hover not found

Thanks for putting together this fantastic plugin.

I noticed a minor issue where cocAction('doHover') does not work for all the elements.
The autocomplete feature, on the other hand, happily shows the prototype/documentation.

Screenshot 2022-12-17 at 6 22 58 PM
Screenshot 2022-12-17 at 6 23 25 PM
Screenshot 2022-12-17 at 6 24 57 PM

No such module 'UIKit'

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?

Crashes when xcrun has non zero exit code

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)

`targetArch` is the wrong term

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.

How to get this to work for iOS apps

  1. 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.

  2. You need something like this in your coc.nvim settings:

"sourcekit.sdk": "iphonesimulator",
"sourcekit.targetArch": "x86_64-apple-ios14.3-simulator"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.