Skip to content

Editor integration

The editor packages are thin layers over the lsw CLI. The CLI stays the source of truth. Each package starts lsw commands, reads lsw ide env to configure the language tools, and starts lsw dap for debugging.

VS Code

Install the extension:

code --install-extension lsw.lsw

The extension gives you:

  • Commands: LSW: Setup / Init / Build / Run / Test / Doctor / Verify and LSW: Configure C/C++ IntelliSense (this writes .vscode/c_cpp_properties.json from lsw ide env).
  • Tasks for build, test, check, and package, with a problem matcher, so build errors are clickable.
  • An lsw debug type that runs lsw dap. lsw ide launch-config writes a ready .vscode/launch.json, or add an entry yourself:
{ "type": "lsw", "request": "launch", "name": "Debug PE",
  "program": "${workspaceFolder}/build/${workspaceFolderBasename}.exe" }

Neovim

Point your plugin manager at the editors/nvim directory of the repository, then call:

require("lsw").setup({ path = "lsw" })

The plugin supplies :LswBuild, :LswTest, :LswVerify, :LswRun [program], :LswConfigure (this reads lsw ide env into vim.g.lsw_*), and :LswEnv. When nvim-dap is installed, the plugin also adds an lsw adapter and a launch configuration.

JetBrains IDEs

editors/jetbrains/lsw-tools.xml is an External Tools definition. Copy it to the tools configuration directory of the IDE, for example ~/.config/JetBrains/<Product><Version>/tools/. Or create the entries under Settings > Tools > External Tools. It adds the actions LSW Build / Test / Verify / Run for the project directory.

Any other editor

Two stable interfaces cover the rest:

  • lsw ide env prints the target, the compiler, the sysroot, the include paths, the defines, and the Wine prefix, as JSON.
  • lsw dap is a Debug Adapter Protocol server on stdio.