mirror of
https://github.com/lune-org/docs.git
synced 2024-12-12 13:00:37 +00:00
61 lines
1.7 KiB
Text
61 lines
1.7 KiB
Text
|
import { Steps } from "nextra/components"
|
||
|
|
||
|
# Editor Setup
|
||
|
|
||
|
Lune prioritizes developer experience, and as such type definitions and documentation are provided
|
||
|
for several editors and tools without any additional downloads. This guide will help you get set up
|
||
|
with your editor environment.
|
||
|
|
||
|
## Luau Language Server
|
||
|
|
||
|
Lune provides type definitions and documentation using the open source Luau Language Server, also
|
||
|
known as [`luau-lsp`](https://github.com/JohnnyMorganz/luau-lsp).
|
||
|
|
||
|
These steps assume you have access to a terminal, that you have already installed Lune, and that it
|
||
|
is available to run in the current directory.
|
||
|
|
||
|
<Steps>
|
||
|
|
||
|
### Step 1
|
||
|
|
||
|
Run the following command in your terminal to generate Luau type definitions for your installed
|
||
|
version of Lune:
|
||
|
|
||
|
```sh
|
||
|
lune --setup
|
||
|
```
|
||
|
|
||
|
### Step 2
|
||
|
|
||
|
Verify that type definition files have been generated, these should be located in your home
|
||
|
directory and you can list them using `ls`:
|
||
|
|
||
|
```sh
|
||
|
ls ~/.lune/.typedefs/
|
||
|
```
|
||
|
|
||
|
Your currently installed version of Lune should appear, along with any previously installed versions
|
||
|
you have type definitions for, when running this command.
|
||
|
|
||
|
### Step 3
|
||
|
|
||
|
Modify your editor settings. If you are using Visual Studio Code you can do this either by using the
|
||
|
settings menu or by manually pasting these settings in your `settings.json` file:
|
||
|
|
||
|
```json
|
||
|
"luau-lsp.require.mode": "relativeToFile",
|
||
|
"luau-lsp.require.directoryAliases": {
|
||
|
"@lune/": "~/.lune/.typedefs/x.y.z/"
|
||
|
}
|
||
|
```
|
||
|
|
||
|
These settings will:
|
||
|
|
||
|
- Set the require mode to work with Lune
|
||
|
- Add type definitions for Lune built-in libraries
|
||
|
|
||
|
_**NOTE:** If you already had a `.vscode/settings.json` file in your current directory the type
|
||
|
definition files may have been added automatically!_
|
||
|
|
||
|
</Steps>
|