factoriomod-debug 1.1.24

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.
@@ -0,0 +1,29 @@
1
+ # Debug Adapter
2
+
3
+ ## Using Factorio Mod Debug
4
+
5
+ * Install the **Factorio Mod Debug** extension in VS Code.
6
+ * Switch to the run/debug view (View->Run) and select "create a launch.json file"
7
+ * Select the debug environment "Factorio Mod Debug".
8
+ * Adjust the paths and launch settings as required. Check Intellisense for additional launch options.
9
+ * Press the green 'play' button or F5 to start debugging.
10
+
11
+ ## Debugging inside Zip Files
12
+
13
+ If [Zip File Explorer](https://marketplace.visualstudio.com/items?itemName=slevesque.vscode-zipexplorer) is also installed, breakpoints and stepping will work inside zipped mods.
14
+
15
+ ## Steam
16
+
17
+ If you use a Steam install, a file `steam_appid.txt` with content `427520` in the same dir as the factorio binary is required. If the Debug Adapter has write access to the dir, it will create this automatically.
18
+
19
+ ## Runtime Lua Diagnostics
20
+
21
+ The debugger also injects runtime diagnostics into all hooked mods:
22
+
23
+ * Global Assignment: A warning will be issued on the first assignment to an undefined global variable. `__DebugAdapter.defineGlobal(name)` can be used to disable this warning for the given name.
24
+ * Event Handler Replacement: A warning will be issued when an event handler is registered to an event that already has a handler that is not equal to the new one.
25
+
26
+ ## Advanced Features
27
+
28
+ * [Debugger Mod API](doc/debugapi.md)
29
+ * [Custom Debug Views](doc/variables.md)
@@ -0,0 +1,37 @@
1
+ # Debugger API
2
+
3
+ ## Detecting Debugging
4
+
5
+ Mods may detect that the debugger is attached by the presence of the global variable `__DebugAdapter`. Mods **MUST NOT** create this variable themselves, or write to any fields within it.
6
+
7
+ ## String Interpolation
8
+
9
+ Several locations in the interface use string interpolation with expressions in `{}`. The inner expression is evaluated as lua code. `{[}` and `{]}` can be used to emit literal `{` and `}`.
10
+
11
+ When used with Logpoint expressions, exception strings, and `__DebugAdapter.print()`, the inner expression has access to all locals and upvalues at the current location, and the expression `{...}` will represent the varargs available at that location, if available.
12
+
13
+ The expression always has access to globals.
14
+
15
+ ## Debug Print
16
+
17
+ The function `__DebugAdapter.print(expr,alsoLookIn)` can be used to print messages using string interpolation to the vscode debug console. An indexable object `alsoLookIn` may provide additional values for the expressions in the string, which will be used before other variables.
18
+
19
+ ## Manual Breakpoints
20
+
21
+ If normal breakpoints are unusable for some reason, you can call `__DebugAdapter.breakpoint(mesg:LocalisedString)` to break. If `mesg` is specified, it is displayed in the editor like an exception.
22
+
23
+ ## Terminate Session
24
+
25
+ `__DebugAdapter.terminate()` can be used to terminate a debug session from mod code.
26
+
27
+ ## Simulate Events
28
+
29
+ `__DebugAdapter.raise_event(event:defines.events|number|string,data:EventData,modname:string)` can be used to call event handlers directly for testing. `data` is not validated, so you must ensure it is a well-formed event payload for `event` yourself. All event and custom-input handlers are raisable, even those not raisable through `script`.
30
+
31
+ ## Ignore Functions in Stepping
32
+
33
+ Functions can be excluded from stepping with `__DebugAdapter.stepIgnore(funcOrTable)`.
34
+
35
+ ## Disable dumping for large files
36
+
37
+ files can be excluded from dumping with `__DebugAdapter.dumpIgnore(nameOrNames)`. These must be exact source names, e.g. `"@__modname__/file.lua"`. This will disable disassembly, breakpoint validation, phobos debug symbols, and possibly other future features in these files. This may be appropriate if you are experiencing long hangs on `require`s of large (5+MB) data files.
@@ -0,0 +1,9 @@
1
+ # JSON Validation
2
+
3
+ JSON Validation and Intellisense is provided for all of Factorio's JSON files:
4
+ * Mod `info.json`
5
+ * Scenario and Campaign `description.json`
6
+ * Locale `info.json`
7
+ * `map-settings.json`
8
+ * `map-gen-settings.json`
9
+ * `server-settings.json`
@@ -0,0 +1,82 @@
1
+ # Sumneko Lua LSP integration
2
+
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
+
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.
6
+
7
+ ## Runtime API Docs
8
+
9
+ Factorio's [`runtime-api.json`](https://lua-api.factorio.com/latest/json-docs.html) is used to generate class definitions for most of the runtime API.
10
+
11
+ Event payload types are generated as subclasses of the generic event payload `EventData`, named like `EventData.on_event_name`.
12
+
13
+ Some types in the API have multiple definitions for the same type name, especially Concepts which accept both named-keys tables or array-like tables. In these cases the type will be a union of the set of definions, with the subtypes named `TypeName.0`, `TypeName.1`, etc.
14
+
15
+ In addition to the types listed in the json, a few extra related types are defined:
16
+ * `LuaObject.object_name`: Union of all LuaObject class names seen in the json.
17
+ * `BlueprintCircuitConnection`, `BlueprintControlBehavior`: Concepts referenced by the json but not present in it. These are included in the static libraries.
18
+
19
+ ## Libraries
20
+
21
+ Factorio [modifies some builtin libraries](https://lua-api.factorio.com/latest/Libraries.html), and this package includes corresponding modified definitions for those libraries.
22
+
23
+ Type definitions are also included for some of the libraries included in `__core__/lualib`, such as `util` and `mod-gui`.
24
+
25
+ ## Configuration
26
+
27
+ The VS Code extension will automatically configure `"Lua.workspace.userThirdParty"` when installing this package, as well as updating `"Lua.workspace.library"` with a link to `/data` in the selected version.
28
+
29
+ ## Plugin Features
30
+
31
+ 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.
32
+
33
+ ### `require()`
34
+
35
+ Factorio allows requiring files from another mod with a `__modname__` prefix:
36
+ ```lua
37
+ require("__modname__.filename")
38
+ ```
39
+
40
+ The underscores are removed from these, allowing the Language Server to properly locate files if the modname matches a directory in the workspace (or libraries).
41
+
42
+ ### `global`
43
+
44
+ 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.
45
+
46
+ ### Event Handlers
47
+
48
+ When inline functions are used as event handlers, a `@param` tag will be automatically inserted for the event-specific payload type, to make all the event fields visible.
49
+
50
+ ### `remote` interfaces
51
+
52
+ Because `remote` interfaces are registered and called through separate API functions, the Language Server can't make the appropriate connections to provide signature help when calling. To address this, `remote.call` and `remote.add_interface` are transformed to appear as direct access through a virtual table `__typed_interfaces`:
53
+
54
+ ```lua
55
+ remote.add_interface("foo", {
56
+ ---@param hello string
57
+ ---@param world string
58
+ ---@return number
59
+ bar = function(hello, world)
60
+ return 42
61
+ end,
62
+ })
63
+
64
+ remote.call("foo", "bar", "arg 1", "arg 1")
65
+ ```
66
+ Would appear to the Language Server as
67
+ ```lua
68
+ remote.__typed_interfaces.foo = ({
69
+ ---@param hello string
70
+ ---@param world string
71
+ ---@return number
72
+ bar = function(hello, world)
73
+ return 42
74
+ end,
75
+ })
76
+
77
+ remote.__typed_interfaces.foo.bar("arg 1", "arg 2")
78
+ ```
79
+
80
+ ### LuaObject Type Tests
81
+
82
+ To allow the Language Server to see that `LuaObject.object_name` is "like `type()`" for type tests, such as `if obj.object_name == "LuaPlayer" then end`, the plugin rewrites it to appear as an internal function `if __object_name(obj) == "LuaPlayer" then end`, and this function is marked as "like `type()`" in the configuration.
@@ -0,0 +1,15 @@
1
+ # Changelog and Locale
2
+
3
+ ## Syntax Highlighting
4
+
5
+ Syntax highlighting is provided for Changelog and Locale files with Textmate grammar, and snippets are provided for many common patterns.
6
+
7
+ ## Changelog Language Server
8
+
9
+ The `fmtk lsp` language server provides support for changelog files, including document outline and syntax validation.
10
+
11
+ ## Locale Language Server
12
+
13
+ The `fmtk lsp` language server provides support for locale files, including document outline and syntax validation.
14
+
15
+ In addition, locale keys are provided as completion items when typing strings in Lua, and "Go To Definition" is supported on locale key strings in Lua.
package/doc/package.md ADDED
@@ -0,0 +1,49 @@
1
+ # Automatic Mod Packaging and Publishing
2
+
3
+ Mods can be automatically Packaged and Published from the "Factorio Mod Packages" panel (in SCM view by default, View->Open View...-> "Factorio Mod Packages" if you can't find it).
4
+
5
+ ## API Key
6
+
7
+ Uploading to the mod portal requires an API key with the `ModPortal: Upload Mods` usage, which can be created on https://factorio.com/profile. You will be prompted for this key when it is first required.
8
+
9
+ ## Tasks
10
+
11
+ These tasks can also be accessed in VSCode's Tasks system. Custom scripts will run inside the mod directory and have the environment variables `FACTORIO_MODNAME` and `FACTORIO_MODVERSION` provided. Tasks can also be run from command line with `fmtk`.
12
+
13
+ ### Run Script
14
+ * run any script from `info.json#/package/scripts[name]`
15
+
16
+ ### Datestamp
17
+ * if changelog.txt present and has a section for the current version, update its date to today
18
+ * run `info.json#/package/scripts/datestamp` if set
19
+
20
+ ### Package
21
+ * run `info.json#/package/scripts/compile` if set
22
+ * run `info.json#/package/scripts/prepackage` if set
23
+ * build a zip including all files in the mod directory except dotfiles, zip files named `modname_*.zip`, and files matching the list of globs in `info.json#/package/ignore`. If you need to include other files, you can list additional root directories in `info.json#/package/extra`. You are responsible for ensuring that you don't include directories that result in two files of the same name in the zip! (Because my zip library doesn't tell me when this happens.)
24
+
25
+ ### Increment Version
26
+ * increment version in info.json
27
+ * if changelog.txt present, add new empty section to changelog.txt
28
+ * run `info.json#/package/scripts/version` if set
29
+
30
+ ### Upload
31
+ * select a package in mod directory
32
+ * upload to mod portal
33
+
34
+ ### Publish
35
+
36
+ All-in-one command.
37
+
38
+ * verify no uncommitted changes, on default branch (`git config init.defaultBranch`, or branch set in `info.json#/package/git_publish_branch`)
39
+ * run `info.json#/package/scripts/prepublish` if set
40
+ * run **Datestamp**
41
+ * git commit "preparing release of version x.y.z", tag x.y.z
42
+ * run **Package**
43
+ * git tag, unless `info.json#/package/no_git_tag` is set
44
+ * run `info.json#/package/scripts/publish` if set
45
+ * upload to mod portal, unless `info.json#/package/no_portal_upload` is set
46
+ * run `info.json#/package/scripts/postpublish` if set, with extra environment variable `FACTORIO_MODPACKAGE` with the filename of the built zip in a temporary folder.
47
+ * run **Increment Version**
48
+ * commit "moved to version x.y.z"
49
+ * push to git upstream, unless `info.json#/package/no_git_push` is set
package/doc/profile.md ADDED
@@ -0,0 +1,9 @@
1
+ # Profiling
2
+
3
+ Setting `"hookMode": "profile"` in your launch config to enables profiling. This mode does not provide debug feaures (stepping, inspection, etc), but instead provides inline timing/hitcount data for every line and function executed in control stage. Flamegraph, highlighting and rulers are also provided to assist in finding hotspots. Mods may recognize the this mode by the presence of the global variable `__Profiler`. Mods **MUST NOT** create this variable themselves, or write to any fields within it.
4
+
5
+ The profiler also provides a remote inteface `profiler` with the following functions:
6
+
7
+ * `dump()` - dump all timers immediately
8
+ * `slow()` - return to slow-start mode (dumping on return from every event temporarily)
9
+ * `save(name)` - return to slow-start mode and trigger an autosave with the given name. Defaults to "profiler" if unspecified.
@@ -0,0 +1,21 @@
1
+ # Custom Debug Views
2
+
3
+ The debug views of tables can be customized using metatables to override default rendering.
4
+
5
+ The default lineitem for a table can be overridden by the metamethod `__debugline`, which can be either a string or a function `__debugline(self)->string` which takes the table as an argument and returns a string. If `__debugline` is a string, [String Interpolation](./debugapi.md#string-interpolation) will be applied, with members of the current object avaliable to expressions, as well as the object itself as `self`.
6
+
7
+ The typename for a table can be overridden by a string in the metatable field `__debugtype`. This is only used for display in the DAP client.
8
+
9
+ By default, the metatable will be listed as a virtual member `<metatable>`.The displayed contents of the table can be overridden with `__debugcontents` which can be `false` to omit contents entirely, or a function `__debugcontents(self,extra?)->__debugnext,t,k` which returns an iterator `__debugnext(t,k)->nextk,nextv,renderOpts?`. You may use the functions in `__debugadapter__/iterutil.lua` to assist in creating these iterators.
10
+
11
+ ```lua
12
+ ---@class DebugAdapter.RenderOptions
13
+ ---@field rawName? boolean
14
+ ---@field rawValue? boolean
15
+ ---@field virtual? boolean
16
+ ---@field ref? table|function @ Object to expand children of instead of this value
17
+ ---@field fetchable? boolean @ if ref or value is function, treat as fetchable property instead of raw function
18
+ ---@field extra? any @ Extra object to pass back to `__debugcontents`
19
+ ```
20
+
21
+ If using [hediet.debug-visualizer](https://marketplace.visualstudio.com/items?itemName=hediet.debug-visualizer), you can configure it to use `"context": "visualize"` to get json output on its eval requests. You must provide your own object conversions to produce objects compatible with the visualizer interface types. If the eval result has a `__debugvisualize(self)` metamethod, it will be called automatically before being converted to json.
@@ -0,0 +1,35 @@
1
+ # Setting up your workspace for Modding
2
+
3
+ A lot of people ask how to set up a workspace when they first start modding, so I thought I'd write down some of the repeated answers I give. This isn't the only way to do things, but this is how I do it, and I find it works pretty well.
4
+
5
+ ## Workspace Layout
6
+
7
+ I open the Factorio `mods` directory as the root of my workspace in VSCode, and check out each mod's git repo directory into that. This simplifies debugger config as it is able to detect `mod-list.json` in the workspace and automatically configure all unspecified `modsPath`s in `launch.json`.
8
+
9
+ * `mods/`
10
+ * `.vscode/`
11
+ * `launch.json`
12
+ * `settings.json`
13
+ * `modname/`
14
+ * `.git/...`
15
+ * `info.json`
16
+ * `control.lua`
17
+ * `data.lua`
18
+ * ...
19
+ * `anothermod/`
20
+ * ...
21
+
22
+
23
+ ## Editor & Extensions
24
+
25
+ I use [VScode](https://code.visualstudio.com/) (imagine that!), but it needs a few extensions to really shine in this context:
26
+
27
+ * [Factorio Mod Debugger](https://marketplace.visualstudio.com/items?itemName=justarandomgeek.factoriomod-debug) - You are here
28
+ * A Lua language server. I like to use [sumneko.lua](https://marketplace.visualstudio.com/items?itemName=sumneko.lua), and the Factorio Mod Debugger has some extended support for it.
29
+ * Optional: [Zip File Explorer](https://marketplace.visualstudio.com/items?itemName=slevesque.vscode-zipexplorer). Enables viewing files inside zips, which allows breakpoints/stepping inside them as well.
30
+ * Optional: [indent-rainbow](https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow)
31
+ * Optional: [Git Graph](https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph). I happen to like the graph git log view this extension gives as a place to do manual git operations more complicated than the builtin SCM view provides for.
32
+
33
+ To provide Factorio Lua API autocompletion, the Factorio mod debugger extension generates EmmyLua docs from the Factorio JSON docs, which are then used by the [sumneko.lua](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) language server for its autocompletion feature. Click the Factorio version selection in the status bar to get started!
34
+
35
+ Don't forget to read [the readme](../readme.md) for information about using the Factorio Mod Debugger itself.
@@ -0,0 +1,30 @@
1
+ <?xml version='1.0' encoding='ascii'?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" height="141" version="1.1" width="128">
3
+ <g id="View Layer_LineSet" inkscape:groupmode="lineset" inkscape:label="View Layer_LineSet" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
4
+ <g id="strokes" inkscape:groupmode="layer" inkscape:label="strokes" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
5
+ <path d=" M 24.226, 47.492 14.885, 51.063 11.282, 52.439 21.179, 53.871 31.076, 55.303 33.793, 55.696 33.912, 55.713 43.809, 57.145 47.797, 57.722 51.795, 58.300 54.414, 58.679 64.311, 60.111 74.208, 61.542 77.135, 61.966 86.476, 58.396 95.989, 54.760 96.329, 54.630 105.670, 51.059 115.011, 47.489 117.649, 46.481 107.752, 45.049 105.712, 44.754 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
6
+ <path d=" M 11.282, 89.730 11.282, 99.730 11.282, 109.730 11.282, 119.730 11.282, 127.589 21.179, 129.020 31.076, 130.452 40.973, 131.884 50.870, 133.316 60.767, 134.747 70.664, 136.179 77.135, 137.115 86.476, 133.545 95.817, 129.975 105.158, 126.404 114.499, 122.834 117.649, 121.630 117.649, 111.630 117.649, 101.630 117.649, 91.630 117.649, 85.107 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
7
+ <path d=" M 77.135, 61.966 77.135, 71.966 77.135, 73.642 77.135, 75.518 77.135, 85.518 77.135, 95.518 77.135, 105.518 77.135, 115.518 77.135, 125.518 77.135, 135.518 77.135, 137.115 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
8
+ <path d=" M 117.649, 46.481 119.443, 56.319 121.237, 66.156 123.031, 75.994 124.234, 82.590 117.649, 85.107 108.308, 88.677 98.967, 92.247 89.626, 95.817 83.721, 98.074 81.927, 88.237 80.132, 78.399 79.402, 74.393 79.322, 73.958 79.281, 73.730 77.487, 63.892 77.135, 61.966 76.038, 71.905 75.867, 73.458 75.669, 75.251 75.588, 75.982 74.491, 85.921 73.394, 95.861 73.084, 98.670 63.187, 97.239 53.290, 95.807 51.795, 95.591 41.898, 94.159 32.001, 92.727 22.104, 91.296 12.207, 89.864 11.282, 89.730 7.231, 89.144 7.631, 85.521 8.728, 75.582 9.825, 65.642 10.922, 55.703 11.282, 52.439 9.392, 62.259 7.501, 72.079 5.610, 81.898 4.697, 86.643 7.631, 85.521 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
9
+ <path d=" M 51.504, 47.045 51.795, 48.012 52.233, 49.462 53.483, 51.808 53.604, 51.955 55.169, 53.866 57.226, 55.556 59.575, 56.813 62.126, 57.589 64.780, 57.854 67.435, 57.599 69.990, 56.832 72.346, 55.584 74.413, 53.902 76.111, 51.851 77.376, 49.510 78.158, 46.968 78.427, 44.324 78.226, 42.231 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
10
+ <path d=" M 96.329, 54.630 97.303, 51.462 105.288, 50.923 105.733, 45.055 105.712, 44.754 105.323, 39.185 105.232, 38.505 97.250, 37.936 95.387, 31.757 92.610, 26.547 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
11
+ <path d=" M 78.249, 47.647 77.467, 50.189 76.203, 52.530 74.504, 54.582 72.438, 56.264 70.081, 57.512 67.526, 58.278 64.871, 58.534 62.217, 58.268 59.667, 57.492 57.318, 56.235 55.261, 54.545 53.684, 52.621 53.574, 52.488 52.324, 50.142 51.795, 48.388 51.557, 47.597 51.504, 47.045 51.303, 44.952 51.573, 42.308 51.795, 41.583 52.196, 40.280 52.354, 39.766 53.619, 37.425 53.771, 37.240 55.317, 35.374 57.384, 33.692 59.740, 32.443 62.295, 31.677 64.951, 31.421 67.604, 31.687 70.155, 32.463 72.504, 33.720 74.561, 35.410 76.247, 37.467 77.498, 39.813 77.768, 40.712 78.226, 42.231 78.264, 42.358 78.518, 45.003 78.249, 47.647 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
12
+ <path d=" M 105.323, 39.185 97.341, 38.616 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
13
+ <path d=" M 97.250, 37.936 97.341, 38.616 95.479, 32.436 92.442, 26.739 92.610, 26.547 97.711, 20.733 97.620, 20.054 93.770, 15.595 89.313, 11.738 83.260, 16.959 77.555, 13.906 71.408, 12.035 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
14
+ <path d=" M 97.711, 20.733 93.861, 16.275 89.404, 12.417 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
15
+ <path d=" M 89.313, 11.738 89.404, 12.417 83.351, 17.638 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
16
+ <path d=" M 83.260, 16.959 83.351, 17.638 77.646, 14.585 71.453, 12.700 71.408, 12.035 70.920, 4.745 70.829, 4.066 64.939, 3.629 59.046, 4.044 58.467, 11.996 52.262, 13.858 46.540, 16.889 40.517, 11.646 36.038, 15.486 32.161, 19.930 32.253, 20.610 37.205, 26.310 37.487, 26.635 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
17
+ <path d=" M 70.920, 4.745 65.030, 4.309 59.138, 4.723 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
18
+ <path d=" M 59.046, 4.044 59.138, 4.723 58.559, 12.675 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
19
+ <path d=" M 58.467, 11.996 58.559, 12.675 52.354, 14.537 46.631, 17.569 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
20
+ <path d=" M 46.540, 16.889 46.631, 17.569 40.609, 12.325 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
21
+ <path d=" M 40.517, 11.646 40.609, 12.325 36.130, 16.166 32.253, 20.610 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
22
+ <path d=" M 37.205, 26.310 34.325, 31.642 32.427, 37.814 24.442, 38.353 23.997, 44.221 24.226, 47.492 24.407, 50.091 24.499, 50.770 32.480, 51.339 33.793, 55.696 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
23
+ <path d=" M 37.487, 26.635 34.417, 32.321 32.518, 38.493 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
24
+ <path d=" M 32.427, 37.814 32.518, 38.493 24.533, 39.032 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
25
+ <path d=" M 24.442, 38.353 24.533, 39.032 24.088, 44.900 24.268, 47.476 24.499, 50.770 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
26
+ <path d=" M 51.795, 41.583 51.795, 48.012 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
27
+ <path d=" M 77.768, 40.712 67.871, 39.280 57.974, 37.848 53.771, 37.240 " fill="none" stroke="rgb(0, 0, 0)" stroke-linecap="butt" stroke-linejoin="round" stroke-opacity="1.0" stroke-width="6.0" />
28
+ </g>
29
+ </g>
30
+ </svg>
@@ -0,0 +1,28 @@
1
+ {
2
+ "Version Block": {
3
+ "prefix": ["versionblock"],
4
+ "body": [
5
+ "---------------------------------------------------------------------------------------------------",
6
+ "Version: ${1:${TM_DIRECTORY/^.+_(\\d+\\.\\d+\\.\\d+)$/${1:0.0.0}/}}",
7
+ "Date: ${2:????}",
8
+ " ${3:Changes}:",
9
+ " - $0"
10
+ ],
11
+ "description": "A new version block"
12
+ },
13
+ "Version": {
14
+ "prefix": ["version"],
15
+ "body": ["Version: ${1:${TM_DIRECTORY/^.+_(\\d+\\.\\d+\\.\\d+)$/${1:0.0.0}/}}"],
16
+ "description": "Version line with auto-detected version"
17
+ },
18
+ "Date": {
19
+ "prefix": ["date"],
20
+ "body": ["Date: ${1:$CURRENT_YEAR}-${2:$CURRENT_MONTH}-${3:$CURRENT_DATE}"],
21
+ "description": "Date line"
22
+ },
23
+ "Unspecified Date": {
24
+ "prefix": ["undate"],
25
+ "body": ["Date: ${1:????}"],
26
+ "description": "Date line with unspecified date"
27
+ }
28
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "comments": {
3
+ },
4
+ // symbols used as brackets
5
+ "brackets": [
6
+ ],
7
+ // symbols that are auto closed when typing
8
+ "autoClosingPairs": [
9
+ ],
10
+ // symbols that that can be used to surround a selection
11
+ "surroundingPairs": [
12
+ ]
13
+ }
@@ -0,0 +1,77 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3
+ "name": "Factorio Changelog",
4
+ "patterns": [
5
+ {
6
+ "name": "keyword.control.factorio-changelog",
7
+ "match": "^-{99}$"
8
+ },
9
+ {
10
+ "name": "invalid.keyword.control.factorio-changelog",
11
+ "match": "^-{1,98}$"
12
+ },
13
+ {
14
+ "name": "invalid.keyword.control.factorio-changelog",
15
+ "match": "^-{100,}$"
16
+ },
17
+ {
18
+ "name": "variable.language.version.factorio-changelog",
19
+ "match": "^Version: ((?:\\d+)\\.(?:\\d+)(?:\\.(?:\\d+))?)(.*)$",
20
+ "captures": {
21
+ "1": {
22
+ "name": "constant.numeric.version.factorio-changelog"
23
+ },
24
+ "2": {
25
+ "name": "comment.line.version.extra.factorio-changelog"
26
+ }
27
+
28
+ }
29
+ },
30
+ {
31
+ "name": "variable.language.date.factorio-changelog",
32
+ "match": "^Date: (.+)$",
33
+ "captures": {
34
+ "1": {
35
+ "name": "string.unquoted.date.factorio-changelog"
36
+ }
37
+ }
38
+ },
39
+ {
40
+ "match": "^ (((Major|Minor) )?Features|Graphics|Sounds|Optimi[sz]ations|(Combat )?Balancing|Circuit Network|Changes|Bugfixes|Modding|Scripting|Gui|Control|Translation|Debug|Ease of use|Info|Locale|Other):$",
41
+ "captures": {
42
+ "1": {
43
+ "name": "entity.name.class.factorio-changelog"
44
+ }
45
+ }
46
+ },
47
+ {
48
+ "match": "^ ([^ ].+):$",
49
+ "captures": {
50
+ "1": {
51
+ "name": "entity.name.function.factorio-changelog"
52
+ }
53
+ }
54
+ },
55
+ {
56
+ "match": "^ - (.+)$",
57
+ "captures": {
58
+ "1": {
59
+ "name": "string.unquoted.change.factorio-changelog"
60
+ }
61
+ }
62
+ },
63
+ {
64
+ "match": "^ (.+)$",
65
+ "captures": {
66
+ "1": {
67
+ "name": "string.unquoted.change.continue.factorio-changelog"
68
+ }
69
+ }
70
+ },
71
+ {
72
+ "name": "invalid.unknown.factorio-changelog",
73
+ "match": "^.*$"
74
+ }
75
+ ],
76
+ "scopeName": "source.factorio-changelog"
77
+ }
@@ -0,0 +1,131 @@
1
+ {
2
+ "color": {
3
+ "prefix": ["color"],
4
+ "body": "[color=${1:red}]$0[/color]"
5
+ },
6
+ "font": {
7
+ "prefix": ["font"],
8
+ "body": "[font=${1:default-bold}]$0[/font]"
9
+ },
10
+
11
+ "img": {
12
+ "prefix": ["img"],
13
+ "body": "[img=${1:item/iron-plate}]"
14
+ },
15
+ "item": {
16
+ "prefix": ["item"],
17
+ "body": "[item=${1:iron-plate}]"
18
+ },
19
+ "item-group": {
20
+ "prefix": ["item-group"],
21
+ "body": "[item-group=${1:combat}]"
22
+ },
23
+ "special-item": {
24
+ "prefix": ["special-item"],
25
+ "body": "[special-item=${1|blueprint_string,__1__|}]"
26
+ },
27
+ "entity": {
28
+ "prefix": ["entity"],
29
+ "body": "[entity=${1:iron-chest}]"
30
+ },
31
+ "technology": {
32
+ "prefix": ["technology"],
33
+ "body": "[technology=${1:logistics}]"
34
+ },
35
+ "recipe": {
36
+ "prefix": ["recipe"],
37
+ "body": "[recipe=${1:basic-oil-processing}]"
38
+ },
39
+ "fluid": {
40
+ "prefix": ["fluid"],
41
+ "body": "[fluid=${1:water}]"
42
+ },
43
+ "tile": {
44
+ "prefix": ["tile"],
45
+ "body": "[tile=${1:grass-1}]"
46
+ },
47
+ "virtual-signal": {
48
+ "prefix": ["virtual-signal"],
49
+ "body": "[virtual-signal=${1:signal-A}]"
50
+ },
51
+ "achievement": {
52
+ "prefix": ["achievement"],
53
+ "body": "[achievement=${1:minions}]"
54
+ },
55
+ "gps": {
56
+ "prefix": ["gps"],
57
+ "body": "[gps=${1:0,0}]"
58
+ },
59
+ "armor": {
60
+ "prefix": ["armor"],
61
+ "body": "[armor=${1|player,__1__|}]"
62
+ },
63
+ "train": {
64
+ "prefix": ["train"],
65
+ "body": "[train=${1|42,__1__|}]"
66
+ },
67
+ "train-stop": {
68
+ "prefix": ["train-stop"],
69
+ "body": "[train-stop=${1:|42,__1__|}]"
70
+ },
71
+
72
+ "param": {
73
+ "prefix": ["__1__"],
74
+ "body": "__${1:1}__"
75
+ },
76
+
77
+ "plural_for_param": {
78
+ "prefix": ["plural","__plural_for_parameter"],
79
+ "body": "__plural_for_parameter_${1:1}_{$0}__"
80
+ },
81
+
82
+ "rest": {
83
+ "prefix": ["rest"],
84
+ "body": "rest=$0|"
85
+ },
86
+ "ends in": {
87
+ "prefix": ["ends in"],
88
+ "body": "ends in ${1:1}=$0|"
89
+ },
90
+
91
+ "CONTROL": {
92
+ "prefix": ["__CONTROL__", "CONTROL"],
93
+ "body": "__CONTROL__${1:build}__"
94
+ },
95
+ "CONTROL_MODIFIER": {
96
+ "prefix": ["__CONTROL_MODIFIER__", "CONTROL_MODIFIER"],
97
+ "body": "__CONTROL_MODIFIER__${1:build}__"
98
+ },
99
+ "CONTROL_MOVE": {
100
+ "prefix": ["__CONTROL_MOVE__", "CONTROL_MOVE"],
101
+ "body": "__CONTROL_MOVE__"
102
+ },
103
+ "ENTITY": {
104
+ "prefix": ["__ENTITY__", "ENTITY"],
105
+ "body": "__ENTITY__${1:iron-chest}__"
106
+ },
107
+ "ITEM": {
108
+ "prefix": ["__ITEM__", "ITEM"],
109
+ "body": "__ITEM__${1:iron-plate}__"
110
+ },
111
+ "TILE": {
112
+ "prefix": ["__TILE__", "TILE"],
113
+ "body": "__TILE__${1:grass-1}__"
114
+ },
115
+ "FLUID": {
116
+ "prefix": ["__FLUID__", "FLUID"],
117
+ "body": "__FLUID__${1:water}__"
118
+ },
119
+ "ALT_CONTROL": {
120
+ "prefix": ["__ALT_CONTROL__", "ALT_CONTROL"],
121
+ "body": "__ALT_CONTROL__${1:1}__${2:build}__"
122
+ },
123
+ "CONTROL_STYLE": {
124
+ "prefix": ["__CONTROL_STYLE__", "CONTROL_STYLE"],
125
+ "body": "__CONTROL_STYLE_${1|BEGIN,END|}__"
126
+ },
127
+ "REMARK_COLOR": {
128
+ "prefix": ["__REMARK_COLOR__", "REMARK_COLOR"],
129
+ "body": "__REMARK_COLOR_${1|BEGIN,END|}__"
130
+ }
131
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "comments": {
3
+ "lineComment": "#"
4
+ },
5
+ // symbols used as brackets
6
+ "brackets": [],
7
+ // symbols that are auto closed when typing
8
+ "autoClosingPairs": [
9
+ { "open": "[", "close": "]", "notIn": ["string"] }
10
+ ],
11
+ // symbols that that can be used to surround a selection
12
+ "surroundingPairs": [
13
+ ["[", "]"]
14
+ ]
15
+ }