Xi-editor: [GSoC] Language Server Protocol Plugin Support

Created on 16 May 2018  ·  5Comments  ·  Source: xi-editor/xi-editor

This is a roadmap of the the steps planned by me to add support for the Language Server Protocol (LSP) Plugin Support in the Xi Editor.

Roadmap

_Will be refined over time_

  • [x] Get a basic plugin working which can access the document state.
  • [x] Discover improvements needed in current Plugin API to enable a very simple LSP usecase i.e. JSON.
  • [x] Get the JSON Plugin Working. The basic idea is to develop a crate which is abstraction over the plugin_lib, which JSON Plugin will use to communicate with the Editor. The validation error messages can be dumped to stderr to begin with.
  • [ ] Figure out a plan for the features in a specific order in the LSP Plugin including:

    • [ ] Status Information

    • [ ] Inline Error and Warning Display

    • [ ] Hover Definitions

    • [ ] Go to Definition

    • [ ] Intelligent Autocompletion

    • [ ] Highlight References

    • [ ] Refactoring Support

  • [ ] Figure out a test language (probably Rust?) to begin with to implement and test all
    features.

TODO: More refined steps after the 4th step.

Planning

The basic architecture currently planned (needs review) can be described by the following picture.

lsp-archtecture

Roadblocks / Open Questions.

  • Managing Workspaces. Who should manage the workspaces: Xi-Core or the Plugin itself?
planning

Most helpful comment

@skyne98 there was a bunch of exploratory work on this this summer, but the conclusion of that was that we should step back and work on incrementally adding support for the features that will _enable_ LSP support in the future. The issue linked above is a first step there.

All 5 comments

@betterclever great, I think this is a good high-level overview.

For now, I think that 'workspaces' should be managed by the plugin (the last step, here) maybe with help from the LSP library. Essentially the plugin will know every file that gets opened, and it can go looking for Cargo.toml files (or other workspace markers) and use those to figure out which files are part of which 'workspaces'.

We should consider that a single LSP client plugin, in xi, might actually be running multiple LSP sessions, if multiple workspaces are open. (I think this is how it would work?).

@cmyr, hey, any progress? What is the state of LSP support in Xi? Thanks!

Many (most?) bits have PRs that at least were in a relatively working state. However they got kind of stuck in a discussion of how these things should be communicated to the client... The annotations PR (#1010) is one step towards specifying that.

@skyne98 there was a bunch of exploratory work on this this summer, but the conclusion of that was that we should step back and work on incrementally adding support for the features that will _enable_ LSP support in the future. The issue linked above is a first step there.

Currently, the further development is stalled until this new plugin system is written: https://github.com/xi-editor/xi-editor/issues/845

Was this page helpful?
0 / 5 - 0 ratings