Bug 530940 - Provide an LSP example
Summary: Provide an LSP example
Status: RESOLVED FIXED
Alias: None
Product: Handly
Classification: Technology
Component: Examples (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 enhancement
Target Milestone: 1.0   Edit
Assignee: Vladimir Piskarev CLA
QA Contact:
URL:
Whiteboard:
Keywords: example
Depends on:
Blocks:
 
Reported: 2018-02-09 08:15 EST by Vladimir Piskarev CLA
Modified: 2018-05-12 10:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Piskarev CLA 2018-02-09 08:15:24 EST
The example should demonstrate a Handly-based model that can represent in a generic way any LSP-based source file. For information about LSP, see https://github.com/Microsoft/language-server-protocol.
Comment 1 Vladimir Piskarev CLA 2018-02-09 08:23:38 EST
Pushed to master:
http://git.eclipse.org/c/handly/org.eclipse.handly.git/commit/?id=118e0a32a1ccc5d2487e485663c454eed85fc75f

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.

[1] https://github.com/Microsoft/language-server-protocol/issues/327
Comment 2 Vladimir Piskarev CLA 2018-05-04 08:52:44 EDT
Additional work on the LSP example:
http://git.eclipse.org/c/handly/org.eclipse.handly.git/commit/?id=19df8ef3539636a7c2d1e21ff1784a74df9652ed