|
71 | 71 | 2. **Open the folder in VS Code** |
72 | 72 | 3. **Start scripting** with preprocessing features! |
73 | 73 |
|
| 74 | +Note that SLua typechecking/linting will not work properly yet. |
| 75 | +For that to work, you'll need to also follow the instructions in |
| 76 | +[Recommended Extensions](#recommended-extensions) and [Using with Second Life Viewer](#using-with-second-life-viewer) below. |
| 77 | + |
74 | 78 | ### Basic Include Example (LSL) |
75 | 79 |
|
76 | 80 | Create modular, maintainable scripts: |
@@ -209,21 +213,36 @@ When `true` (default), configuration files are stored in your workspace's `.vsco |
209 | 213 |
|
210 | 214 | ## Using with Second Life Viewer |
211 | 215 |
|
| 216 | +Connecting to the Second Life Viewer is the primary purpose of this plugin. Connecting does 2 things: |
| 217 | +1. Syncs scripts/notecards between VS Code and Second Life Viewer |
| 218 | +2. Downloads SLua language definition files from Second Life Viewer. |
| 219 | + This enables the [Luau Language Server and Selene extensions](#recommended-extensions) to typecheck and lint SLua scripts. |
| 220 | + Note that you must be in a Lua-enabled sim for this to work. |
| 221 | + |
212 | 222 | ### Connection Setup |
213 | 223 |
|
214 | 224 | 1. **Enable External Script Editor** in Second Life viewer preferences |
215 | 225 | 2. **Set the editor** to connect via WebSocket on port 9020 (configurable) |
216 | 226 | 3. **Configure the extension** using VS Code settings for WebSocket connection |
217 | 227 |
|
218 | | -### Workflow |
| 228 | +### Editing a single script |
219 | 229 |
|
220 | 230 | 1. **Right-click** on an object in Second Life |
221 | | -2. **Select "Edit"** → **"Scripts"** |
| 231 | +2. **Select "Edit"** → **"Content"** |
222 | 232 | 3. **Click "New Script"** or **"Edit"** on existing script |
223 | | -4. **Choose external editor** - VS Code will automatically open |
| 233 | +4. **Click "Edit..." in the script window** - VS Code will automatically open |
224 | 234 | 5. **Edit in VS Code** with full preprocessing support |
225 | 235 | 6. **Save** to sync changes back to the viewer |
226 | 236 |
|
| 237 | +### Editing an entire prim |
| 238 | + |
| 239 | +1. **Right-click** on an object in Second Life |
| 240 | +2. **Select "Edit"** → **"Content"** |
| 241 | +3. **Click "Explore in IDE"** - VS Code will automatically open |
| 242 | +4. In the VS Code Explorer tab, **expand the "Second Life (connected)" section** |
| 243 | +5. **Browse and edit** all scripts and notecards in that prim |
| 244 | +6. **Save** to sync changes back to the viewer |
| 245 | + |
227 | 246 | ### Linux-specific instructions |
228 | 247 | If using the flatpak version of vscode, the External Script Editor command is: |
229 | 248 | ``` |
@@ -384,14 +403,22 @@ For enhanced language support and features, install these language server extens |
384 | 403 | - **Selene** (`kampfkarren.selene-vscode`) - Lua linter and language support |
385 | 404 | - **Luau Language Server** (`johnnymorganz.luau-lsp`) - Luau language server |
386 | 405 |
|
| 406 | +Note that SLua typechecking/linting files are not included with this plugin, and need to be downloaded from the viewer. |
| 407 | +You will get errors like: |
| 408 | +``` |
| 409 | +TypeError: Unknown global 'll'; consider assigning to it first |
| 410 | +``` |
| 411 | +until you also follow the instructions in [Using with Second Life Viewer](#using-with-second-life-viewer) above. |
| 412 | + |
387 | 413 | **For LSL files:** |
388 | 414 | - **LSL Language Server** (such as `sekkmer.vscode-lsl-lsp`) - LSL language support with diagnostics |
389 | 415 |
|
390 | 416 | **Additional Extensions for Enhanced Development:** |
391 | 417 | - **StyLua** (`johnnymorganz.stylua`) - Lua code formatter |
392 | 418 | - **VSCode LSL** (`vrtlabs.vscode-lsl`) - Alternative LSL language support |
393 | 419 |
|
394 | | -**Note**: These extensions are optional but recommended for the best development experience. The preprocessor and viewer integration features work independently of these language servers. |
| 420 | +**Note**: These extensions are optional but recommended for the best development experience. |
| 421 | +The preprocessor and viewer integration features work independently of these language servers. |
395 | 422 |
|
396 | 423 | --- |
397 | 424 |
|
|
0 commit comments