TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Introducing SourceKit-LSP

61 pointsby mbroncanoover 6 years ago

4 comments

peterkellyover 6 years ago
I&#x27;ve recently started adding support for the Language Server Protocol (LSP) in a language project I&#x27;m working on, and it&#x27;s a godsend. If you&#x27;re not familiar with it, it&#x27;s basically an editor- and language-agnostic protocol for implementing typical IDE behaviours like error highlighting, code completion, hover information, find references, etc. It solves the M*N problem in which every language would have to have a separate plugin tailored towards the APIs of every editor; now you just write either to be LSP compliant and it takes care of 90% of integration effort (writing the language server itself of course is still a lot of work).<p>Although it&#x27;s still necessary to do a little plumbing work to integrate into each editor, this is largely boilerplate that differs little between languages. Most of the functionality resides in a JSON-RPC server implemented in your language of choice.<p>I&#x27;ve found it particularly useful when used in conjunction with the Monaco code editor [1] (the engine that powers Visual Studio Code), along with a supporting plugin for talking to a remote LSP server [2]. These make it possible to build interactive coding environments into a web app which include many of the typical editing features you&#x27;re used to in IDEs.<p>It&#x27;s great to see Apple along with other language vendors adopting this as a standard.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;monaco-editor" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;monaco-editor</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;TypeFox&#x2F;monaco-languageclient" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;TypeFox&#x2F;monaco-languageclient</a>
评论 #18463759 未加载
sqsover 6 years ago
Very excited to see this. We will use this project to add Swift support to Sourcegraph soon so you can get hovers, go-to-definition, find-references, etc., when browsing code on GitHub&#x2F;GitLab&#x2F;Bitbucket&#x2F;Phabricator&#x2F;Sourcegraph&#x2F;etc.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;sourcegraph&#x2F;sourcegraph&#x2F;issues&#x2F;979" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sourcegraph&#x2F;sourcegraph&#x2F;issues&#x2F;979</a>
KingMobover 6 years ago
LSP seems like an interesting concept, but it would be nice if it included more support for REPLs. I&#x27;m thinking of things like &quot;evaluate highlighted section&quot; or &quot;recompile function under cursor&quot;.
sdegutisover 6 years ago
&gt; <i>SourceKit-LSP is built on top of sourcekitd 23 and clangd 23 for high-fidelity language support, and provides a powerful source code index as well as cross-language support.</i><p>That&#x27;s pretty much been Apple&#x27;s motto for a while: need language support for anything other than compiling the language, like IDEs or documentation generation? Why not add it <i>directly into the compiler?</i> This has pros and cons, but personally I like the direction Microsoft has gone: rewrite everything in JavaScript (actually TypeScript) so that it&#x27;s super portable and more easily embeddable.
评论 #18462283 未加载
评论 #18463167 未加载
评论 #18462547 未加载
评论 #18461974 未加载
评论 #18463435 未加载