Ludwig LSP Server

The Fugue Client Tools ships with lwserver, a Language Server Protocol server for Ludwig that works with editor integrations, such as the VS Code plugin for Ludwig.

Warning

lwserver is in beta mode, and the Ludwig plugin is highly experimental.

With lwserver and VS Code, you can get instant feedback on writing compositions through syntax highlighting, symbol searches, hover text on Ludwig types, error highlighting, and the ability to jump to a definition. Press <CMD-T> to search by name for anything that’s imported.

The EC2.Vpc.new constructor definition is shown when you hover over the function.

The EC2.Vpc.new constructor definition is shown when you hover over the function.

Ludwig errors are underlined in red. You can hover over the text to see the full error message.

Ludwig errors are underlined in red. You can hover over the text to see the full error message.

Getting Set Up

If you haven’t downloaded and installed the Fugue Client Tools yet, follow these instructions.

Install VS Code and launch it.

Select the Extensions icon in the left sidebar, delete the text in the search box, and enter “ludwig.” You should see the Ludwig plugin in the search results. Click “Install.”

The Ludwig extension in VS Code.

The Ludwig extension in VS Code.

Once the extension is installed, lwserver will start up automatically. Feel free to start writing a composition!

Caveats

As mentioned, lwserver is in beta mode. Currently, you may encounter issues when editing multiple files that depend upon each other. For example, if Comp1.lw and Lib.lw are both open, and Comp1.lw imports Lib.lw, when you update Lib.lw, Comp1.lw won’t reflect the changes.

Troubleshooting

You can restart lwserver by hitting <CMD-SHIFT-P> and typing “Restart Ludwig Language Server.”

Remember that lwserver is in beta mode, meaning it is under active development. If you encounter any unusual errors, feel free to reach out to support@fugue.co.