You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+47-52Lines changed: 47 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,60 +136,61 @@ It is recommended to use it over the built-in Lua plugins.
136
136
Please note that EmmyLua is not available for other editors based on Visual Studio Code,
137
137
such as [VSCodium](https://vscodium.com) or [Eclipse Theia](https://theia-ide.org) but can be built from source if needed.
138
138
139
-
Note that you will need to have [Java](https://www.java.com/) installed to use emmyLua, and have either the JAVA_HOME environment variable correctly set up or have the path to java added to the `settings.json` file. Example:
To do this in VSCode find the Java installation folder on your computer as displayed above.
144
-
1. Navigate to extensions inside VSCode
145
-
2. Click the cog icon next to EmmyLua -> Extension Settings
146
-
3. Find "Java: Home" -> Edit settings
147
-
4. Place the directory address between the quotes
148
-
5. File -> Save
149
-
150
-
151
139
### Visual Studio Code
152
140
153
-
1. Create a new "Debug Configuration" of type "EmmyLua New Debug"
154
-
2. Open the Visual Studio Code extensions folder. On Windows, this defaults to `%USERPROFILE%/.vscode/extensions`.
155
-
3. Find the sub-folder that contains `emmy_core.dll`. You should find both x86 and x64; pick x64. For example, `C:/Users/someuser/.vscode/extensions/tangzx.emmylua-0.5.19/debugger/emmy/windows/x64`.
156
-
4. Paste the following code snippet directly below `function launch:OnInit()` in `./src/Launch.lua`:
157
-
```lua
158
-
-- This is the path to emmy_core.dll. The ?.dll at the end is intentional.
-- This port must match the IDE configuration. Default is 9966.
162
-
dbg.tcpListen("localhost", 9966)
163
-
-- Uncomment the next line if you want Path of Building to block until the debugger is attached
164
-
--dbg.waitIDE()
165
-
```
166
-
5. Start Path of Building Community
167
-
6. Attach the debugger
168
-
169
-
#### Excluding directories from emmyLua
141
+
1. Create a new <kbd>Debug Configuration</kbd> of type <kbd>EmmyLua New Debug</kbd>
142
+
1. Open `./src/Launch.lua`
143
+
1. Click the beginning of the line directly after `function launch:OnInit()`
144
+
1. Insert the debugger code:
145
+
146
+
Automatically:
147
+
1. Open the Command Palette (<kbd>F1</kbd>)
148
+
1. Type <kbd>EmmyLua: Insert Emmy Debugger Code</kbd>
149
+
1. Choose `x64` from the drop-down list
150
+
151
+
Or manually:
152
+
1. Open the Visual Studio Code extensions folder. On Windows, this defaults to `%USERPROFILE%/.vscode/extensions`
153
+
1. Find the sub-folder that contains `emmy_core.dll`. You should find both x86 and x64; pick x64. For example, `C:/Users/someuser/.vscode/extensions/tangzx.emmylua-0.9.22-win32-x64/debugger/emmy/windows/x64`. Uses this in the snippet below. Note the version number will change with every update.
154
+
1. Copy-paste the following code snippet:
155
+
```lua
156
+
-- Path to emmy_core.dll. You will need to update it to point to the EmmyLua dlls in YOUR installation.
157
+
-- Note the "?.dll" at the end of the path is mandatory.
-- This port must match the IDE configuration. Default is 9966.
161
+
dbg.tcpListen("localhost", 9966)
162
+
--dbg.waitIDE() -- Uncomment this line if you want PoB to wait until the debugger is attached.
163
+
```
164
+
1. Set breakpoints in the source with VSCode's built-in breakpoint system (or use a non-local `dbg` and call `_G.dbg.breakHere()`)
165
+
1. Click the <kbd>Run and Debug</kbd> icon on the *Activity Bar*
166
+
1. Make sure <kbd>EmmyLua New Debug</kbd> is selected in the "Run and Debug" dropdown
167
+
1. Start your modified <kbd>Path of Building Community</kbd>
168
+
1. In VSCode click <kbd>Start Debugging</kbd> (the green icon) or press <kbd>F5</kbd>
169
+
1. The debugger should connect
170
+
171
+
172
+
#### Excluding directories from EmmyLua
170
173
171
174
Depending on the amount of system ram you have available and the amount that gets assigned to the jvm running the emmylua language server you might run into issues when trying to debug Path of building.
172
-
Files in /Data/Export and /TreeData can be massive and cause the emmyLua language server to use a significant amount of memory. Sometimes causing the language server to crash. To avoid this and speed up initialization consider adding an `emmy.config.json` file to the .vscode folder in the root of the Path of building repository with the following content:
175
+
Files in `/Data``/Export` and `/TreeData` can be massive and cause the EmmyLua language server to use a significant amount of memory. Sometimes causing the language server to crash. To avoid this and speed up initialization consider adding an `.emmyrc.json` file to the `.vscode` folder in the root of the Path of building folder with the following content:
PoB uses the [Busted](https://olivinelabs.com/busted/) framework to run its tests. Tests are stored under `spec/System` and run automatically when a PR is modified.
212
+
PoB uses the [Busted](https://lunarmodules.github.io/busted/) framework to run its tests. Tests are stored under `spec/System` and run automatically when a PR is modified.
212
213
More tests can be added to this folder to test specific functionality, or new test builds can be added to ensure nothing changed that wasn't intended.
213
214
214
215
### Running tests
@@ -220,15 +221,9 @@ More tests can be added to this folder to test specific functionality, or new te
220
221
Please try to include tests for your new features in your pull request. Additionally, if your pr breaks a test that should be passing please update it accordingly.
221
222
222
223
### Debugging tests
223
-
When running tests with a docker container it is possible to use emmylua for debugging. Paste in the following right under `function launch:OnInit()` in `./src/Launch.lua`:
-- This port must match the IDE Code configuration. Default is 9966.
228
-
dbg.tcpListen("localhost", 9966)
229
-
dbg.waitIDE()
230
-
```
231
-
After running `docker-compose up` the code will wait at the `dbg.waitIDE()` line until a debugger is attached. This will allow stepping through any code that is internal to POB but will not work for busted related code. Note that this only works for unit tests described above.
224
+
When running tests with a docker container it is possible to use EmmyLua for debugging. Follow the instructions for inserting the debugger snippet as shown above in [Visual Studio Code](#Visual-Studio-Code), then uncomment the `dbg.waitIDE()` line.
225
+
226
+
After running `docker-compose up` the code will wait at that line until a debugger is attached. This will allow stepping through any code that is internal to POB but will not work for busted related code. Note that this only works for unit tests described above.
0 commit comments