This repository only contains the code necessary for launching a Dockerfile language server that conforms to the language server protocol.
The actual code for parsing a Dockerfile and offering editor features such as code completion or hovers is not contained within this repository.

The code for analyzing and processing a Dockerfile is contained in the following three libraries:

All of the language server protocol requests that help create a rich editing experience for the user is forwarded to the dockerfile-language-service library.
You can test its features right in the browser.
This online editor is a very good representation of what is possible when this language server is connected to an editor that supports the language server protocol.

Development Instructions

If you wish to build and compile this language server, you must first install Node.js if you have not already done so.
After you have installed Node.js and cloned the repository with Git, you may now proceed to build and compile the language server with the following commands:

npm install
npm run build
npm test

If you are planning to change the code, use npm run watch to get the
TypeScript files transpiled on-the-fly as they are modified.

Once the code has finished compiling, you can connect a language server
client to the server via Node IPC, stdio, or sockets.

After the installation has completed, you can start the language
server with the docker-langserver binary. You should specify
the desired method of communicating with the language server via one
of the three arguments shown below.

Standard Input/Output

When writing directly to the process's stdin, the additional Content-Length
header must be included. Similarly, when reading from the process's stdout, the
header will be included in the response message.

Sockets

To communicate with the langauge server via a socket, a port must be opened
up first to listen for incoming connections. After the port is opened, the
language server may be started and told to connect to the specified port.
Messages can then be read from and written to the socket.

Just like when trying to communicate to the server using
stdio, the Content-Length headers must be written
and parsed explicitly.