To be honest, I'm not going to do this anytime soon but is a great insight into something really interesting and mostly hidden. Topic is nicely explained, tempo is awesome, voice is clear and well recorded and the video is great. Thanks for sharing.
This is fantastic! We use an old proprietary vendor language a lot at my job, and the only real IDE that supports it is nearing 20 years old at this point. Dove into writing my own lsp for it and this is the best thing I've found that made it all make sense. Thanks for the content!
1. bootstrap a meme language by yourself based on whatever language you are familiar with. 2. create a lsp based on this video. 3. Then, host a website that has a simple editor with the lsp syntax highlight. Compile and run your meme language on the fly, even only contains the most basic and trivia functionalities. if you are able to go through the entire process, even with the help of all the online resources. You already beat 95% of bachelor + master degree CS students around the world. Even average SDE in most companies. I'm not joking.
I have searched for LSP videos before and got only marginal quality but this morning -- right around when my first cup of coffee finished brewing -- your video just showed up in my feed and wow this is MUCH better content than I'd seen before. Great instructive style, great everything!
@@semanticart I thought it useful in your videos on LSP's was you didn't just use library to implement things. I think this helped comprehension but I do wonder if maybe you might follow that up with discussing some of the libraries (or deep diving into one) to show how one might move more quickly or maybe as a way to provide an overview of features/hooks that are used in some of the better LSP's out there. Secretly I'd love to see something in the Rustlang space to show how the LSP model can be implemented away from just JS but that may be moving outside your comfort zone or narrow your audience too much so I am fully not expecting that. :)
@yankee-in-london Good questions. I definitely am putting the "from-scratch" stuff aside for awhile. I hope to have demonstrated the approachability of the LSP and want to get into building more exciting things with it. Deep dives into libraries is a good idea. I'd probably go with vscode-languageserver-node first since it is most widely used and I'm most familiar with it. I am curious about Rust and have worked through a couple books on it but I certainly don't consider myself seasoned enough to sit down and make a video without a lot of prep. Rust seems like it would be a good fit for developer tooling (once you get over the learning curve). I can't say if there's an audience or not, but I'm just a small TH-camr so I'm not overly worried about that part :) I think doing deep-dives on various language servers could be interesting. I did a video recently on adding Neovim support for a non-standard method used by ruby-lsp. It'd be fun to dig deeper into how different language servers implement things (standard and non-standard). I love the suggestions. Feel free to keep them coming. I'm always looking for new ideas. Have a great day!
@@semanticart its about a very old dsl. i want to create a webapp, powered by the monaco-editor, that can provide some dsl-specific features. but setting up the monaco-editor with a clientside ls isnt as straightforward as i thought xd
my initial plan was to create an language-server class that gets gets passed io/ everything else relevant into its constructer and to write a bunch of glue-code to make it work inside a webworker, but getting the interface with monaco in a browser-environment to work seems kinda difficult for me
@@warro-jg2yq What an interesting idea. I haven't thought of running an LS in an editor in a browser but if extensions work generally, then you might be able to make it work. The big question in my mind is how you'd handle the server running as a separate process. That seems tricky in that environment. 🤔I wonder if you might find it easier building a general use LS and publishing it as an NPM package. That LS could export functions that you could call directly from an extension (rather than running a separate process). Everyone would get all the LS goodness for local dev and you'd be able to re-use your functionality for the in-browser editor.
extensions dont work (atl its not straightforward without a bunch of additional code), but theres a lsp-compliant bridge called monaco-languageclient that should work. as for the second process: webworker do run on a seperate thread, so if my ls-class was implemented correctly, everything should work quite smoothly
Please continue. I’m trying to create my own language/framework compiler and I’ve always wanted to know how to do this. I’d very much love a deep deep dive into the subject! Thank you very much for making and sharing this video. 🙏🙏🙏
I tried to create my own LSP a few months ago, but ended giving up on it due to the lack of tutorials and good resources on it and lackluster documentation. This might help me restart the project, thank you for making this!
Wow, thank you recommendation gods! Thank you for this, not many videos on this and the oens that do exist are kinda old. And your speaking voice and explanation style are awesome! Thanks!
this is cool! I'm planning on writing a toy language + compiler for it in golang, and an LSP will be a great addition to the project. Thanks for the awesome video, hope I get to see more contents on this channel!
That's awesome! LMK if you end up publishing that LSP, I'd love to take a look. I'm getting into Go, so I'm sure to have some future LSP+Go content here.
You were able to condense and distill what I thought was a pretty complex topic enough to make it look extremely simple. Thank you so much for putting this together!
Thank you for doing this. I have been working on developing my own language and have been struggling to make an lsp. This video is great, again thank you!
Thank you so much for this tutorial! I had been thinking of adding syntax highlighting / code completion for vscode, but I ended up opting for notepad++. Well, your tutorial made me confident that I could easily add some basic functionality to vscode for my language and now it's already a little better than just syntax highlighting. Though, I have to admit, I ended up using your `Minimum Viable VS Code Language Server Extension` as my starting point, rather than writing it from scratch like in your video. But, you do a really good job of revealing what's happening behind the scenes!
You should absolutely use the MVP extension rather than starting from scratch. If I were just concerned with building instead of teaching, I'd be leaning heavily on "vscode-languageserver" and "vscode-languageserver-textdocument" (which the MVP uses). Good luck and let me know what you build :)
This was a cool walk through. I failed looking at LSPs before, and now I was able to set one up, following along. Nice work! If you do a follow up, I'd be happy to follow along making an LSP for some language that isn't already available IRL.
Thank you for the kind words. I'm definitely interested in tackling an unrepresented language. Do you have any suggestions that you think might be compelling?
Excellent tutorial. Thanks for sharing and please keep this series up! I hope there will be video talking about implementation of some common lsp capabilities like textDocument/definition or textDocument/reference.
Hahaha. It is definitely all relative 😁 Carl Sagan once said, “If you wish to make an apple pie from scratch, you must first invent the universe.” So the whole "From Scratch" thing is a bit of a misnomer, no matter how you look at it.
Thank you. It is possible but it is trickier and depends on the execution context of the editor, etc. It is outside my area of expertise but I know that twitter.com/PaoloRicciuti has done this for www.sveltelab.dev/ with some combination of Codemirror and/or webcontainers.io/ He's a nice chap so I'm sure he'd be happy to give you a few pointers.
Loving this tutorial, very well explained and with a great tempo. One quick question, is there any reason why you are declaring all the interfaces instead of importing them from the "vscode-languageserver" package?
Thanks for the kind words! Good question about the types. I have two main goals there: 1. to keep the "from scratch" approach of not having dependencies on any pre-existing LSP libraries and 2. to help teach people where they can find the types in the docs (which I hope will help people feel more confident about their ability to learn the LSP _and_ help people who aren't in the TS/JS ecosystem and can't use vscode-languageserver). There's a tertiary goal to constrain them a little for our purposes (e.g. in the follow-up video, the official types have `data` as optional on the Diagnostic but in our language server we _always_ want to include data) but obviously I could accomplish that by amending the vscode-languageserver types.
I may not know something but ASN.1 is exactly for ability to generate "from" and not "to". Writing LDAP queries in LDIF I bet happens more frequently but the point is that when you write a query for adding a new record to LDAP DS you want to see available object classes and attributes in schema which is defined in ASN.1
Awesome content 🔥, what would be approriate to optimize it further debounce or throttle on server side so that we send results of abc not a, ab and abc?
Great question! I'd try debouncing. To make it work, you'll need to introduce global state to keep track of pending completion requests and then selectively reply to them. In your example, after the debounce period expires, you can reply to `abc` with completions and you can reply to the requests for `a` and `ab` with `null`. The client should re-request completions for `null` responses, so if the user later types `ab` it'll request it again and you can provide the completions you skipped before. Related: You might want to cache completions if they're expensive to calculate and don't change.
Good question! `add` is an alias I've set up for `git add --intent-to-add .; git add -p`. It lets you stage changes in parts for each changed file (including newly added files that aren't under git yet - that's the intent-to-add part). I like this approach because it lets me review and confirm each change. I can (e.g.) choose not to stage `console.log` debugging lines etc. The prettier diffing is via github.com/dandavison/delta
Want to know the real-world completion suggestion algorithm, based on the scope and the syntax, maybe even incomplete code. I'm trying to build some LSP, but the language is just too complicated.
I don't have any great resources or offhand knowledge about this, but it feels like a potentially good topic for a future video. In the meantime, to provide suggestions based on syntax and scope, you might want to look at something like treesitter or other grammar parsers to help you get a syntax tree you can use to inform your completions. Good luck and thanks for subscribing!
I'd be far more interested and impressed in doing the reverse; creating a code editor that can use arbitrary LSP's. I created a full-fledged editor over a week in the summer but never could get an LSP client implementation going.
Building an entire text editor isn't something I'm interested in but I do hope to build a client in an upcoming video for doing black-box testing. The idea is that you script requests/notifications from the client and make assertions on the responses from the server.
I love this content and I would love to be able to help support the creation of your content maybe through a TH-cam channel subscription or Patreon. I loved the stuff on LSP and the command line tools like entr and the other json CLI from jq
Chris, wow, that is _super_ kind of you. I'd love to figure out ways to devote more time to this content. I'll be in touch if I get a Patreon off the ground or add TH-cam Memberships/Subscriptions. Thanks again!
Hey I know it's been a few months, but this video has been really helping me become more familiar with LSP. I am building a language server for my internship. I was wondering if you have any idea why I am getting an error "The language server is either not installed, missing from PATH, or not executable." in neovim. Everything else worked flawlessly! Thanks!
Thank you for the kind words. This is a good question. There's a few things that can go wrong here. First I'd check to see if running the `cmd` for the `vim.lsp.start` runs fine when you run it directly from the terminal (it shouldn't do anything, but it should sit there waiting for input without crashing). If that works, then your neovim probably doesn't have the same $PATH setup as your terminal and you can pull on that thread (or specify absolute paths, etc). If that didn't work, then hopefully it exited with a helpful error message. Let me know how it goes!
@@semanticartThanks for the quick reply! I confirmed that running the command "npx ts-node " did kick off the server. I am on Windows and have never used neovim before so it may be something with my neovim config or something. I didn't mention at first but the error message also includes "Spawning language server with cmd: {"npx", "ts-node", "" failed." So it is successfully trying to spawn it with (seemingly) the right command. I don't know where to look for more details on the failure. (like a neovim error log file or something?)
@@semanticart It runs the file (I put a console.log() at the start to confirm) but doesn't hang like in a terminal. Doesn't throw any errors as far as I can tell.
@@PriZ0nM1ke Hrm. Check the lsp log file (get the name via `:lua =require('vim.lsp.log').get_filename()`). You can also set `vim.lsp.set_log_level("DEBUG") ` BEFORE starting the language server to (hopefully) get more info
Totally. They’re in the description and I’ve tried a half dozen tweaks but TH-cam isn’t showing them on the video. Google suggests there’s a bug afoot. It worked in the preview before I posted it. 😢
Wow, I just built a LSP from scratch! Thank you! I couldn't get nvim to attach with just your code, but watching TJ's video with the vim.api.nvim_create_autocmd did the trick. Reference video with timestamp: watch?v=YsdlcQoHqPY&t=1915s
To be honest, I'm not going to do this anytime soon but is a great insight into something really interesting and mostly hidden. Topic is nicely explained, tempo is awesome, voice is clear and well recorded and the video is great. Thanks for sharing.
Thank you, I really appreciate the kind words.
perfectly sums up my thought
This is fantastic! We use an old proprietary vendor language a lot at my job, and the only real IDE that supports it is nearing 20 years old at this point. Dove into writing my own lsp for it and this is the best thing I've found that made it all make sense. Thanks for the content!
Thank you so much for the kind words! Best of luck with your language server
1. bootstrap a meme language by yourself based on whatever language you are familiar with.
2. create a lsp based on this video.
3. Then, host a website that has a simple editor with the lsp syntax highlight. Compile and run your meme language on the fly, even only contains the most basic and trivia functionalities.
if you are able to go through the entire process, even with the help of all the online resources. You already beat 95% of bachelor + master degree CS students around the world. Even average SDE in most companies. I'm not joking.
This sounds like a good way to learn a ton and sharpen your skills.
Thanks, gonna try this in my vacations.
I have searched for LSP videos before and got only marginal quality but this morning -- right around when my first cup of coffee finished brewing -- your video just showed up in my feed and wow this is MUCH better content than I'd seen before. Great instructive style, great everything!
Thank you so much for the kind words and for watching. It means a lot to me.
@@semanticart I thought it useful in your videos on LSP's was you didn't just use library to implement things. I think this helped comprehension but I do wonder if maybe you might follow that up with discussing some of the libraries (or deep diving into one) to show how one might move more quickly or maybe as a way to provide an overview of features/hooks that are used in some of the better LSP's out there. Secretly I'd love to see something in the Rustlang space to show how the LSP model can be implemented away from just JS but that may be moving outside your comfort zone or narrow your audience too much so I am fully not expecting that. :)
@yankee-in-london Good questions. I definitely am putting the "from-scratch" stuff aside for awhile. I hope to have demonstrated the approachability of the LSP and want to get into building more exciting things with it.
Deep dives into libraries is a good idea. I'd probably go with vscode-languageserver-node first since it is most widely used and I'm most familiar with it.
I am curious about Rust and have worked through a couple books on it but I certainly don't consider myself seasoned enough to sit down and make a video without a lot of prep. Rust seems like it would be a good fit for developer tooling (once you get over the learning curve). I can't say if there's an audience or not, but I'm just a small TH-camr so I'm not overly worried about that part :)
I think doing deep-dives on various language servers could be interesting. I did a video recently on adding Neovim support for a non-standard method used by ruby-lsp. It'd be fun to dig deeper into how different language servers implement things (standard and non-standard).
I love the suggestions. Feel free to keep them coming. I'm always looking for new ideas. Have a great day!
what a coincidence! i started having to create a ls for work and this video is pure gold. keep up the great work!
What fortunate timing :) Can you say more about what you're building in your LS?
@@semanticart its about a very old dsl. i want to create a webapp, powered by the monaco-editor, that can provide some dsl-specific features. but setting up the monaco-editor with a clientside ls isnt as straightforward as i thought xd
my initial plan was to create an language-server class that gets gets passed io/ everything else relevant into its constructer and to write a bunch of glue-code to make it work inside a webworker, but getting the interface with monaco in a browser-environment to work seems kinda difficult for me
@@warro-jg2yq What an interesting idea. I haven't thought of running an LS in an editor in a browser but if extensions work generally, then you might be able to make it work. The big question in my mind is how you'd handle the server running as a separate process. That seems tricky in that environment. 🤔I wonder if you might find it easier building a general use LS and publishing it as an NPM package. That LS could export functions that you could call directly from an extension (rather than running a separate process). Everyone would get all the LS goodness for local dev and you'd be able to re-use your functionality for the in-browser editor.
extensions dont work (atl its not straightforward without a bunch of additional code), but theres a lsp-compliant bridge called monaco-languageclient that should work. as for the second process: webworker do run on a seperate thread, so if my ls-class was implemented correctly, everything should work quite smoothly
Fantastic tutorial!! I would love to see more material like this.
Thanks, Jesse! I think I’ll have to do a follow up soon 😁
Please continue. I’m trying to create my own language/framework compiler and I’ve always wanted to know how to do this. I’d very much love a deep deep dive into the subject! Thank you very much for making and sharing this video. 🙏🙏🙏
Thanks! Next video in this series is coming soon. I truly appreciate the kind words. Please let me know how your language turns out.
I tried to create my own LSP a few months ago, but ended giving up on it due to the lack of tutorials and good resources on it and lackluster documentation. This might help me restart the project, thank you for making this!
You can do it! Thanks for watching. Please let me know where your project ends up.
Please continue.
I'm struggle to create LSP for certain frameworks and libs that not so popular but useful for me.
🥺
You got it! I'm working on the next video right now. 😉
Managed to connect the client example with my server written in Rust. First time using js / ts, didnt expect it to work without any issues.
That's awesome, Arsen! Best of luck with your exploration here :)
Wow, thank you recommendation gods! Thank you for this, not many videos on this and the oens that do exist are kinda old. And your speaking voice and explanation style are awesome! Thanks!
Thank you so much for the kind words and for watching! Have a great day
this is cool! I'm planning on writing a toy language + compiler for it in golang, and an LSP will be a great addition to the project. Thanks for the awesome video, hope I get to see more contents on this channel!
That's awesome! LMK if you end up publishing that LSP, I'd love to take a look. I'm getting into Go, so I'm sure to have some future LSP+Go content here.
Fantastic content! I'll slowly follow along later this week. Thanks a LOT for the great LSP content!
Thank you for the kind words and have fun following along 😀
You were able to condense and distill what I thought was a pretty complex topic enough to make it look extremely simple. Thank you so much for putting this together!
You're very welcome, thanks for watching!
writing software isn't hard, these days, it's building the goddamn software lmao.
Where was this video when I needed it last year. Great video!
Glad you enjoyed it!
Thank you for doing this. I have been working on developing my own language and have been struggling to make an lsp. This video is great, again thank you!
That's awesome, Connor. Feel free to drop questions here if you have any. I'd love to see a link to whatever you build. 😃
Perfect tutorial, I am plan to build my own LS then this video come out, great ~
Please continue on making these amazing videos.
Thanks, Roy! I'm working on the third video now :)
And please let me know when your LS is available, I'd love to check it out
Thank you so much for this tutorial!
I had been thinking of adding syntax highlighting / code completion for vscode, but I ended up opting for notepad++.
Well, your tutorial made me confident that I could easily add some basic functionality to vscode for my language and now it's already a little better than just syntax highlighting.
Though, I have to admit, I ended up using your `Minimum Viable VS Code Language Server Extension` as my starting point, rather than writing it from scratch like in your video.
But, you do a really good job of revealing what's happening behind the scenes!
You should absolutely use the MVP extension rather than starting from scratch. If I were just concerned with building instead of teaching, I'd be leaning heavily on "vscode-languageserver" and "vscode-languageserver-textdocument" (which the MVP uses).
Good luck and let me know what you build :)
Really great tutorial! Very simple and well explained.
This video should be linked in the LSP docs.
Wow, thanks! What a compliment :)
This was a cool walk through. I failed looking at LSPs before, and now I was able to set one up, following along. Nice work!
If you do a follow up, I'd be happy to follow along making an LSP for some language that isn't already available IRL.
Thank you for the kind words. I'm definitely interested in tackling an unrepresented language. Do you have any suggestions that you think might be compelling?
Excellent tutorial. Thanks for sharing and please keep this series up! I hope there will be video talking about implementation of some common lsp capabilities like textDocument/definition or textDocument/reference.
Great suggestion! That might be good fodder for the next episode. Thanks!
Amazing work! Exactly what I'm looking for right now. Can't wait for the follow up :)
Thank you!
The only typescript video you ever need.
😄 Cheers!
thank you so much for making this, would love to see more.
More to come! Working on the follow-up right now.
finally someone makes contents on this topic
There's more on the way :)
Great stuff, dont usually see in depth for this topic
Thanks for watching!
Excellent content, and well presented! Thank you.
Thanks for watching, David. I'm glad you enjoyed it!
I enjoyed that tutorial, really interesting stuff.
I plan to keep it in the back of my mind when building my own stuff.
Great to hear. Thank you!
Simply an amazing video! Thank you so much for making this!!
My pleasure! I'm glad you enjoyed it :)
Good job! Printing 5MB dictionary to console for every completion was hilarious haha
😄 I'm glad you enjoyed it
really great video , one of the best recorded videos in my opinion
Thank you, Serizon! I'm glad you enjoyed it. You might also like the follow-up video: th-cam.com/video/t1nI8i-D4oM/w-d-xo.html
very very good presentation. thank you for your time!
My pleasure, thank you for watching!
0:10 I don't think I've ever heard "Typescript" and "no dependencies" in the same sentence :))
Hahaha. It is definitely all relative 😁 Carl Sagan once said, “If you wish to make an apple pie from scratch, you must first invent the universe.” So the whole "From Scratch" thing is a bit of a misnomer, no matter how you look at it.
@@semanticart The stdout approach was definitely my cup of "From Scratch"
I'm glad to hear it :)
This is fantastic. Please keep going!
Thank you for the encouragement!
Thank you for this, I always wanted to create a language server but I could never understand fully how it works.
You're very welcome!
Amazing content! It would be so nice to see a tutorial of building an LSP with another language like Go or Rust
Thanks! I’ll keep that in mind.
Awesome vid, just what I needed!
Glad it helped!
Great content! Is it possible to create a language server or, alternatively, connect to a language server from a web-based code editor?
Thank you. It is possible but it is trickier and depends on the execution context of the editor, etc. It is outside my area of expertise but I know that twitter.com/PaoloRicciuti has done this for www.sveltelab.dev/ with some combination of Codemirror and/or webcontainers.io/
He's a nice chap so I'm sure he'd be happy to give you a few pointers.
This was great content!
Thank you and thanks for watching!
Loving this tutorial, very well explained and with a great tempo.
One quick question, is there any reason why you are declaring all the interfaces instead of importing them from the "vscode-languageserver" package?
Thanks for the kind words!
Good question about the types. I have two main goals there: 1. to keep the "from scratch" approach of not having dependencies on any pre-existing LSP libraries and 2. to help teach people where they can find the types in the docs (which I hope will help people feel more confident about their ability to learn the LSP _and_ help people who aren't in the TS/JS ecosystem and can't use vscode-languageserver).
There's a tertiary goal to constrain them a little for our purposes (e.g. in the follow-up video, the official types have `data` as optional on the Diagnostic but in our language server we _always_ want to include data) but obviously I could accomplish that by amending the vscode-languageserver types.
In the real world, you should absolutely use vscode-languageserver if you're in the JS/TS ecosystem :)
@@semanticart Makes sense! Thanks for the tutorial, just finished part 1 and attacking part 2 now.
@@guibibi Awesome. I hope you enjoy!
Interesting, gonna watch it...
edit: adding comment, so that I can be notified even though I forgot to watch.
Let me know how you enjoy it :)
Great tutorial. Love stuff like this!
Glad you liked it! More to come 😎
whoever wondering what language you should create LSP for, here are advises: LDIF, ASN.1
Interesting. I wonder how many people are editing these by hand (versus generating them) 🤔
I may not know something but ASN.1 is exactly for ability to generate "from" and not "to". Writing LDAP queries in LDIF I bet happens more frequently but the point is that when you write a query for adding a new record to LDAP DS you want to see available object classes and attributes in schema which is defined in ASN.1
Gotcha. I'm definitely not knowledgeable in this space.
This is awesome, thank you!
You’re welcome! Thanks for watching
Wow, this is insane 🤪🤪🤪 please continue
Thank you! Stay tuned, I'm working on the follow-up now.
Ouh yea thank you sooo much. I need to build one and this will give me a good start I guess.
Good luck and have fun!
Awesome video!
Thank you so much
Awesome content 🔥, what would be approriate to optimize it further debounce or throttle on server side so that we send results of abc not a, ab and abc?
Great question! I'd try debouncing. To make it work, you'll need to introduce global state to keep track of pending completion requests and then selectively reply to them. In your example, after the debounce period expires, you can reply to `abc` with completions and you can reply to the requests for `a` and `ab` with `null`.
The client should re-request completions for `null` responses, so if the user later types `ab` it'll request it again and you can provide the completions you skipped before.
Related: You might want to cache completions if they're expensive to calculate and don't change.
Jonathan Blow loves this video
🤔I don’t get the reference.
th-cam.com/video/ZpGWzV9iJV4/w-d-xo.html @@semanticart
hahaha. Amazing. Thanks for sharing
@@semanticart I thought it will be funny 😅 seems quite interesting the video, I want to watch it to finally know what LSP are about
5:32 is this just an alias for git add patch using vimdiff or something? I really like this way of committing
I currently use "git diff -w ." and then add each file manually. I definitely should switch to an alias like this 😅
Good question! `add` is an alias I've set up for `git add --intent-to-add .; git add -p`. It lets you stage changes in parts for each changed file (including newly added files that aren't under git yet - that's the intent-to-add part). I like this approach because it lets me review and confirm each change. I can (e.g.) choose not to stage `console.log` debugging lines etc.
The prettier diffing is via github.com/dandavison/delta
@@semanticartthanks for the reply! nice little tool for the arsenal 😊
Thanks for the video! Any chance the next video could explain the library instead of writing everything from scratch? Regards
You're welcome. I'll think about that one. Stay tuned!
Want to know the real-world completion suggestion algorithm, based on the scope and the syntax, maybe even incomplete code. I'm trying to build some LSP, but the language is just too complicated.
I don't have any great resources or offhand knowledge about this, but it feels like a potentially good topic for a future video.
In the meantime, to provide suggestions based on syntax and scope, you might want to look at something like treesitter or other grammar parsers to help you get a syntax tree you can use to inform your completions.
Good luck and thanks for subscribing!
Great content 👌👌👌
Thank you 🙌
Great video! Only comment I'd make is that your audio is a bit quiet, especially at the start.
Noted, thanks. I'll do some digging and try to find a good guide on TH-cam audio. I'm still figuring all this out 😅
Very helpful 💪💪
Glad you think so! Thanks for watching
You rock!
Thanks for watching, Elian!
I'd be far more interested and impressed in doing the reverse; creating a code editor that can use arbitrary LSP's. I created a full-fledged editor over a week in the summer but never could get an LSP client implementation going.
Building an entire text editor isn't something I'm interested in but I do hope to build a client in an upcoming video for doing black-box testing. The idea is that you script requests/notifications from the client and make assertions on the responses from the server.
I love this content and I would love to be able to help support the creation of your content maybe through a TH-cam channel subscription or Patreon.
I loved the stuff on LSP and the command line tools like entr and the other json CLI from jq
Chris, wow, that is _super_ kind of you. I'd love to figure out ways to devote more time to this content. I'll be in touch if I get a Patreon off the ground or add TH-cam Memberships/Subscriptions.
Thanks again!
Hey I know it's been a few months, but this video has been really helping me become more familiar with LSP. I am building a language server for my internship. I was wondering if you have any idea why I am getting an error "The language server is either not installed, missing from PATH, or not executable." in neovim. Everything else worked flawlessly! Thanks!
Thank you for the kind words. This is a good question. There's a few things that can go wrong here. First I'd check to see if running the `cmd` for the `vim.lsp.start` runs fine when you run it directly from the terminal (it shouldn't do anything, but it should sit there waiting for input without crashing). If that works, then your neovim probably doesn't have the same $PATH setup as your terminal and you can pull on that thread (or specify absolute paths, etc). If that didn't work, then hopefully it exited with a helpful error message.
Let me know how it goes!
@@semanticartThanks for the quick reply! I confirmed that running the command "npx ts-node " did kick off the server. I am on Windows and have never used neovim before so it may be something with my neovim config or something. I didn't mention at first but the error message also includes "Spawning language server with cmd: {"npx", "ts-node", "" failed." So it is successfully trying to spawn it with (seemingly) the right command. I don't know where to look for more details on the failure. (like a neovim error log file or something?)
@@PriZ0nM1ke try this. Hit colon to get into command mode and do !npx ts-node and hit enter. See if you get any helpful message from that.
@@semanticart It runs the file (I put a console.log() at the start to confirm) but doesn't hang like in a terminal. Doesn't throw any errors as far as I can tell.
@@PriZ0nM1ke Hrm. Check the lsp log file (get the name via `:lua =require('vim.lsp.log').get_filename()`). You can also set `vim.lsp.set_log_level("DEBUG")
` BEFORE starting the language server to (hopefully) get more info
Is it required to use typescript instead of another programming language ?
No. You can write one in literally anything. Here's a very boring example I wrote in bash: prefab.cloud/blog/writing-a-language-server-in-bash/
I have no project that will use this. BUT I m thinking new project that will use 😄
Right on! This is inspiring technology and I'm glad to see you're inspired.
only 421 subscribers, lemme fix that
haha, thank you :)
this is awesome.
though it would probably be more reasonable to do this in a backend language like C / Zig.
Maybe. I'm just interested in teaching the concepts of the LSP. :)
Nice😊
Thank you! Cheers!
By the way it could be really nice to get the time stamps of the video.
Totally. They’re in the description and I’ve tried a half dozen tweaks but TH-cam isn’t showing them on the video. Google suggests there’s a bug afoot. It worked in the preview before I posted it. 😢
Good news, the chapters are working now!
@@semanticart Amazing!
1/3 part of video is about typing shit I try to understand.. thx very appropriate
Keep trying. You can understand it. I believe in you.
volume level is super low
Thanks for the heads up. I’m doing some research to fix it for the follow-up video
LSP in Java, C# and even PHP: The Liskov Substitution Principle
LSP in Golang: Language Server Protocol
Not sure if you're trolling or not, but this video has nothing to do with Golang. Also, there are language servers for Java, C#, and PHP.
Who else looked up what a Zyzzogeton is after spotting it in the wordlist xD
I use neovim because I am a beginner 😂
haha. I LOVE neovim and use it for my daily editor. You're in good company
Wow, I just built a LSP from scratch! Thank you! I couldn't get nvim to attach with just your code, but watching TJ's video with the vim.api.nvim_create_autocmd did the trick. Reference video with timestamp: watch?v=YsdlcQoHqPY&t=1915s
Right on, congrats! And I appreciate the heads-up about attaching.