Sonic Pi intergration improved by configuring solargraph
This commit is contained in:
14
lua/lsp.lua
14
lua/lsp.lua
@@ -83,6 +83,20 @@ require('mason-lspconfig').setup_handlers({
|
|||||||
-- and will be called for each installed server that doesn't have
|
-- and will be called for each installed server that doesn't have
|
||||||
-- a dedicated handler.
|
-- a dedicated handler.
|
||||||
function(server_name) -- default handler (optional)
|
function(server_name) -- default handler (optional)
|
||||||
|
|
||||||
|
-- 2024-10-29 Solargraph shall handle ruby AND sonicpi files, add on_init according to documentation
|
||||||
|
if server_name == "solargraph" then
|
||||||
|
lspconfig[server_name].setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
config = {
|
||||||
|
on_init = function(client)
|
||||||
|
require('sonicpi').lsp_on_init(client, { server_dir = '/opt/sonic-pi/app/server' })
|
||||||
|
end
|
||||||
|
},
|
||||||
|
filetypes = { 'ruby', 'sonicpi' },
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
if server_name == 'ts_ls' then
|
if server_name == 'ts_ls' then
|
||||||
-- taken from https://github.com/vuejs/language-tools
|
-- taken from https://github.com/vuejs/language-tools
|
||||||
-- If you are using mason.nvim, you can get the ts_plugin_path like this
|
-- If you are using mason.nvim, you can get the ts_plugin_path like this
|
||||||
|
|||||||
@@ -448,17 +448,32 @@ require("lazy").setup({
|
|||||||
},
|
},
|
||||||
|
|
||||||
-- -- Live Coding: sonic-pi music programming
|
-- -- Live Coding: sonic-pi music programming
|
||||||
-- {
|
{
|
||||||
-- 'magicmonty/sonicpi.nvim',
|
'magicmonty/sonicpi.nvim',
|
||||||
-- -- broken if used here, setup called further below
|
-- broken if used here, setup called further below
|
||||||
-- -- config = function()
|
config = function()
|
||||||
-- -- require('sonicpi').setup()
|
require('sonicpi').setup({
|
||||||
-- -- end,
|
server_dir = '/opt/sonic-pi/app/server',
|
||||||
-- dependencies = {
|
lsp_diagnostics = true,
|
||||||
-- 'hrsh7th/nvim-cmp',
|
mappings = {
|
||||||
-- 'kyazdani42/nvim-web-devicons'
|
{ 'n', '<leader>d', ':SonicPiStartDaemon<CR>', { desc = 'Sonic Pi: start daemon' } },
|
||||||
-- },
|
{ 'n', '<leader>s', require('sonicpi.remote').stop, { desc = 'Sonic Pi: stop' } },
|
||||||
-- },
|
{ 'i', '<M-s>', require('sonicpi.remote').stop, { desc = 'Sonic Pi: stop' } },
|
||||||
|
{ 'n', '<leader>r', require('sonicpi.remote').run_current_buffer, { desc = 'Sonic Pi: run' } },
|
||||||
|
{ 'i', '<M-r>', require('sonicpi.remote').run_current_buffer, { desc = 'Sonic Pi: run' } },
|
||||||
|
{ 'n', '<leader>R', ':SonicPiSendBuffer<CR>', { desc = 'Sonic Pi: send buffer' } },
|
||||||
|
{ 'i', '<M-R>', ':SonicPiSendBuffer<CR>', { desc = 'Sonic Pi: send buffer' } },
|
||||||
|
-- // TODO.2024-10-29 implement sending of tree-sitter node
|
||||||
|
{ 'n', '<C-H>', function() end, { desc = 'Sonic Pi: send current' } },
|
||||||
|
},
|
||||||
|
single_file = true,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
'kyazdani42/nvim-web-devicons'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- easy term on a shortcut
|
-- easy term on a shortcut
|
||||||
{
|
{
|
||||||
@@ -487,17 +502,3 @@ require("lazy").setup({
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- require('sonicpi').setup({
|
|
||||||
-- server_dir = '/opt/sonic-pi/app/server',
|
|
||||||
-- mappings = {
|
|
||||||
-- { 'n', '<leader>d', ':SonicPiStartDaemon<CR>', { desc = 'Sonic Pi: start daemon' } },
|
|
||||||
-- { 'n', '<leader>s', require('sonicpi.remote').stop, { desc = 'Sonic Pi: stop' } },
|
|
||||||
-- { 'i', '<M-s>', require('sonicpi.remote').stop, { desc = 'Sonic Pi: stop' } },
|
|
||||||
-- { 'n', '<leader>r', require('sonicpi.remote').run_current_buffer, { desc = 'Sonic Pi: run' } },
|
|
||||||
-- { 'i', '<M-r>', require('sonicpi.remote').run_current_buffer, { desc = 'Sonic Pi: run' } },
|
|
||||||
-- { 'n', '<leader>R', ':SonicPiSendBuffer<CR>', { desc = 'Sonic Pi: send buffer' } },
|
|
||||||
-- { 'i', '<M-R>', ':SonicPiSendBuffer<CR>', { desc = 'Sonic Pi: send buffer' } },
|
|
||||||
-- },
|
|
||||||
-- single_file = true,
|
|
||||||
-- })
|
|
||||||
|
|||||||
Reference in New Issue
Block a user