如何把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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM