Skip to content

Commit 6efbd18

Browse files
authored
Merge pull request #86 from tapple/instructions
Improve the VSCode plugin setup instructions
2 parents bfeecfc + 21acb37 commit 6efbd18

1 file changed

Lines changed: 31 additions & 4 deletions

File tree

README.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ Or
7171
2. **Open the folder in VS Code**
7272
3. **Start scripting** with preprocessing features!
7373

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+
7478
### Basic Include Example (LSL)
7579

7680
Create modular, maintainable scripts:
@@ -209,21 +213,36 @@ When `true` (default), configuration files are stored in your workspace's `.vsco
209213

210214
## Using with Second Life Viewer
211215

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+
212222
### Connection Setup
213223

214224
1. **Enable External Script Editor** in Second Life viewer preferences
215225
2. **Set the editor** to connect via WebSocket on port 9020 (configurable)
216226
3. **Configure the extension** using VS Code settings for WebSocket connection
217227

218-
### Workflow
228+
### Editing a single script
219229

220230
1. **Right-click** on an object in Second Life
221-
2. **Select "Edit"****"Scripts"**
231+
2. **Select "Edit"****"Content"**
222232
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
224234
5. **Edit in VS Code** with full preprocessing support
225235
6. **Save** to sync changes back to the viewer
226236

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+
227246
### Linux-specific instructions
228247
If using the flatpak version of vscode, the External Script Editor command is:
229248
```
@@ -384,14 +403,22 @@ For enhanced language support and features, install these language server extens
384403
- **Selene** (`kampfkarren.selene-vscode`) - Lua linter and language support
385404
- **Luau Language Server** (`johnnymorganz.luau-lsp`) - Luau language server
386405

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+
387413
**For LSL files:**
388414
- **LSL Language Server** (such as `sekkmer.vscode-lsl-lsp`) - LSL language support with diagnostics
389415

390416
**Additional Extensions for Enhanced Development:**
391417
- **StyLua** (`johnnymorganz.stylua`) - Lua code formatter
392418
- **VSCode LSL** (`vrtlabs.vscode-lsl`) - Alternative LSL language support
393419

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.
395422

396423
---
397424

0 commit comments

Comments
 (0)