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

[Question] is it possible to send requests to the language server? #524

Open
saccarosium opened this issue May 26, 2024 · 0 comments
Open

Comments

@saccarosium
Copy link

Hi,
I'm working on a re-implementation of mattn/vim-lsp-settings and neovim/nvim-lspconfig for this plugin. But I'm not sure how to - or even possible to - send requests to the language server. Something like this:

call lsp#send_request(l:server, {
    \ 'method': 'textDocument/switchSourceHeader',
    \ 'params': {
    \   'uri': lsp#utils#get_buffer_uri(),     
    \ },
    \ 'on_notification': function('s:handle_document_switch_source_header', [l:ctx, l:server, 'header/source', l:has_extension]),
    \ })

or

clangd_client.request('textDocument/switchSourceHeader', params, function(err, result)
      if err then
        error(tostring(err))
      end
      if not result then
        print 'Corresponding file cannot be determined'
        return
      end
      vim.api.nvim_command('edit ' .. vim.uri_to_fname(result))
    end, bufnr)
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

No branches or pull requests

1 participant