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

Fix LSP crash when opening chat #243

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lua/codeium/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ function Server:new()
cursor_offset = 0,
text = text,
line_ending = line_ending,
absolute_path = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(bufnr), ":p"),
relative_path = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(bufnr), ":"),
absolute_uri = util.get_uri(vim.api.nvim_buf_get_name(bufnr)),
relative_path_migrate_me_to_workspace_uri = util.get_relative_path(bufnr),
}

request("RefreshContextForIdeAction", {
Expand All @@ -453,8 +453,7 @@ function Server:new()
notify.error("failed refresh context: " .. err.out)
return
end
end
)
end)
end

function m.add_workspace()
Expand Down
2 changes: 1 addition & 1 deletion lua/codeium/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function M.get_newline(bufnr)
end

function M.get_relative_path(bufnr)
return vim.fn.fnamemodify(vim.api.nvim_buf_get_name(bufnr), ":")
return vim.fn.fnamemodify(vim.api.nvim_buf_get_name(bufnr), ":.")
end

function M.get_uri(path)
Expand Down
Loading