factoriomod-debug 1.1.37 → 1.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,10 +8,6 @@
8
8
  * Adjust the paths and launch settings as required. Check Intellisense for additional launch options.
9
9
  * Press the green 'play' button or F5 to start debugging.
10
10
 
11
- ## Steam
12
-
13
- If you use a Steam install, a file `steam_appid.txt` with content `427520` in the same folder as the factorio binary (there will also be one of `steam_api64.dll`, `libsteam_api.dylib` or `libsteam_api.so` here) is required. If the Debug Adapter has write access to this folder, it will create this automatically. On macs, you may need to "Show Package Contents" to locate the correct folder.
14
-
15
11
  ## Runtime Lua Diagnostics
16
12
 
17
13
  The debugger also injects runtime diagnostics into all hooked mods:
@@ -1,12 +1,12 @@
1
- # Sumneko Lua LSP integration
1
+ # LuaLS (Sumneko) LSP integration
2
2
 
3
3
  FMTK provides a third party library package for the [sumneko.lua](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) language server which provides various adaptations to Factorio's Lua environment. The VS Code extension will automatically install this when a Factorio version is selected, or it can be generated manually with `fmtk sumneko-3rd`.
4
4
 
5
- In addition to the runtime-api docs (generated from [`runtime-api.json`](https://lua-api.factorio.com/latest/json-docs.html)), this package includes several static library files, configuration settings and a sumneko plugin that enables enhanced handling of `require`, `global`, event handlers, and `remote` interfaces.
5
+ In addition to the docs (generated from [`runtime-api.json`](https://lua-api.factorio.com/latest/auxiliary/json-docs-runtime.html) and [`prototype-api.json`](https://lua-api.factorio.com/latest/auxiliary/json-docs-prototype.html)), this package includes several static library files, configuration settings and a luals plugin that enables enhanced handling of `require`, `global`, event handlers, and `remote` interfaces.
6
6
 
7
7
  ## API Type Definitions
8
8
 
9
- Factorio's [`runtime-api.json`](https://lua-api.factorio.com/latest/json-docs.html) and [`prototype-api.json`](https://lua-api.factorio.com/latest/auxiliary/json-docs-prototype.html) are used to generate type definitions for most of the API.
9
+ Factorio's [`runtime-api.json`](https://lua-api.factorio.com/latest/auxiliary/json-docs-runtime.html) and [`prototype-api.json`](https://lua-api.factorio.com/latest/auxiliary/json-docs-prototype.html) are used to generate type definitions for most of the API.
10
10
 
11
11
  Event payload types are generated as subclasses of the generic event payload `EventData`, named like `EventData.on_event_name`. A library definition for `event_handler` is also generated.
12
12
 
@@ -20,7 +20,7 @@ In addition to the types listed in the json, a few extra related types are defin
20
20
 
21
21
  ## Libraries
22
22
 
23
- Factorio [modifies some builtin libraries](https://lua-api.factorio.com/latest/Libraries.html), and this package includes corresponding modified definitions for those libraries.
23
+ Factorio [modifies some builtin libraries](https://lua-api.factorio.com/latest/auxiliary/libraries.html), and this package includes corresponding modified definitions for those libraries.
24
24
 
25
25
  Type definitions are also included for some of the libraries included in `__core__/lualib`, such as `util` and `mod-gui`.
26
26
 
@@ -30,7 +30,7 @@ The VS Code extension will automatically configure `"Lua.workspace.userThirdPart
30
30
 
31
31
  ## Plugin Features
32
32
 
33
- Because Factorio mods run in [several Lua VMs](https://lua-api.factorio.com/latest/Data-Lifecycle.html), some functions have cross-VM behavior that cannot be described fully with type definitions. We handle these by providing a plugin which transforms them into a more easily understood form before the Language Server sees them.
33
+ Because Factorio mods run in [several Lua VMs](https://lua-api.factorio.com/latest/auxiliary/data-lifecycle.html), some functions have cross-VM behavior that cannot be described fully with type definitions. We handle these by providing a plugin which transforms them into a more easily understood form before the Language Server sees them.
34
34
 
35
35
  ### `require()`
36
36
 
@@ -45,7 +45,7 @@ Additionally, in require paths with slashes, Factorio replaces any file extensio
45
45
 
46
46
  ### `global`
47
47
 
48
- Each mod has its own private version of [the global named `global`](https://lua-api.factorio.com/latest/Global.html). To allow the Language Server to see this separation, `global` is renamed to `__modname__global` when used as the base variable in indexing or the target of assignment.
48
+ Each mod has its own private version of [the global named `global`](https://lua-api.factorio.com/latest/auxiliary/global.html). To allow the Language Server to see this separation, `global` is renamed to `__modname__global` when used as the base variable in indexing or the target of assignment.
49
49
 
50
50
  ### Event Handlers
51
51
 
@@ -0,0 +1,36 @@
1
+ # Setting up sumneko-3rd in other editors
2
+
3
+ If you want better LSP support outside of vscode, you can't just use the extension. You will need to generate the lua ls plugin and set the path to it in your editor.
4
+
5
+ # Generating files
6
+
7
+ Get [fmtk from npm](https://www.npmjs.com/package/factoriomod-debug), which is the commandline tool.
8
+
9
+ Find the docs that came with your game install (recommended) or download them. On Windows the default directory is ```C:\Program Files (x86)\Steam\steamapps\common\Factorio\doc-html```
10
+
11
+ If for some reason you need to, download the docs([direct link](https://lua-api.factorio.com/latest/static/archive.zip)) or go to the [API docs](https://lua-api.factorio.com/latest/) and download from the link in the bottom (same thing as the direct link).
12
+
13
+ Open that folder in a terminal and run the following command to generate the files:
14
+
15
+ ```fmtk sumneko-3rd -d runtime-api.json -p prototype-api.json```
16
+
17
+ This will make a folder called factorio in the directory you opened the terminal in. You can copy paste this anywhere at all, I put it in C:/libraries (luals will look in the entire folder for any libraries you put there).
18
+
19
+
20
+ # Inluding it in your LSP (Neovim)
21
+
22
+ Make sure you already have your LSP server working - add the following to your lspconfig:
23
+
24
+ ```lua
25
+ lspconfig.lua_ls.setup {
26
+ settings = {
27
+ Lua = {
28
+ workspace = {
29
+ library = {
30
+ [vim.fn.expand "C:/libraries"] = true,
31
+ },
32
+ },
33
+ },
34
+ },
35
+ }
36
+ ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "factoriomod-debug",
3
3
  "displayName": "Factorio Modding Tool Kit",
4
- "version": "1.1.37",
4
+ "version": "1.1.39",
5
5
  "publisher": "justarandomgeek",
6
6
  "description": "Debug Tools for developing Factorio Mods",
7
7
  "author": {
@@ -13,7 +13,7 @@
13
13
  "multi-root ready"
14
14
  ],
15
15
  "engines": {
16
- "vscode": "^1.83.0",
16
+ "vscode": "^1.84.0",
17
17
  "node": ">=18"
18
18
  },
19
19
  "icon": "images/factoriomod-debug-icon.png",
@@ -44,28 +44,28 @@
44
44
  "test": "c8 mocha"
45
45
  },
46
46
  "devDependencies": {
47
- "@types/archiver": "^5.3.3",
48
- "@types/buffers": "^0.1.32",
49
- "@types/chai": "^4.3.6",
50
- "@types/chai-as-promised": "^7.1.6",
51
- "@types/d3": "^7.4.1",
52
- "@types/dot-object": "^2.1.3",
53
- "@types/ini": "^1.3.31",
54
- "@types/inquirer": "^9.0.3",
55
- "@types/mocha": "^10.0.2",
56
- "@types/node": "^18.18.3",
57
- "@types/node-fetch": "^2.6.6",
58
- "@types/request": "^2.48.9",
59
- "@types/semver": "^7.5.3",
60
- "@types/vscode": "^1.83.0",
61
- "@types/vscode-webview": "^1.57.2",
47
+ "@types/archiver": "^5.3.4",
48
+ "@types/buffers": "^0.1.34",
49
+ "@types/chai": "^4.3.11",
50
+ "@types/chai-as-promised": "^7.1.8",
51
+ "@types/d3": "^7.4.3",
52
+ "@types/dot-object": "^2.1.6",
53
+ "@types/ini": "^1.3.33",
54
+ "@types/inquirer": "^9.0.7",
55
+ "@types/mocha": "^10.0.6",
56
+ "@types/node": "^18.18.13",
57
+ "@types/node-fetch": "^2.6.9",
58
+ "@types/request": "^2.48.12",
59
+ "@types/semver": "^7.5.6",
60
+ "@types/vscode": "^1.84.2",
61
+ "@types/vscode-webview": "^1.57.4",
62
62
  "@typescript-eslint/eslint-plugin": "^5.62.0",
63
63
  "@typescript-eslint/parser": "^5.62.0",
64
64
  "@vscode/codicons": "^0.0.32",
65
- "@vscode/debugadapter": "^1.63.0",
66
- "@vscode/debugadapter-testsupport": "^1.63.0",
67
- "@vscode/vsce": "^2.21.1",
68
- "@vscode/webview-ui-toolkit": "^1.2.2",
65
+ "@vscode/debugadapter": "^1.64.0",
66
+ "@vscode/debugadapter-testsupport": "^1.64.0",
67
+ "@vscode/vsce": "^2.22.0",
68
+ "@vscode/webview-ui-toolkit": "^1.3.1",
69
69
  "archiver": "^5.3.2",
70
70
  "c8": "^7.14.0",
71
71
  "chai": "^4.3.10",
@@ -77,9 +77,9 @@
77
77
  "esbuild": "^0.17.19",
78
78
  "esbuild-plugin-import-glob": "^0.1.1",
79
79
  "esbuild-visualizer": "^0.4.1",
80
- "eslint": "^8.50.0",
80
+ "eslint": "^8.54.0",
81
81
  "ini": "^3.0.1",
82
- "inquirer": "^9.2.11",
82
+ "inquirer": "^9.2.12",
83
83
  "jsonc-parser": "^3.2.0",
84
84
  "mimer": "^2.0.2",
85
85
  "mocha": "^10.2.0",
@@ -476,6 +476,26 @@
476
476
  "command": "factorio.setApiKey",
477
477
  "category": "Factorio",
478
478
  "title": "Set API Key"
479
+ },
480
+ {
481
+ "command": "factorio.selectVersion",
482
+ "category": "Factorio",
483
+ "title": "Select Version"
484
+ },
485
+ {
486
+ "command": "factorio.checkConfig",
487
+ "category": "Factorio",
488
+ "title": "Check Config"
489
+ },
490
+ {
491
+ "command": "factorio.disablePrototypeCache",
492
+ "category": "Factorio",
493
+ "title": "Disable Prototype Cache"
494
+ },
495
+ {
496
+ "command": "factorio.disableMouseAutoCapture",
497
+ "category": "Factorio",
498
+ "title": "Disable Mouse Auto Capture"
479
499
  }
480
500
  ],
481
501
  "views": {
@@ -750,16 +770,6 @@
750
770
  "type": "boolean",
751
771
  "description": "Add --check-unused-prototype-data to factorioArgs."
752
772
  },
753
- "checkGlobals": {
754
- "type": [
755
- "boolean",
756
- "array"
757
- ],
758
- "description": "Check for assignment to undefined globals. Boolean to enable/disable for all mods, or array of mod names (`#settings` and `#data` for settings/data stage).",
759
- "items": {
760
- "type": "string"
761
- }
762
- },
763
773
  "factorioArgs": {
764
774
  "type": "array",
765
775
  "items": {
package/readme.md CHANGED
@@ -9,6 +9,8 @@ A collection of tools for developing Factorio mods. This package is both [an npm
9
9
  * [Language Server integration for Lua](doc/language-lua.md) via [sumneko.lua](https://marketplace.visualstudio.com/items?itemName=sumneko.lua)
10
10
  * [Packaging and Publishing](doc/package.md)
11
11
 
12
+ * [Getting LSP on text editors other than vscode](doc/lsptutorial.md)
13
+
12
14
  ## Support FMTK
13
15
 
14
16
  [<img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi2.png?v=2' border='0' alt='Buy Me a Coffee at ko-fi.com'/>](https://ko-fi.com/X8X41IE4T)