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

Add Mojo support #495

Open
yosefahab opened this issue Nov 30, 2024 · 0 comments
Open

Add Mojo support #495

yosefahab opened this issue Nov 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@yosefahab
Copy link

Is your feature request related to a problem? Please describe.

Mojo configuration has been added as a locally installed server in 2804, and hence can be configured using lspconfig as:

lspconfig["mojo"].setup({
	cmd = { 'mojo-lsp-server' },
	root_dir = util.find_git_ancestor,
	single_file_support = true,
	capabilities = capabilities,
	on_attach = function(client, bufnr)
		on_attach(client, bufnr)
		vim.keymap.set("n", "<leader>fmt",
			function() vim.cmd("noa silent !mojo format --quiet " .. vim.fn.expand("%:p")) end) -- manually format document
	end,
	filetypes = { "mojo", "*.🔥" },
})

mason-lspconfig complains that the server name is not valid: [mason-lspconfig.nvim] Server "mojo" is not a valid entry in ensure_installed. Make sure to only provide lspconfig server names..

Describe the solution you'd like

Add a mapping for "mojo" to "mojo-lsp-server".

Describe potential alternatives you've considered

Current workaround is configuring mojo from lspconfig, directly bypassing mason-lspconfig as described above.

Additional context

No response

@yosefahab yosefahab added the enhancement New feature or request label Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant