Skip to content

Commit 7fc5c60

Browse files
committed
Describe emmylua alternative in CONTRIBUTING.md
1 parent 61093bf commit 7fc5c60

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ It is recommended to use it over the built-in Lua plugins.
136136
Please note that EmmyLua is not available for other editors based on Visual Studio Code,
137137
such as [VSCodium](https://vscodium.com) or [Eclipse Theia](https://theia-ide.org) but can be built from source if needed.
138138

139+
Another alternative on VSCode is to use [sumneko's Lua language server](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) along with [actboy168's debugger](https://marketplace.visualstudio.com/items?itemName=actboy168.lua-debug). These can potentially offer more features than EmmyLua, such as conditional breakpoints.
140+
139141
### Visual Studio Code
140142

141143
1. Create a new <kbd>Debug Configuration</kbd> of type <kbd>EmmyLua New Debug</kbd>
@@ -168,6 +170,34 @@ such as [VSCodium](https://vscodium.com) or [Eclipse Theia](https://theia-ide.or
168170
1. In VSCode click <kbd>Start Debugging</kbd> (the green icon) or press <kbd>F5</kbd>
169171
1. The debugger should connect
170172

173+
You might also want to use actboy168 debugger. This is possible by using for example the following launch.json configuration:
174+
175+
```json
176+
{
177+
"version": "0.2.0",
178+
"configurations": [
179+
{
180+
"name": "🍄attach",
181+
"type": "lua",
182+
"request": "attach",
183+
"stopOnEntry": false,
184+
"address": "127.0.0.1:12306",
185+
"luaVersion": "luajit",
186+
},
187+
188+
]
189+
}
190+
```
191+
192+
Then, similarly to the EmmyLua example:
193+
194+
1. Find the sub-folder that looks like `actboy168.lua-debug-x.y.z-win32-x64` in `%USERPROFILE%/.vscode/extensions`. Navigate to it and find the `debugger.lua` script under the script folder. Copy this to `runtime/lua`.
195+
2. Copy-paste the following code snippet into `launch:OnInit()`:
196+
```lua
197+
local debugger = require("debugger"):start("127.0.0.1:12306")
198+
-- debugger:event("wait") -- Uncomment this line if you want PoB to wait until the debugger is attached.
199+
```
200+
171201

172202
#### Excluding directories from EmmyLua
173203

@@ -195,6 +225,25 @@ Files in `/Data` `/Export` and `/TreeData` can be massive and cause the EmmyLua
195225

196226
This file can be customised according to what you want. It is a good idea to ignore test files as these tend to add things to the global namespace, which will look confusing, and they are designed to be run by Busted. `lua53_ops.lua` produces errors and doesn't actually get imported when using LuaJIT. It can be useful to keep the data and mod parser files, but generally this will increase the time the LSP takes to index the project on startup.
197227

228+
### Excluding directories from Sumneko's language server
229+
230+
If you prefer to not use EmmyLua, the following configuration works well for Sumneko's VS Code extension:
231+
232+
```json
233+
{
234+
"Lua.workspace.ignoreDir": [
235+
".vscode",
236+
"spec/*",
237+
"src/runtime/lua/sha1/*",
238+
"src/Export/*"
239+
],
240+
"Lua.diagnostics.disable": ["inject-field"],
241+
"Lua.runtime.version": "LuaJIT"
242+
}
243+
```
244+
245+
The extension will automatically skip large files from being preloaded (controlled by `Lua.workspace.preloadFileSize`), so they don't have to be excluded. The configuration file can be found by pressing Ctrl-Shift-P and selecting `Preferences: Open Workspace Settings (JSON)`.
246+
198247
### PyCharm Community / IntelliJ Idea Community
199248

200249
1. Create a new "Debug Configuration" of type "Emmy Debugger(NEW)".

0 commit comments

Comments
 (0)