Open johntheocs opened 9 months ago
Hey @johntheocs, i don't see you calling the "setup" function in the Xbase config. Here is my lazy config, hopefully this can help:
{
'xbase-lab/xbase',
dependencies = {
'neovim/nvim-lspconfig',
},
build = "make install",
config = function()
require 'xbase'.setup {
log_level = vim.log.levels.DEBUG,
simctl = {
iOS = {
"iPhone 15 Pro"
}
},
mappings = {
build_picker = 0,
run_picker = 0,
watch_picker = 0,
all_picker = 0,
toggle_split_log_buffer = 0,
toggle_vsplit_log_buffer = 0
}
}
end
},
Also, don't forget to set up sourcekit-lsp. Here is my lspconfig:
lspconfig.sourcekit.setup {
capabilities = capabilities,
on_attach = function(arg1, arg2)
vim.keymap.set('n', '<leader>dp', require "xbase.pickers.builtin".actions, { desc = "XBase picker" })
vim.keymap.set('n', '<leader>dl', function()
require "xbase.logger".toggle(false, true)
end, { desc = "XBase logger" })
return on_attach(arg1, arg2)
end,
filetypes = { "swift" },
root_dir = lspconfig.util.root_pattern("*.xcodeproj", "*.xcworkspace", "Package.swift", ".git", "project.yml", "Project.swift"),
cmd = {
"xcrun",
"sourcekit-lsp",
"--log-level",
"debug"
}
}
Thank you so much. You made my day! One more question, how can I use this plugin after all this configuration?
@duggthangs , where do you put this codes?
lspconfig.sourcekit.setup {
capabilities = capabilities,
on_attach = function(arg1, arg2)
vim.keymap.set('n', '<leader>dp', require "xbase.pickers.builtin".actions, { desc = "XBase picker" })
vim.keymap.set('n', '<leader>dl', function()
require "xbase.logger".toggle(false, true)
end, { desc = "XBase logger" })
return on_attach(arg1, arg2)
end,
filetypes = { "swift" },
root_dir = lspconfig.util.root_pattern("*.xcodeproj", "*.xcworkspace", "Package.swift", ".git", "project.yml", "Project.swift"),
cmd = {
"xcrun",
"sourcekit-lsp",
"--log-level",
"debug"
}
}
I used lazy.nvim to manage Xbase. It has been installed successfully.
When I enter ":Lazy," the following is the loaded plugins, and xbase is loaded.
However, when I open a Object C/Swift project directory, nothing happens. No Xbase related process. Also, there is no file named xbase.log in /tmp directory. Anything I missed?
Thanks