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

xbase not started #242

Open
johntheocs opened this issue Dec 12, 2023 · 3 comments
Open

xbase not started #242

johntheocs opened this issue Dec 12, 2023 · 3 comments

Comments

@johntheocs
Copy link

johntheocs commented Dec 12, 2023

I used lazy.nvim to manage Xbase. It has been installed successfully.

return {
  "xbase-lab/xbase",
  lazy = false,
  dependencies = {
    "neovim/nvim-lspconfig",
  },
  build = "make install",
}

When I enter ":Lazy," the following is the loaded plugins, and xbase is loaded.

Screenshot 2023-12-12 at 1 48 18 PM

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

@johntheocs johntheocs changed the title Xbase Not Started xbase not started Dec 12, 2023
@duggthangs
Copy link

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"
}
}

@johntheocs
Copy link
Author

Thank you so much. You made my day! One more question, how can I use this plugin after all this configuration?

@bengidev
Copy link

@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"
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants