kkharji / xbase

Develop Apple software products within your favorite editor.
MIT License
537 stars 17 forks source link

sourcekit-lsp failed to attach to the buffer #227

Closed csyJoy closed 1 year ago

csyJoy commented 1 year ago

Editor/Client you used

Neovim

Installation and Dependences checklist

Description

I use `Lazy.nvim` as my nvim package manager, I use the following lua script to download this plugin.

lang["xbase-lab/xbase"] = {
    lazy = true,
    ft = "swift",
    build = "make install",
    dependencies = {
        "nvim-lua/plenary.nvim",
        "nvim-telescope/telescope.nvim",
        "neovim/nvim-lspconfig",
    },
    config = require("lang.xbase"),
}

The configuration of the plugin is the default configuration.
```lua
# lang.xbase.lua
return function()
    require("xbase").setup({})
end

when I opened a swift project, Lazy.nvim installed xbase and built it successfully, but when I used :LspInfo, I found sourcekit-lsp did not attach to the nvim buffer.

Expected behavior

No response

Reproduce

1. install `xbase`
2. open a swift project `nvim foo.swift`
3. use `:LspInfo` to check
4. `sourcekit-lsp` does not attach to the nvim buffer.

Actual behavior

`sourcekit-lsp` does not attach to the nvim buffer.

Operating system and version

macOS 13.4

xbase version / branch / rev

master

Neovim version

NVIM v0.9.1

Vscode version (if the editor you used is vscode)

No response

Installed XCode Developer Tools

Developer:

    Developer Tools:

      Version: 14.2 (14C18)
      Location: /Applications/Xcode.app
      Applications:
          Xcode: 14.2 (21534)
          Instruments: 14.1 (64556.12)
      SDKs:
          DriverKit:
              22.2:
          iOS:
              16.2: (20C52)
          iOS Simulator:
              16.2: (20C52)
          macOS:
              13.1: (22C55)
          tvOS:
              16.1: (20K67)
          tvOS Simulator:
              16.1: (20K67)
          watchOS:
              9.1: (20S71)
          watchOS Simulator:
              9.1: (20S71)

XBase Logs

INFO SERVER STARTED
 INFO Client{fd=13}: Connected
 INFO Runtime{name="WeSplit"}: [Initializing] ------------------------
 INFO Broadcaster{name="WeSplit"}: Created
 INFO Runtime{name="WeSplit"}: targets: {"WeSplit": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }}
 INFO Broadcaster{name="WeSplit"}: Connected [33601]
 INFO Runtime{name="WeSplit"}: Connected [33601]
 INFO FSWatcher{name="WeSplit"}: Watching
 INFO Runtime{name="WeSplit"}: [Initialized] -------------------------

XBase Build Server Logs

No response

csyJoy commented 1 year ago

here is the result of :LspInfo

image
csyJoy commented 1 year ago

when I add require("lspconfig").sourcekit.setup({}) in xbase.lua the problem was solved. It seems that sourcekit-lsp isn't launched by xbase, In the installation guide I find a note for sourcekit-lsp, is this note for all nvim package manager ? or just for the dein? also, after sloving this problem, I encounter a problem same as #224 , and #226 LGTM.