Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source kit lsp is not working because unknown argument in .compile file #237

Open
2 tasks done
WERDXZ opened this issue Aug 17, 2023 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@WERDXZ
Copy link

WERDXZ commented Aug 17, 2023

Editor/Client you used

Neovim

Installation and Dependences checklist

  • xbase is installed and ~/.local/share/xbase has required binaries
  • All listed editor/client dependences is installed

Description

sourcekit-lsp attached but not working, lsp logs as follow:

[START][2023-08-16 23:29:28] LSP logging initiated
[ERROR][2023-08-16 23:29:28] .../vim/lsp/rpc.lua:734	"rpc"	"/usr/bin/xcrun"	"stderr"	"[2023-08-16 23:29:28.286] error response (Request Failed): error: unknown argument: '-use-frontend-parseable-output'\n"
[START][2023-08-16 23:31:41] LSP logging initiated
[ERROR][2023-08-16 23:31:41] .../vim/lsp/rpc.lua:734	"rpc"	"/usr/bin/xcrun"	"stderr"	"[2023-08-16 23:31:41.220] error response (Request Failed): error: unknown argument: '-use-frontend-parseable-output'\n"

Expected behavior

lsp should work, e.g. give completion, diagnosis, symbols ...

Reproduce

neovim + lazy.nvim + tuist with config as follow:

{
	"xbase-lab/xbase",
	build = "make install",
	dependencies = { "neovim/nvim-lspconfig", "nvim-telescope/telescope.nvim" },
	ft = {
		"swift",
		"objcpp",
		"objc",
	},
	opts = {
		mappings = {
			build_picker = "<leader>B",
			run_picker = "<leader>pr",
			watch_picker = "<leader>pw",
			all_picker = "<leader>pa",
			toggle_split_log_buffer = "<leader>dlh",
			toggle_vsplit_log_buffer = "<leader>dlv",
		},
	},
},

```lua
{
	"neovim/nvim-lspconfig",
	event = { "BufReadPre", "BufNewFile" },
	dependencies = { "folke/neoconf.nvim" },
	---@class PluginLspOpts
	opts = {
		-- options for vim.diagnostic.config()
		diagnostics = {
			underline = true,
			update_in_insert = false,
			virtual_text = { spacing = 4, prefix = "" },
			severity_sort = true,
		},
		-- Automatically format on save
		autoformat = false,
		-- options for vim.lsp.buf.format
		-- but can be also overridden when specified
		format = {
			formatting_options = nil,
			timeout_ms = nil,
		},
		-- LSP Server Settings
		servers = {
			lua_ls = {
				completion = {
					callSnippet = "Replace",
				},
			},
			eslint = {
				filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact" },
				root_dir = function(fname)
					return require("lspconfig").util.root_pattern("package.json", ".git")(fname)
						or require("lspconfig").util.find_git_ancestor(fname)
						or vim.loop.os_homedir()
				end,
			},
			asm_lsp = {
				filetypes = { "asm", "nasm" },
			},
			clangd = {
				-- filetypes = { "c", "cpp"},
				on_attach = function(client, bufnr)
					-- clangd extensions
					require("clangd_extensions").on_attach(client, bufnr)
					require("lazy").load({
						plugins = "clangd_extensions",
					})
				end,
			},
			sourcekit = {
				cmd = {"xcrun", "sourcekit-lsp", "--log-level", "error" },
				filetypes = { "swift", "c", "cpp", "objective-c", "objective-cpp", "objc", "objcpp" },
			}
		},
	},
	config = function(_, opts)
		local servers = opts.servers
		local capabilities =
			require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())

		local setup = function(server)
			local server_opts = vim.tbl_deep_extend("force", {
				capabilities = vim.deepcopy(capabilities),
			}, servers[server] or {})
			require("lspconfig")[server].setup(server_opts)
		end

		-- get all the servers that are available thourgh mason-lspconfig
		local mlsp = require("mason-lspconfig")
		local all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package)

		local ensure_installed = {}
		for server, server_opts in pairs(servers) do
			if server_opts then
				server_opts = server_opts == true and {} or server_opts
				-- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig
				if not vim.tbl_contains(all_mslp_servers, server) then
					setup(server)
				else
					ensure_installed[#ensure_installed + 1] = server
				end
			end
		end
		mlsp.setup_handlers({ setup })
		mlsp.setup({ ensure_installed = ensure_installed })
	end,
	keys = {
		{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
	},
},
  1. tuist init --platform ios
  2. edit any swift file
    at the first time when you edit the file the lsp didn't auto start, and if you start it manually, it still not working and give no logs in the lsp.log
  3. edit any swift file again


### Actual behavior

```Markdown
type something and there is not lsp completion

lsp log:
[START][2023-08-16 23:29:28] LSP logging initiated
[ERROR][2023-08-16 23:29:28] .../vim/lsp/rpc.lua:734	"rpc"	"/usr/bin/xcrun"	"stderr"	"[2023-08-16 23:29:28.286] error response (Request Failed): error: unknown argument: '-use-frontend-parseable-output'\n"
[START][2023-08-16 23:31:41] LSP logging initiated
[ERROR][2023-08-16 23:31:41] .../vim/lsp/rpc.lua:734	"rpc"	"/usr/bin/xcrun"	"stderr"	"[2023-08-16 23:31:41.220] error response (Request Failed): error: unknown argument: '-use-frontend-parseable-output'\n"

xbase log:
INFO Client{fd=13}: Connected
 INFO Runtime{name="Temp"}: [Initializing] ------------------------
 INFO Broadcaster{name="Temp"}: Created
 INFO Runtime{name="Temp"}: no xcodeproj found at "/Users/werdxz/Projects/ios/temp"
 WARN Runtime{name="Temp"}: Expected `2` xcodeproj Manifest and Main but found `3`
 INFO Runtime{name="Temp"}: [Temp] targets: {"TempUITests": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempKitTests": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempUI": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempKit": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "Temp": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempTests": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }}
 INFO Broadcaster{name="Temp"}: Connected [27792]
 INFO Runtime{name="Temp"}: Creating "/Users/werdxz/Projects/ios/temp/buildServer.json"
 INFO Runtime{name="Temp"}: Building Manifest ...
 INFO Runtime{name="Temp"}: Building Temp-Workspace ...
 INFO Runtime{name="Temp"}: Connected [27792]
 INFO Runtime{name="Temp"}: [Initialized] -------------------------
 INFO FSWatcher{name="Temp"}: Watching
 INFO Client{fd=13}: Disconnected
 INFO Runtime{name="Temp"}: Disconnected [27792]
 INFO Runtime{name="Temp"}: [Dropped]
 INFO Broadcaster{name="Temp"}: [Dropped]
 INFO FSWatcher{name="Temp"}: [Dropped]
 INFO Client{fd=13}: Connected
 INFO Runtime{name="Temp"}: [Initializing] ------------------------
 INFO Broadcaster{name="Temp"}: Created
 WARN Runtime{name="Temp"}: Expected `2` xcodeproj Manifest and Main but found `3`
 INFO Runtime{name="Temp"}: [Temp] targets: {"TempTests": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempUITests": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "Temp": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempUI": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempKitTests": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempKit": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }}
 INFO Runtime{name="Temp"}: Connected [29010]
 INFO Runtime{name="Temp"}: [Initialized] -------------------------
ERROR Broadcaster{name="Temp"}: [CLIENT WITH 29010 NOT FOUND]
ERROR Broadcaster{name="Temp"}: [CLIENT WITH 29010 NOT FOUND]
ERROR Broadcaster{name="Temp"}: [CLIENT WITH 29010 NOT FOUND]
 INFO FSWatcher{name="Temp"}: Watching
 INFO Broadcaster{name="Temp"}: Connected [29010]

xbase build server log:
 INFO xbase_sourcekit_helper: Started
 INFO xbase_sourcekit_helper: Initialized
DEBUG xbase_sourcekit_helper: [TempKit.swift] Querying compile_db
 INFO xbase_sourcekit_helper: 
 INFO xbase_sourcekit_helper: Started
 INFO xbase_sourcekit_helper: Initialized
DEBUG xbase_sourcekit_helper: [Project.swift] Querying compile_db
 INFO xbase_sourcekit_helper: 

Operating system and version

macOS 13.4.1

xbase version / branch / rev

xbase 0.3.0

Neovim version

NVIM v0.9.1 release

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 Client{fd=13}: Connected
 INFO Runtime{name="Temp"}: [Initializing] ------------------------
 INFO Broadcaster{name="Temp"}: Created
 INFO Runtime{name="Temp"}: no xcodeproj found at "/Users/werdxz/Projects/ios/temp"
 WARN Runtime{name="Temp"}: Expected `2` xcodeproj Manifest and Main but found `3`
 INFO Runtime{name="Temp"}: [Temp] targets: {"TempUITests": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempKitTests": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempUI": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempKit": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "Temp": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempTests": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }}
 INFO Broadcaster{name="Temp"}: Connected [27792]
 INFO Runtime{name="Temp"}: Creating "/Users/werdxz/Projects/ios/temp/buildServer.json"
 INFO Runtime{name="Temp"}: Building Manifest ...
 INFO Runtime{name="Temp"}: Building Temp-Workspace ...
 INFO Runtime{name="Temp"}: Connected [27792]
 INFO Runtime{name="Temp"}: [Initialized] -------------------------
 INFO FSWatcher{name="Temp"}: Watching
 INFO Client{fd=13}: Disconnected
 INFO Runtime{name="Temp"}: Disconnected [27792]
 INFO Runtime{name="Temp"}: [Dropped]
 INFO Broadcaster{name="Temp"}: [Dropped]
 INFO FSWatcher{name="Temp"}: [Dropped]
 INFO Client{fd=13}: Connected
 INFO Runtime{name="Temp"}: [Initializing] ------------------------
 INFO Broadcaster{name="Temp"}: Created
 WARN Runtime{name="Temp"}: Expected `2` xcodeproj Manifest and Main but found `3`
 INFO Runtime{name="Temp"}: [Temp] targets: {"TempTests": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempUITests": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "Temp": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempUI": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempKitTests": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }, "TempKit": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }}
 INFO Runtime{name="Temp"}: Connected [29010]
 INFO Runtime{name="Temp"}: [Initialized] -------------------------
ERROR Broadcaster{name="Temp"}: [CLIENT WITH 29010 NOT FOUND]
ERROR Broadcaster{name="Temp"}: [CLIENT WITH 29010 NOT FOUND]
ERROR Broadcaster{name="Temp"}: [CLIENT WITH 29010 NOT FOUND]
 INFO FSWatcher{name="Temp"}: Watching
 INFO Broadcaster{name="Temp"}: Connected [29010]

XBase Build Server Logs

INFO xbase_sourcekit_helper: Started
 INFO xbase_sourcekit_helper: Initialized
DEBUG xbase_sourcekit_helper: [TempKit.swift] Querying compile_db
 INFO xbase_sourcekit_helper: 
 INFO xbase_sourcekit_helper: Started
 INFO xbase_sourcekit_helper: Initialized
DEBUG xbase_sourcekit_helper: [Project.swift] Querying compile_db
 INFO xbase_sourcekit_helper: 
@WERDXZ WERDXZ added the bug Something isn't working label Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant