Skip to content

Commit

Permalink
fix rime-ls
Browse files Browse the repository at this point in the history
  • Loading branch information
TwIStOy committed Feb 8, 2024
1 parent 397771c commit 9d16364
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions lua/ht/conf/lsp/servers/rime_ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,26 @@ local function rime_on_attach(client, bufnr)
)
end

local deploy_rime = function()
client.request(
"workspace/executeCommand",
{ command = "rime-ls.deploy" },
function(_, result, ctx, _)
if ctx.client_id == client.id then
vim.g.global_rime_enabled = result
end
end
)
end

vim.keymap.set({ "n", "i" }, "<M-;>", function()
toggle_rime()
end, { silent = true, desc = "rime-toggle", buffer = bufnr })

vim.api.nvim_create_user_command("RimeDeploy", function()
deploy_rime()
end, {})

if vim.api.nvim_buf_get_option(bufnr, "ft") == "markdown" then
local toggle_markdown_code = function()
if vim.g.previous_markdown_code ~= nil then
Expand Down Expand Up @@ -83,11 +99,10 @@ A language server for librime
require("lspconfig").rime_ls.setup {
cmd = { "rime_ls" },
init_options = {
enabled = false,
-- shared_data_dir = "/usr/share/rime-data",
shared_data_dir = "~/.local/share/rime-ls",
user_data_dir = "~/.local/share/rime-ls",
log_dir = "~/.local/share/rime-ls/log",
enabled = true,
shared_data_dir = "~/.local/share/rime-ls-data-files",
user_data_dir = "~/.local/share/rime-ls-files",
log_dir = "~/.local/share/rime-ls-files/log",
max_candidates = 9,
trigger_characters = {},
schema_trigger_character = "&",
Expand Down

0 comments on commit 9d16364

Please sign in to comment.