> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: Editor Setup
description: Get autocompletion, hover docs, and type checking for the CS2 API in VS Code, Zed, JetBrains IDEs, or any editor with Lua Language Server support.
icon: square-terminal
sidebar_position: 3
---

# Editor Setup

The CS2 API ships as type definitions for the
[Lua Language Server](https://luals.github.io/) (LuaLS). With them installed,
your editor completes API names, shows the same docs you read on this site when
you hover a name, and warns you about wrong arguments before you reload the
extension. Any editor with LuaLS support works, including VS Code, Zed, and
JetBrains IDEs.

## 1. Get the definitions

Clone the repository with git, or download it as a ZIP from GitLab and extract
it somewhere permanent:

```bash
git clone https://gitlab.com/neverlose/LuaLS-CS2.git
```

Remember where the folder ends up. The examples below use
`C:/Users/<you>/Downloads/LuaLS-CS2`.

## 2. Add `.luarc.json` to your extension

Local extensions live under:

```text
C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\bin\win64\neverlose\extensions\
```

In your extension's folder (for example `extensions\example`), create a file
named `.luarc.json`:

```json .luarc.json
{
  "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
  "runtime.version": "LuaJIT",
  "runtime.builtin": {
    "basic": "disable",
    "bit": "disable",
    "bit32": "disable",
    "builtin": "disable",
    "coroutine": "disable",
    "debug": "disable",
    "ffi": "disable",
    "io": "disable",
    "jit": "disable",
    "jit.profile": "disable",
    "jit.util": "disable",
    "math": "disable",
    "os": "disable",
    "package": "disable",
    "string": "disable",
    "string.buffer": "disable",
    "table": "disable",
    "table.clear": "disable",
    "table.new": "disable",
    "utf8": "disable"
  },
  "completion.maxSuggestCount": 500,
  "workspace.preloadFileSize": 2500,
  "workspace.maxPreload": 25000,
  "workspace.library": [
    "C:/Users/<you>/Downloads/LuaLS-CS2/library"
  ]
}
```

Set `workspace.library` to the `library` folder inside your clone or extracted
ZIP, not the repository root. Use forward slashes (`/`) or escaped backslashes
(`\\`); a single `\` is not valid JSON.

<Note>
  All `runtime.builtin` entries are disabled on purpose. The definitions
  include their own versions of the LuaJIT standard library as Neverlose
  exposes it, so the LuaLS built-ins would only add duplicate or wrong entries.
</Note>

## 3. Set up your editor

`.luarc.json` is read by the language server, not the editor, so the same file
works everywhere. LuaLS only reads it from the workspace root: open the
extension folder itself, not a parent folder.

<Tabs>
  <Tab title="VS Code" icon="code">
    1. Install the [Lua extension by sumneko](https://marketplace.visualstudio.com/items?itemName=sumneko.lua). It bundles LuaLS.
    2. Open the extension folder with **File → Open Folder…**.
  </Tab>

  <Tab title="Zed" icon="zap">
    1. Install the **Lua** extension from the Extensions panel. Zed downloads LuaLS for you. See [Zed's Lua docs](https://zed.dev/docs/languages/lua).
    2. Open the extension folder with **File → Open…**.
  </Tab>

  <Tab title="JetBrains" icon="blocks">
    1. Install the [SumnekoLua](https://plugins.jetbrains.com/plugin/22315-sumnekolua) plugin from **Settings → Plugins → Marketplace**.
    2. Open the extension folder as a project.
  </Tab>

  <Tab title="Other editors" icon="terminal">
    Any editor with a Language Server Protocol client can run
    `lua-language-server`. Install the server, start it for `.lua` files, and
    open the extension folder as the workspace root.
  </Tab>
</Tabs>

## 4. Check that it works

Wait for the language server to finish loading the definitions; the first load
takes a few seconds. Then type a global such as `render.` in `main.lua`, and
completions should appear.

<Card title="Getting Started" icon="rocket" href="/cs2/api_reference/introduction/getting-started" arrow>
  Create your first extension and write a script that draws to the screen.
</Card>
