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

WIP: full language server manager implementation #10

Closed
wants to merge 15 commits into from

Conversation

prabirshrestha
Copy link
Owner

@prabirshrestha prabirshrestha commented May 9, 2017

Do not merge. This is WIP.

After few months of break from LSP and working on asyncomplete.vim, it is time to give LSP a try again. Hopefully this time we have more servers that works on Linux, Mac and Windows and would not be disappointing like last year.
Privately I have re-implemented LSP (manager not client) multiple times but I have only made the first one open source which is what is seen in example.vim. Throughout this process I have actually learned a lot about lsp and differences in different server implementations as well as os differences.

Here are some of the goals I have. (There are some missing features but I would like to get something usable that I can use it daily instead of trying to be a full featured LSP plugin first and never actually using it)

  • lsp#enable() and lsp#disable()
  • lsp#log(...) with g:lsp_log_file
  • autocmd lsp_setup for lazy setup
  • lsp#utils#find_nearest_parent_directory(path, directoryname)
  • lsp#utils#find_nearest_parent_file(path, filename)
  • Register lsp servers lsp#register_server. Need to support multiple servers for same file types.
  • Implement lsp#start_server('name', options).
  • implement cleanup for lsp server when exits unexpectedly i.e., handle on_exit for lsp servers.
  • implement s:parse_major_version(version)
  • implement s:path_to_uri() which works on windows with shell slash enabled and disabled as well as *nix
  • implement s:get_default_root_uri() - use cwd if root_uri not specified when starting or registering the server
  • log on_stderr
  • implement lsp#exit(name)
  • implement lsp#initialize(name, options) - initialize request and initialized notification
  • window/logMessage
  • textDocument/didOpen
  • textDocument/didChange
  • textDocument/willSave
  • textDocument/didSave
  • textDocument/didClose
  • textDocument/hover
  • textDocument/definition
  • textDocument/references
  • workspace/symbol
  • support LSP 2.0 and 3.0 or any new future version.
  • let g:lsp_enable_default_mappings = 0
  • expose callback apis so users can use it on their favorite interfaces like CtrlP, Unite or Denite as well as normal commands to it defaults to vim loclist.

Here are other nice to have that is of lower priority and will most likely be in different PRs. The goal is to actually get the MVP and dog-food it and see how practical it is rather than just having bunch of features.

  • textDocument/completion - This will be provided as asyncomplete.vim source
  • Implement automatic lsp server start. Most likely need to be smarter, for example: typescript server should most likely only start if it finds tsconfig.json
  • sign column for validation, warning and errors
  • textDocument/rename
  • window/showMessage
  • telemetry/event
  • lsp#unregister_server.
  • Port lsp#client to lua. The goal is not to port everything to lua, only the heavy parsing of the lsp protocol. This means if lua is supported it will use lua else fallback to vim script. Neovim recently merged lua changes so this would be interesting to see how it progresses. If the vimscript implementation is slow then I have no choice but to convert everything to lua and might only support neovim remote plugins then.

@prabirshrestha prabirshrestha mentioned this pull request Jul 10, 2017
11 tasks
@prabirshrestha
Copy link
Owner Author

closing in favor of #11

@prabirshrestha prabirshrestha deleted the manager branch July 10, 2017 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant