How do “lang-servers” work within VScode? How can an extension figure out an entirely custom codebase and its functions and give me definitions on just right click?

441 views

It is crazy useful and ive no idea how it works.

Server makes me think it is a web service but it works even with like completely local code that is entirely custom and stuff.

All i know is i tend to need to compile the codebase once before it gets the new function definitions.

In: 5

18 Answers

Anonymous 0 Comments

servers don’t need to be exposed to the Internet for it to act as such, it can be bound to a local port, which you do if you want to do local webdev, or communicate via some IPC (inter process) mechanisms

programming languages are fairly rigid in that they are parseable, so the code editor just send your code for every interval via IPC to the “lang servers”, where it will parse your code and send back a detailed response of its structure in some standardised format that your code editor understands, without it actually know how to parse it

You are viewing 1 out of 18 answers, click here to view all answers.