Skip to content

Commit 695f01e

Browse files
committed
ok bryant
1 parent b43facf commit 695f01e

File tree

11 files changed

+146
-459
lines changed

11 files changed

+146
-459
lines changed

xdg_config/nvim/after/plugin/dap.lua

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -363,81 +363,81 @@ dap_python.setup("python", {
363363

364364
dap_python.test_runner = "pytest"
365365

366-
dap.adapters.lldb = {
367-
type = "executable",
368-
command = "/usr/bin/lldb-vscode-11",
369-
name = "lldb",
370-
}
371-
372-
local extension_path = vim.fn.expand "~/.vscode/extensions/vadimcn.vscode-lldb-1.6.10/"
373-
local codelldb_path = extension_path .. "adapter/codelldb"
374-
local liblldb_path = extension_path .. "lldb/lib/liblldb.so"
366+
-- dap.adapters.lldb = {
367+
-- type = "executable",
368+
-- command = "/usr/bin/lldb-vscode-11",
369+
-- name = "lldb",
370+
-- }
375371

372+
-- local extension_path = vim.fn.expand "~/.vscode/extensions/vadimcn.vscode-lldb-1.7.0/"
373+
-- local codelldb_path = extension_path .. "adapter/codelldb"
374+
-- local liblldb_path = extension_path .. "lldb/lib/liblldb.so"
375+
--
376376
-- dap.adapters.rt_lldb = {
377377
-- type = "executable",
378378
-- command = codelldb_path,
379379
-- name = "rt_lldb",
380380
-- }
381381

382-
dap.adapters.rt_lldb = function(callback, _)
383-
local stdout = vim.loop.new_pipe(false)
384-
local stderr = vim.loop.new_pipe(false)
385-
local handle
386-
local pid_or_err
387-
local port
388-
local error_message = ""
389-
390-
local opts = {
391-
stdio = { nil, stdout, stderr },
392-
args = { "--liblldb", liblldb_path },
393-
detached = true,
394-
}
395-
396-
handle, pid_or_err = vim.loop.spawn(codelldb_path, opts, function(code)
397-
stdout:close()
398-
stderr:close()
399-
handle:close()
400-
if code ~= 0 then
401-
print("codelldb exited with code", code)
402-
print("error message", error_message)
403-
end
404-
end)
405-
406-
assert(handle, "Error running codelldb: " .. tostring(pid_or_err))
407-
408-
stdout:read_start(function(err, chunk)
409-
assert(not err, err)
410-
if chunk then
411-
if not port then
412-
local chunks = {}
413-
for substring in chunk:gmatch "%S+" do
414-
table.insert(chunks, substring)
415-
end
416-
port = tonumber(chunks[#chunks])
417-
vim.schedule(function()
418-
callback {
419-
type = "server",
420-
host = "127.0.0.1",
421-
port = port,
422-
}
423-
end)
424-
else
425-
vim.schedule(function()
426-
require("dap.repl").append(chunk)
427-
end)
428-
end
429-
end
430-
end)
431-
stderr:read_start(function(_, chunk)
432-
if chunk then
433-
error_message = error_message .. chunk
434-
435-
vim.schedule(function()
436-
require("dap.repl").append(chunk)
437-
end)
438-
end
439-
end)
440-
end
382+
-- dap.adapters.rt_lldb = function(callback, _)
383+
-- local stdout = vim.loop.new_pipe(false)
384+
-- local stderr = vim.loop.new_pipe(false)
385+
-- local handle
386+
-- local pid_or_err
387+
-- local port
388+
-- local error_message = ""
389+
--
390+
-- local opts = {
391+
-- stdio = { nil, stdout, stderr },
392+
-- args = { "--liblldb", liblldb_path },
393+
-- detached = true,
394+
-- }
395+
--
396+
-- handle, pid_or_err = vim.loop.spawn(codelldb_path, opts, function(code)
397+
-- stdout:close()
398+
-- stderr:close()
399+
-- handle:close()
400+
-- if code ~= 0 then
401+
-- print("codelldb exited with code", code)
402+
-- print("error message", error_message)
403+
-- end
404+
-- end)
405+
--
406+
-- assert(handle, "Error running codelldb: " .. tostring(pid_or_err))
407+
--
408+
-- stdout:read_start(function(err, chunk)
409+
-- assert(not err, err)
410+
-- if chunk then
411+
-- if not port then
412+
-- local chunks = {}
413+
-- for substring in chunk:gmatch "%S+" do
414+
-- table.insert(chunks, substring)
415+
-- end
416+
-- port = tonumber(chunks[#chunks])
417+
-- vim.schedule(function()
418+
-- callback {
419+
-- type = "server",
420+
-- host = "127.0.0.1",
421+
-- port = port,
422+
-- }
423+
-- end)
424+
-- else
425+
-- vim.schedule(function()
426+
-- require("dap.repl").append(chunk)
427+
-- end)
428+
-- end
429+
-- end
430+
-- end)
431+
-- stderr:read_start(function(_, chunk)
432+
-- if chunk then
433+
-- error_message = error_message .. chunk
434+
--
435+
-- vim.schedule(function()
436+
-- require("dap.repl").append(chunk)
437+
-- end)
438+
-- end
439+
-- end)
440+
-- end
441441

442442
dap.configurations.rust = {
443443
{
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
vim.filetype.add {
2+
extension = {
3+
fnl = "fennel",
4+
},
5+
}

xdg_config/nvim/after/plugin/rust_nvim.lua

Lines changed: 0 additions & 111 deletions
This file was deleted.

xdg_config/nvim/after/plugin/treesitter.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ local _ = require("nvim-treesitter.configs").setup {
7070
"markdown",
7171
"python",
7272
"query",
73+
"racket",
7374
"rust",
7475
"toml",
7576
"tsx",

xdg_config/nvim/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ end
7373
-- if you have any mappings you set BEFORE doing this, they will be set to the OLD
7474
-- leader.
7575
vim.g.mapleader = ","
76+
vim.g.maplocalleader = " "
7677

7778
-- I set some global variables to use as configuration throughout my config.
7879
-- These don't have any special meaning.

xdg_config/nvim/lua/tj/lsp/init.lua

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ local filetype_attach = setmetatable({
5959
end,
6060

6161
rust = function()
62-
-- vim.cmd [[
63-
-- autocmd BufEnter,BufWritePost <buffer> :lua require('lsp_extensions.inlay_hints').request {aligned = true, prefix = " » "}
64-
-- ]]
65-
6662
telescope_mapper("<space>wf", "lsp_workspace_symbols", {
6763
ignore_filename = true,
6864
query = "#",
@@ -71,6 +67,10 @@ local filetype_attach = setmetatable({
7167
autocmd_format(false)
7268
end,
7369

70+
racket = function()
71+
autocmd_format(false)
72+
end,
73+
7474
typescript = function()
7575
autocmd_format(false, function(client)
7676
return client.name ~= "tsserver"
@@ -164,11 +164,37 @@ if nvim_status then
164164
end
165165
updated_capabilities.textDocument.codeLens = { dynamicRegistration = false }
166166
updated_capabilities = require("cmp_nvim_lsp").update_capabilities(updated_capabilities)
167-
168-
-- TODO: check if this is the problem.
169167
updated_capabilities.textDocument.completion.completionItem.insertReplaceSupport = false
170168

171-
-- vim.lsp.buf_request(0, "textDocument/codeLens", { textDocument = vim.lsp.util.make_text_document_params() })
169+
local rust_analyzer
170+
171+
local has_rt, rt = pcall(require, "rust-tools")
172+
if has_rt then
173+
local extension_path = vim.fn.expand "~/.vscode/extensions/sadge-vscode/extension/"
174+
local codelldb_path = extension_path .. "adapter/codelldb"
175+
local liblldb_path = extension_path .. "lldb/lib/liblldb.so"
176+
177+
rt.setup {
178+
server = {
179+
cmd = { "rustup", "run", "nightly", "rust-analyzer" },
180+
capabilities = updated_capabilities,
181+
on_attach = custom_attach,
182+
},
183+
dap = {
184+
adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path),
185+
},
186+
tools = {
187+
inlay_hints = {
188+
auto = false,
189+
},
190+
},
191+
}
192+
else
193+
rust_analyzer = {
194+
cmd = { "rustup", "run", "nightly", "rust-analyzer" },
195+
-- cmd = { "rust-analyzer" },
196+
}
197+
end
172198

173199
local servers = {
174200

@@ -230,10 +256,9 @@ local servers = {
230256
cmd = { vim.fn.expand "~/build/omnisharp/run", "--languageserver", "--hostPID", tostring(vim.fn.getpid()) },
231257
},
232258

233-
rust_analyzer = {
234-
cmd = { "rustup", "run", "nightly", "rust-analyzer" },
235-
-- cmd = { "rust-analyzer" },
236-
},
259+
rust_analyzer = rust_analyzer,
260+
261+
racket_langserver = true,
237262

238263
elmls = true,
239264
cssls = true,

0 commit comments

Comments
 (0)