如何把VS Code的Language Server Protocol整合到Eclipse中来

Eclipse官方已经在着手做这件事情了,在Oxygen中,Eclipse提供了LSP4E扩展点(language server protocal for eclipse)来支持language server protocal,TM4E(textmate for eclipse)来支持语法高亮。

简单来说,我们可以用一个editor去实现对多种语言的语法补全和高亮显示,就跟VS code的效果一样,是不是很神奇,有木有很惊喜。

下面是官方给的教程,挺简单的,主要原理是利用本机安装的node.js在Eclipse这个平台上运行c#的language server js文件(这个文件在vs code的安装源码里面就能找到)

http://www.eclipse.org/community/eclipse_newsletter/2017/may/article3.php

然后Eclipse Lab里面有一个BlueSky的项目,里面主要是用language server protocol做对各种前段语言的支持。Show u the code:

https://github.com/mickaelistria/eclipse-bluesky

同时附上Microsoft开源的language server protocol库:

https://github.com/Microsoft/language-server-protocol/wiki/Protocol-Implementations

这段时间自己利用language server protocol做了对Groovy的语法补全和高亮支持的Eclipse Plugin,过段时间出一个详细的教程。

下面附上做这个插件时找到的各种资料:

https://www.slideshare.net/mickaelistria/eclipsecon-europe-2016-s-cela-mistria-eclipse-generic-and-extensible-editor-and-language-servers

https://github.com/eclipselabs/lsp4e-python

https://github.com/LucasBullen/LSP4J_Tutorial

 

posted @ 2017-10-31 20:30  Hibou  阅读(2542)  评论(2编辑  收藏  举报