Skip to content

Commit

Permalink
雑にhover出るようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
kuuote committed Mar 17, 2024
1 parent 0d480bf commit 064e950
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 3 additions & 1 deletion conf/plug/lspoints.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ function s:initialize()
call lspoints#load_extensions([
\ 'config',
\ 'format',
\ 'lsputil',
\ 'nvim_diagnostics',
\ ])
" \ 'semantic_tokens',
Expand All @@ -12,9 +13,10 @@ function s:on_attach()
" L<toml-ddu_source_lsp>
let b:ddu_source_lsp_clientName = 'lspoints'

nnoremap <buffer> K <Cmd>echo lspoints#request('denols', 'textDocument/hover', denops#request('lspoints', 'executeCommand', ['lsputil', 'makePositionParams']))<CR>
nnoremap <buffer> gd <Cmd>DduSelectorCall lsp_definition<CR>
nnoremap <buffer> ma <Cmd>DduSelectorCall lsp_codeAction<CR>
nnoremap <buffer> mf <Cmd>call denops#request('lspoints', 'executeCommand', ['format', 'execute', bufnr()])<CR>
nnoremap <buffer> gd <Cmd>DduSelectorCall lsp_definition<CR>
endfunction
autocmd vimrc User LspointsAttach:* call s:on_attach()

Expand Down
16 changes: 16 additions & 0 deletions denops/@lspoints/lsputil.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Denops } from "../@deps/denops_std.ts";
import { BaseExtension, Lspoints } from "../@deps/lspoints.ts";
import {
makePositionParams,
TextDocumentPositionParams,
} from "/data/vim/repos/github.com/uga-rosa/deno-denops-lsputil/lsputil/mod.ts";

export class Extension extends BaseExtension {
override initialize(denops: Denops, lspoints: Lspoints) {
lspoints.defineCommands("lsputil", {
makePositionParams(): Promise<TextDocumentPositionParams> {
return makePositionParams(denops);
},
});
}
}

0 comments on commit 064e950

Please sign in to comment.