Skip to content

如何删除初始化报警? #53

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

Closed
cxwx opened this issue Mar 29, 2025 · 10 comments · Fixed by #54
Closed

如何删除初始化报警? #53

cxwx opened this issue Mar 29, 2025 · 10 comments · Fixed by #54

Comments

@cxwx
Copy link

cxwx commented Mar 29, 2025

每次打开nvim初始化 都会显示,

Image

配置如下:

  vim.system({vim.fn.expand('~/software/im/rime-ls/target/release/rime_ls'), '--listen', '127.0.0.1:'..rimeport}, {detach = false})
  vim.g.rime_enabled = true

        if not configs.rime_ls then
          configs.rime_ls = {
            default_config = {
              name = "rime_ls",
              cmd = vim.lsp.rpc.connect("127.0.0.1", tonumber(rimeport)),  -- DONE:
              root_dir = util.root_pattern(".obsidian", ".git", ".vim"), -- INFO:neoconf need?
              single_file_support = true,
              filetypes = { '*' },
            },
            settings = {},
          }
        end
        local rime_on_attach = function(client, _)
          local toggle_rime = function() client.request("workspace/executeCommand", { command = "rime-ls.toggle-rime" }, function(_, result, ctx, _) if ctx.client_id == client.id then vim.g.rime_enabled = result end end) end
          vim.keymap.set({ "i", "n" }, "<C-;>", function() toggle_rime() end, { desc = "toggle rime" })
          vim.keymap.set("n", "<space>ris", function() vim.lsp.buf.execute_command({command = "rime-ls.sync-user-data"}) vim.notify("need restart rime-ls server yourself", vim.log.levels.INFO) end, {desc = "rime sync user data"})
        end
        local capabilities3 = vim.lsp.protocol.make_client_capabilities()
        capabilities3 = require("cmp_nvim_lsp").default_capabilities(capabilities3) --TODO: really need?
        -- SOLVED:  github:wlh320/rime-ls/issues/38#issuecomment-2559780016
        lspconfig.rime_ls.setup({
          autostart = alllsp.rime_ls,
          init_options = {
            enabled = vim.g.rime_enabled,
            -- shared_data_dir = "/Library/Input Methods/Squirrel.app/Contents/SharedSupport/",
            shared_data_dir = vim.fn.expand("~/Library/Rime"),
            user_data_dir = vim.fn.expand("~/rc/rime/"),
            log_dir = vim.fn.expand("~/cache/rimelog"),
            trigger_characters = {},
            schema_trigger_character = "&",
            max_candidates = 4,
          },
          on_attach = rime_on_attach,
          capabilities = capabilities3,
        })

@wlh320
Copy link
Owner

wlh320 commented Mar 29, 2025

这是提示一下是远程连接到一个共用的服务上了,目前远程连到一个已经初始化了的服务就会提示。

我这也每次显示,但没有说让我按 enter 继续,完全可以无视,不知道是哪里配置导致的不一样。

@cxwx
Copy link
Author

cxwx commented Mar 30, 2025

我更新到 nvim-0.11 出了下面enter的提示,应该是 lsp 有变化,无法直接登入影响使用

这是提示一下是远程连接到一个共用的服务上了,目前远程连到一个已经初始化了的服务就会提示。

我这也每次显示,但没有说让我按 enter 继续,完全可以无视,不知道是哪里配置导致的不一样。

@wlh320
Copy link
Owner

wlh320 commented Mar 30, 2025

还真是,看了你说的才知道 0.11 发布了,更了一下也这样了。找了一下 lspconfig 有 message_level 配置,但似乎不起作用啊,文档里说默认 level 是 warning,我这个 info 理应不该显示的。

@cxwx
Copy link
Author

cxwx commented Mar 30, 2025

文档估计还没更新,具体改了啥也不清楚

@cxwx
Copy link
Author

cxwx commented Mar 31, 2025

Image

Info 注释掉这行之后可以正常 进入 也不会报 enter

@wlh320
Copy link
Owner

wlh320 commented Mar 31, 2025

如果可以的话还是 nvim 或者 lspconfig 这边改比较好,正常情况下其他编辑我感觉没有 info 的 message 需要确认才能继续的情况

这句就是提醒一下这是复用一个已有的 server

@cxwx
Copy link
Author

cxwx commented Mar 31, 2025

临时办法

@wlh320
Copy link
Owner

wlh320 commented Apr 1, 2025

等我有空再研究下 LSP spec,看看怎么显示最合适

@wlh320 wlh320 closed this as completed in #54 Apr 4, 2025
@wlh320
Copy link
Owner

wlh320 commented Apr 4, 2025

INFO 不显示了,ERROR 信息显示一下,其他的都打到 log 里

@cxwx
Copy link
Author

cxwx commented Apr 4, 2025

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants