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?

455 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

Imagine your editor can ask an expert questions about the codebase and help you navigate it that way. Then the editor doesn’t need to know much about each language – all the cool analysis is handled by the language-specific program.

That language expert program is the “language server.” It’s called a server because the editor can throw requests at it exactly the same way you’d ask a backend server for information.

In general, you shouldn’t think of a “server” as something that *has* to run remotely. You have *plenty* of computing power on your workstation to run local servers, and that’s typically how server development is done.

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