tree: 5cee93e579e4a271257fa9019833b8d82f0877aa [path history] [tgz]
  1. .settings/
  2. META-INF/
  3. schema/
  4. src/
  5. .classpath
  6. .project
  7. about.html
  8. build.properties
  9. example.target
  10. plugin.properties
  11. plugin.xml
  12. pom.xml
  13. README.md
org.eclipse.handly.examples.lsp/README.md

LSP Example

The LSP example (o.e.handly.examples.lsp*) demonstrates a Handly-based model that can represent in a generic way any LSP-based source file. It is built on top of Eclipse LSP4J.

For information about LSP, see https://github.com/Microsoft/language-server-protocol.

Implementation note. Currently, we use symbol location range to infer a hierarchy for a given flat list of symbols in a text document, just as Eclipse LSP4E does in its SymbolModel. However, according to a recent revision of the LSP specification

The range doesn't have to denote a node range in the sense of a abstract syntax tree. It can therefore not be used to re-construct a hierarchy of the symbols.

It appears that, for the time being, there is no protocol defined way in LSP for building a tree of symbols 1. Since the approach we currently use clearly violates the specification, it may or may not work, depending on a language server implementation.