TJ thank you for this. Very informative. I have been on an LSP mission since the Kickstart updates. Just finished watching your and Bashes LSP video which was also very informative.
LSP's are really a great addition to development. Now we only have to get task running, building etc. standardized so every other major editor integration can be abstracted away. I have to work in both neovim and Visual Studio 2022 everyday and having stuff like task running defined once and usable accross both would be amazing.
You have to smoke a special kinda crack to think Makefiles could do that to any degree of reproducabiility and system independent reliability. And that's not even touching on the arcane syntax, the refusal to produce any modern, readable, understandable documentation and examples, and their general incompability with NT operating systems.@@oxidant5
One of the most fun and challenging parts of using neovim is figuring out how LSPs work under the hood and how to properly configure it, which i'm still doing, this video gave me a troubleshooting aha moment of something that was very obvious regarding the client / server operations
Configuring LSPs is such a headache generator. Especially when you have to factor in a particular editor's config format... and possibly that particular editor's distribution's config format...! I'm glad way more patient people than I have released sufficiently to-my-taste configs that I can just download and use.
An example of the problem that LSPs solve is in the Kotlin language. Basically it was released by Jetbrains and what does Jetbrains "sell"? You got it, editors! That means their integration is awesome. But what happens if you want to use VSCode (not even talking about Vim) to code Kotlin? You can't because the language features are deeply coupled with the editor. That's what LSPs solve, they decouple the language from the editor. Thank god for the case of Kotlin there are good community alternatives and now you can install them, but hopefully they release an official one.
That's the only thing holding me back from learning Kotlin. Why on earth would I wanna learn a language so tightly coupled with an IDE? Not worth my time.
I'd argue the reason kotlin does not have official support outside of jetbrains IDE's is that they have no incentive to add it. Let's be honest, no one is completely rewriting their language plugin when porting it to a different editor. We had cross-editor plugins like resharper before LSP. The only thing LSP does is maybe get rid of some glue code.
@@pokefreak2112 I think the point here is that any language to be massively adopted today, needs to have a good lsp that is not tied into an editor. Kotlin thrives for 2 reasons: android development and the natural evolution from Java (and the latter is just for some people, others just use new versions of Java). If it didn't have this driving force, people would not lock into an editor for the sake of the language.
I already know most of this, but not all. This video is good in many ways: with a lot of concepts/information using clear/easy language, making it easy to understand/assimilate, and all that in a short video, directly to the point. Thank you for the content.
The benefit of LSP seems similiar to what I've recently learned in compilers class where language could have its frontend translate to some intermediate representation and then there can be a backend that translates that IR to platform specific instructions.
This is a super nice overview, thanks! What do you use for the actual presentation shown behind you? I'd imagine it's Neovim, but using what plugins and how?
Thank you. Always wondered, never could get my head around it. Now please, a similar treatment to Treesitter? I can't tell where LSP ends and TS begins.
@@teej_dv As a beginner, we all get to use LSP features of Neovim via plugins, or some pre-defined setup. All this obviously only works because of the native LSP support that you programmed in Neovim, as in LSP is a core part of Neovim. My point about video idea is going one step ahead and maybe talking about what more can one do with LSP apart from just using plugins? Maybe even talk about some LSP API that is made use of inside these plugins? The whole point here teej is to learn more about LSP and perhaps make use of it. And it's ok if my idea doesn't resonate with your ideology of the videos you want to put out, not everyone's looking for this. All in all, awesome videos man. Keep up the good work :)
The concept of LSP is clear. It's a JSON-RPC communication protocol. What's a little confusing to me is who's responsibility is it to download the server? I see a long list of LSP's, which I assume are just protocols (not servers) to communicate with a server. Does the plugin download the server (that would be nice) or do I have to install it separately out in the shell?
This is super cool! I would be interested in seeing how to make these requests and see the different responses and requests that are possible. Where would I look at this?
Read the nvim docs of e.g. vim.lsp.buf_request_all (lua funtion) and probably you want to read most the document this is in, with this video as background introduction, it should make (more) sense. Sometimes it's not trivial to find out how to provide the input data if required, like text range, this depends on the specific request. At some point I implemented my own handler for a non-standard lsp request of a specific server, and eventually I looked at the nvim source (lua) code, and the standard requests there, to figure out how exactly to do this.
Hello algorithm gods I have smashed the like button and left a comment, please allocate more views to this video and give TJ a bigger cut of the monetization, Amen 🙏
TJ can you explain why LSP is a client/server protocol? I've increasingly felt that it's kind of absurd for my editor to need to make http over tcp requests on localhost, encoded in JSON, to get language information to and from my language analysis tooling. JSON parsing alone adds a ton of overhead for certain LSPs, and using tcp for local IPC just seems wasteful? In seems like the majority(?) use case is for someone editing locally, which means a standard interface for some kind of DLL might have been a better route? Unless the original idea behind LSP was for remote development? Curious to hear your thoughts.
Could LSP be used to generate call sequence diagrams? I work with large C++ projects and it would be really helpful to understand where objects get created. Do you think it is possible?
hmm, everyone keeps saying that lsp is hard to configure with nvim, but I don't think it really matches my experience I just download them with Mason, write down the names in a table, and loop over each of them
this works perfectly, would be even easier with mason-lspconfig: local lsp = require 'lspconfig' for client in pairs(servers) do lsp[client].setup { on_attach = on_attach, capabilities = capabilities, settings = servers[client], } end
Always wondered how lsp was doing. Finally got an answer
The `M x N` -> `M + N` explanation is so good
Smashed it out of the park with this one Teej. A classic “I know vaguely what [insert thing here] does” topic.
This was amazing, please do more videos about core components of neovim and editors in general Teej. Subscribed instantly.
Just subbed, why couldn't any of the other videos I watched explain this so easily!? THANK YOU TJ
A detailed version of this would be litm
Thank you, I love these "straight to the point" explanations
sick explanation, I knew what LSPs were in a broad sense but didn't understand the problem they were trying to solve
Great video! I really appreciate the concise and incredibly useful format!
Thanks! exactly what I was shooting for!
That was very informative and the style of the video is great, Thank you Teej.
finally an LSP explanation that doesn't assume you know what a language server is!
Videos like this are so valuable for the community as a whole, thanks for the content!
This was really well done, thanks for the explanation. The format is great
Thanks! I'm going to try and do a few more videos like this. Thanks for the feedback
You are a freaking wizard at explaining things. Just enough for me to go on and figure things out.
Beautiful! Next targets: linters, formatters :)
TJ thank you for this. Very informative. I have been on an LSP mission since the Kickstart updates. Just finished watching your and Bashes LSP video which was also very informative.
LSP's are really a great addition to development. Now we only have to get task running, building etc. standardized so every other major editor integration can be abstracted away. I have to work in both neovim and Visual Studio 2022 everyday and having stuff like task running defined once and usable accross both would be amazing.
VS 2022 💀
Makefile?
You have to smoke a special kinda crack to think Makefiles could do that to any degree of reproducabiility and system independent reliability. And that's not even touching on the arcane syntax, the refusal to produce any modern, readable, understandable documentation and examples, and their general incompability with NT operating systems.@@oxidant5
VS 2022 💀
Didn't even know I wanted this video, thanks a ton for the info!
Very nice quick overview, thanks.
One of the most fun and challenging parts of using neovim is figuring out how LSPs work under the hood and how to properly configure it, which i'm still doing, this video gave me a troubleshooting aha moment of something that was very obvious regarding the client / server operations
Configuring LSPs is such a headache generator. Especially when you have to factor in a particular editor's config format... and possibly that particular editor's distribution's config format...! I'm glad way more patient people than I have released sufficiently to-my-taste configs that I can just download and use.
@@herrpez haha! Fair, i'm a masochist
@@bitcode_ And I'm glad for it. 😂
This was awesome, thank you for the overview!
So glad you liked it!
nice introduction to lsp i would love to see some more stuff about how lsp formatters linters work
Best beginner friendly explaination
An example of the problem that LSPs solve is in the Kotlin language. Basically it was released by Jetbrains and what does Jetbrains "sell"? You got it, editors! That means their integration is awesome. But what happens if you want to use VSCode (not even talking about Vim) to code Kotlin? You can't because the language features are deeply coupled with the editor. That's what LSPs solve, they decouple the language from the editor. Thank god for the case of Kotlin there are good community alternatives and now you can install them, but hopefully they release an official one.
That's the only thing holding me back from learning Kotlin. Why on earth would I wanna learn a language so tightly coupled with an IDE? Not worth my time.
I'd argue the reason kotlin does not have official support outside of jetbrains IDE's is that they have no incentive to add it. Let's be honest, no one is completely rewriting their language plugin when porting it to a different editor. We had cross-editor plugins like resharper before LSP. The only thing LSP does is maybe get rid of some glue code.
@@pokefreak2112 I think the point here is that any language to be massively adopted today, needs to have a good lsp that is not tied into an editor. Kotlin thrives for 2 reasons: android development and the natural evolution from Java (and the latter is just for some people, others just use new versions of Java). If it didn't have this driving force, people would not lock into an editor for the sake of the language.
Whoa. Straight to the point, entertaining, amazing
Awesome video explaining how the communication works with my LSP. Would be also great to see a video on debugging issues with different LSP issues.
Thanks for this video. A great overview of the LSP.
The clearest explanation of LSP I've seen. Just thanks. :)
I already know most of this, but not all. This video is good in many ways: with a lot of concepts/information using clear/easy language, making it easy to understand/assimilate, and all that in a short video, directly to the point.
Thank you for the content.
Thanks for the comment and compliments!
Nice! Amazing intro, ty teej
Incredibly succint explanation, thank you!
I always wondered! Thanks for the vid TJ!
I really like these!
As always great content. 👍
Nice format to explain something
Thanks for the clear explanation. I finally have a clue about what LSP is for. Now I am more curious about what Treesitter is doing.
Thanks for telling me how it works.
loved this!
Yes! More of this please!
I like this format, great work!
Thanks! Hoping to do more of them!
The benefit of LSP seems similiar to what I've recently learned in compilers class where language could have its frontend translate to some intermediate representation and then there can be a backend that translates that IR to platform specific instructions.
This is very informative. Thank you for making these amazing videos.
Thank you! Hoping to make more like this!!
Thank you, great video
Thanks a lot, TJ! I like your videos!
Damn, quality content. Way to go teej!
Thanks!!
great video as usual!
The in-terminal slides are so cool
I am making a programming language, so implementing an LSP is important.
This is a super nice overview, thanks!
What do you use for the actual presentation shown behind you? I'd imagine it's Neovim, but using what plugins and how?
That raw take with the cough included. But I enjoyed the summary.
hahaha i know, i could have edited out but I liked having it be one take!
it was really cool. cheers
awesome saucesome. this is a really cool protocol
LOVE IT!
That was really interesting!
im writting a IDE and this is so helpful
clear and helpful!
Thank you. Always wondered, never could get my head around it. Now please, a similar treatment to Treesitter? I can't tell where LSP ends and TS begins.
This is gold.
"From now on we're going to call your editor the client". Proceeds to still call it editor for the rest of the video GIGACHAD
Excellent video :)
This was cool thanks !
thanks for this
Thanks for caring enough to ask how's LSP 🥰
Always important to check in and make sure LSP is feeling good
Great content
This was really good. Next time explain null-ls/none-ls. Also linters and formatters later.
Debuggers teej❤
Yes
Yes
Using an LSP really is taking so many W's...
@teej_dv awesome video. Thanks 🙏
Video idea: Neovim LSP core usage. Insights into LSP API and stuff like that. Might even be a series of videos
I'm not sure what you mean - core usage in what way?
@@teej_dv As a beginner, we all get to use LSP features of Neovim via plugins, or some pre-defined setup. All this obviously only works because of the native LSP support that you programmed in Neovim, as in LSP is a core part of Neovim. My point about video idea is going one step ahead and maybe talking about what more can one do with LSP apart from just using plugins? Maybe even talk about some LSP API that is made use of inside these plugins? The whole point here teej is to learn more about LSP and perhaps make use of it. And it's ok if my idea doesn't resonate with your ideology of the videos you want to put out, not everyone's looking for this.
All in all, awesome videos man. Keep up the good work :)
I guess it's late, but would have inverted where and why, and show the examples as last.
Nice job.
Great vid, was just making the lsp for my toy language.
The concept of LSP is clear. It's a JSON-RPC communication protocol. What's a little confusing to me is who's responsibility is it to download the server? I see a long list of LSP's, which I assume are just protocols (not servers) to communicate with a server. Does the plugin download the server (that would be nice) or do I have to install it separately out in the shell?
Thank well done.
I think your slides need some Berkeley Mono font btw.. :)
TH-cam LSP = Like, Subscribe, Post. Interesting topic.
Why LSP? Because it pisses off Jonathan Blow
This is super cool! I would be interested in seeing how to make these requests and see the different responses and requests that are possible. Where would I look at this?
Read the nvim docs of e.g. vim.lsp.buf_request_all (lua funtion) and probably you want to read most the document this is in, with this video as background introduction, it should make (more) sense.
Sometimes it's not trivial to find out how to provide the input data if required, like text range, this depends on the specific request. At some point I implemented my own handler for a non-standard lsp request of a specific server, and eventually I looked at the nvim source (lua) code, and the standard requests there, to figure out how exactly to do this.
More nuggets like this plz
Hello algorithm gods I have smashed the like button and left a comment, please allocate more views to this video and give TJ a bigger cut of the monetization, Amen 🙏
ty ty for commenting
what did you use for this presentation?
a normal slideshow thing, or something a bit more fancy?
Edit: nevermind, I see it linked in the description.
Nice video. what software did you use for the slides? Edit - just saw it in the description thanks
Awesome video, a question: The Editor communicates to the server via json? that seems inefficient...
At last I know what is Lisp. Thx 🥳🙃
TJ can you explain why LSP is a client/server protocol? I've increasingly felt that it's kind of absurd for my editor to need to make http over tcp requests on localhost, encoded in JSON, to get language information to and from my language analysis tooling. JSON parsing alone adds a ton of overhead for certain LSPs, and using tcp for local IPC just seems wasteful? In seems like the majority(?) use case is for someone editing locally, which means a standard interface for some kind of DLL might have been a better route? Unless the original idea behind LSP was for remote development? Curious to hear your thoughts.
Well it doesn't do http over tcp, they usually communicate over stdin/stdout. It *can* use TCP but I have almost never seen it done in practice.
Awesome content~!
Thanks!!
TIL, love it
Awesome 👍
More videos like this. Thanks
Will do!!
Does anyone know what program he's using for the presentation?
🎉
Fantastic
Brilliant
Could LSP be used to generate call sequence diagrams? I work with large C++ projects and it would be really helpful to understand where objects get created. Do you think it is possible?
Everything was really cool
well done video
How did you make these slides?
i like the slides. how did you achieve that ?
Cool video!
Good good!
Can someone tell me how to make such slides, and which presenter software he is using?
I was looking up the character from Adventure time lmao
W Oregon shirt
hmm, everyone keeps saying that lsp is hard to configure with nvim, but I don't think it really matches my experience
I just download them with Mason, write down the names in a table, and loop over each of them
this works perfectly, would be even easier with mason-lspconfig:
local lsp = require 'lspconfig'
for client in pairs(servers) do
lsp[client].setup {
on_attach = on_attach,
capabilities = capabilities,
settings = servers[client],
}
end