kinda sorta
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
from pygls.lsp.server import LanguageServer
|
||||
from lsprotocol import types
|
||||
|
||||
server = LanguageServer("ctags-ls", "v0.1")
|
||||
ls = LanguageServer("ctags-ls", "v0.1")
|
||||
|
||||
@server.feature(types.TEXT_DOCUMENT_COMPLETION)
|
||||
@ls.feature(types.TEXT_DOCUMENT_COMPLETION)
|
||||
def completions(params: types.CompletionParams):
|
||||
items = []
|
||||
document = server.workspace.get_text_document(params.text_document.uri)
|
||||
document = ls.workspace.get_text_document(params.text_document.uri)
|
||||
current_line = document.lines[params.position.line].strip()
|
||||
if current_line.endswith("hello."):
|
||||
items = [
|
||||
@@ -16,4 +16,4 @@ def completions(params: types.CompletionParams):
|
||||
return types.CompletionList(is_incomplete=False, items=items)
|
||||
|
||||
def main():
|
||||
server.start_io()
|
||||
ls.start_io()
|
||||
|
||||
@@ -692,15 +692,14 @@ require'lazy'.setup{ --{{{1
|
||||
end,
|
||||
})
|
||||
|
||||
local CTAGS_NAME = 'ctags-ls'
|
||||
vim.lsp.config(CTAGS_NAME, {
|
||||
cmd={ CTAGS_NAME },
|
||||
vim.lsp.config['ctags-ls'] = {
|
||||
cmd={ 'ctags-ls' },
|
||||
filetypes=nil,
|
||||
root_dir=function(...) ---@diagnostic disable-line: unused-vararg
|
||||
return vim.fn.getcwd()
|
||||
root_dir=function(_, on_dir)
|
||||
on_dir(vim.fn.getcwd())
|
||||
end,
|
||||
})
|
||||
vim.lsp.enable(CTAGS_NAME)
|
||||
}
|
||||
vim.lsp.enable('ctags-ls')
|
||||
|
||||
vim.keymap.set( 'n', ',fd', vim.lsp.buf.definition, { noremap = true, silent = true})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user