### Example Configuration Source: https://github.com/spacemaniac/spacemandmm/blob/master/CONFIGURING.md Illustrates common configuration settings for display, language server, and diagnostics. ```toml [display] error_level = "hint" [langserver] dreamchecker = true [diagnostics] duplicate_include = "error" macro_redefined = "off" ``` -------------------------------- ### GitHub Actions CI Integration Example Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Example YAML configuration for a GitHub Actions workflow that runs DreamChecker and dmdoc. This demonstrates CI integration for the project. ```yaml ... ``` -------------------------------- ### SpacemanDMM.toml Configuration for Diagnostics Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Example TOML configuration for SpacemanDMM, showing how to set diagnostic severities for parser, preprocessor, and DreamChecker rules. Supports overriding or disabling diagnostics. ```toml [display] # Minimum severity to display (error/warning/info/hint) error_level = "hint" [langserver] # Run DreamChecker diagnostics inside the language server dreamchecker = true [diagnostics] # Preprocessor duplicate_include = "error" macro_redefined = "off" macro_undefined_no_definition = "warning" # Parser var_in_proc_parameter = "warning" semicolon_in_proc_parameter = "info" integer_precision_loss = "warning" # DreamChecker must_call_parent = "error" must_not_override = "error" must_not_sleep = "error" must_be_pure = "warning" private_proc = "error" protected_proc = "error" private_var = "error" protected_var = "error" final_var = "error" override_missing_keyword_arg = "warning" proc_call_static_type = "warning" field_access_static_type = "warning" unreachable_code = "hint" ambiguous_not_bitwise = "warning" ambiguous_in_lhs = "warning" no_typehint_implicit_new = "info" control_condition_static = "hint" if_condition_determinate = "hint" loop_condition_determinate = "hint" improper_index = "warning" [code_standards] # Opinionated style checks (disabled by default) disallow_relative_proc_definitions = "warning" disallow_relative_type_definitions = "warning" [dmdoc] # Use the true typepath name instead of the 'name' var for types use_typepath_names = true ``` -------------------------------- ### List and Switch Statement Requirements Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Details requirements for `for-list` and `for-in-list` statements, which must start with a variable, and `switch` case statements, which cannot be empty. ```dm for-list must start with variable ``` ```dm for-in-list must start with variable ``` ```dm switch case cannot be empty ``` -------------------------------- ### Get Map Metadata with dmm-tools map-info Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Reports size, key length, and dictionary entry count for .dmm files. Outputs in JSON format, suitable for programmatic access. ```sh # JSON output (only supported format) dmm-tools map-info --json \ _maps/map_files/MetaStation/MetaStation.dmm \ _maps/map_files/BoxStation/BoxStation.dmm # Example JSON output: # { # "_maps/map_files/MetaStation/MetaStation.dmm": { # "size": [255, 255, 5], # "key_length": 3, # "num_keys": 4096 # } # } ``` -------------------------------- ### Upload Documentation with rsync Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Use rsync to upload generated documentation to a web server. Ensure the target directory is correctly specified. ```shell rsync -r dmdoc/ user@host:/var/www/codedocs/ ``` -------------------------------- ### Initialize Extools Debugger Source: https://github.com/spacemaniac/spacemandmm/wiki/Setting-up-Debugging Add this proc and call it at the top of `/world/New()` to enable debugging with Extools. This method is being phased out. ```dm /world/proc/enable_debugger() var/dll = world.GetConfig("env", "EXTOOLS_DLL") if (dll) call_ext(dll, "debug_initialize")() ``` -------------------------------- ### Initialize Debugging with Mode and Port Source: https://github.com/spacemaniac/spacemandmm/wiki/Setting-up-Debugging Sets default mode and port for debugging initialization. Use `EXTOOLS_MODE` and `EXTOOLS_PORT` environment variables or adjust `enable_debuger` to pass specific modes like BACKGROUND or BLOCK. ```dm var/mode = world.GetConfig("env", "EXTOOLS_MODE") || "NONE" var/port = world.GetConfig("env", "EXTOOLS_PORT") || "2448" call_ext(dll, "debug_initialize")(mode, port) ``` -------------------------------- ### Unnecessary 'var/' and 'static/' Prefixes Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Explains that `var/` is unnecessary in proc arguments and `static/` has no effect in proc arguments. ```dm 'var/' is unnecessary here You don't need to use `var/` in proc arguments ``` ```dm 'static/' has no effect here static does nothing in proc arguments ``` -------------------------------- ### Basic IntervalTree Operations in Rust Source: https://github.com/spacemaniac/spacemandmm/blob/master/crates/interval-tree/README.md Demonstrates fundamental operations such as creation, insertion, checking emptiness, retrieving the minimum element, and deletion. Ensure the 'interval-tree' crate is added as a dependency. ```rust extern crate interval_tree; extern crate rand; extern crate time; use interval_tree::{IntervalTree, range}; fn main(){ let data = 4221; let mut t = IntervalTree::::new(); assert!(t.empty()); assert!(t.min().is_none()); t.insert(range(1,1), data); t.insert(range(2,2), data+1); t.insert(range(3,3), data+2); assert_eq!(t.min().expect("get min"),(&range(1,1),&data)); assert!(!t.empty()); assert!(t.get_or(range(1,1), &0) == &data); assert!(!t.contains(range(0,0))); t.delete(range(1,1)); assert!(!t.contains(range(1,1))); for (i,pair) in t.iter().enumerate() { //[...] } for (i,pair) in t.range(34, 36).enumerate() { //[...] } } ``` -------------------------------- ### Keyword Argument Usage in Procs Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Shows how to correctly use keyword arguments in proc calls. Errors occur when a keyword argument does not exist or is defined on an override but not where it's used. ```dm /proc/foo(one, two) [...] foo(three=3) ``` ```dm /mob/proc/foo(one, two) /mob/proc/test() foo(three=3) /mob/living/foo(one, two, three) ``` -------------------------------- ### Infinite Loop for Non-SS13 Codebases Source: https://github.com/spacemaniac/spacemandmm/wiki/Setting-up-Debugging If your project lacks a main game loop, add this to `/world/New()` to keep the project running for debugging purposes. ```dm /world/New() var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL") if (debug_server) call_ext(debug_server, "auxtools_init")() enable_debugging() . = ..() while(1) sleep(5) ``` -------------------------------- ### Initialize Auxtools Debugging Source: https://github.com/spacemaniac/spacemandmm/wiki/Setting-up-Debugging Add these procs to a new file to enable Auxtools debugging. The debugger hooks activate automatically when the project is run with F5. ```dm /proc/auxtools_stack_trace(msg) CRASH(msg) /proc/auxtools_expr_stub() CRASH("auxtools not loaded") /proc/enable_debugging(mode, port) CRASH("auxtools not loaded") /world/New() var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL") if (debug_server) call_ext(debug_server, "auxtools_init")() enable_debugging() . = ..() /world/Del() var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL") if (debug_server) call_ext(debug_server, "auxtools_shutdown")() . = ..() ``` -------------------------------- ### Build SpacemanDMM Suite Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Builds the entire SpacemanDMM suite or individual tools using Cargo. Use '--release' for optimized builds. ```sh # Build the entire suite in release mode cargo build --release # Build a single tool cargo build --release -p dmm-tools-cli cargo build --release -p dreamchecker cargo build --release -p dmdoc # List available binaries cargo build --release --bin ``` -------------------------------- ### CI Workflow for SpacemanDMM Source: https://context7.com/spacemaniac/spacemandmm/llms.txt This GitHub Actions workflow automates static analysis, documentation generation, and deployment for DreamMaker projects using SpacemanDMM. ```yaml name: CI on: [push, pull_request] jobs: static-analysis: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install Rust uses: actions-rs/toolchain@v1 with: toolchain: stable - name: Build DreamChecker run: cargo build --release -p dreamchecker - name: Run DreamChecker working-directory: path/to/dm-project run: ../../target/release/dreamchecker docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Build dmdoc run: cargo build --release -p dmdoc - name: Generate docs working-directory: path/to/dm-project run: ../../target/release/dmdoc - name: Deploy docs uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: path/to/dm-project/dmdoc ``` -------------------------------- ### Build SpacemanDMM Release Source: https://github.com/spacemaniac/spacemandmm/blob/master/README.md Build the full SpacemanDMM suite by running `cargo build --release` in the project's root directory. Individual binaries can be built using `cargo build --release --bin `. ```shell cargo build --release ``` ```shell cargo build --release --bin ``` -------------------------------- ### Build dm-langserver Binary Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Command to build the dm-langserver binary in release mode. This binary implements the Language Server Protocol for DreamMaker. ```shell # Build the language server binary cargo build --release -p dm-langserver ``` -------------------------------- ### Run DreamChecker Static Analysis Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Execute `dreamchecker` from your DM project directory for static analysis. It auto-detects the `.dme` file and exits with a non-zero status on errors, suitable for CI. ```bash cd path/to/tgstation/ dreamchecker ``` ```bash dreamchecker -c path/to/SpacemanDMM.toml ``` ```bash cd path/to/tgstation/ dreamchecker && echo "Static analysis passed" || exit 1 ``` -------------------------------- ### Generate Minimap with dmm-tools Source: https://github.com/spacemaniac/spacemandmm/blob/master/crates/dmm-tools-cli/README.md Run this command from the directory containing your .dme file to generate a minimap. Output is saved to `data/minimaps/` by default, but can be changed with the `-o` flag. Use the `-e` flag to load a different .dme file. ```sh cd path/to/tgstation/ dmm-tools minimap _maps/map_files/BoxStation/BoxStation.dme ``` -------------------------------- ### List Available Render Passes Source: https://github.com/spacemaniac/spacemandmm/blob/master/crates/dmm-tools-cli/README.md Lists all available render passes that can be used with dmm-tools. This command helps in understanding the customization options for map rendering. ```sh dmm-tools list-passes ``` -------------------------------- ### Generate Documentation with dmdoc Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Use `dmdoc` to generate static HTML documentation from DreamMaker source code comments. Run from the DM project directory; output is written to the `dmdoc/` folder. ```bash cd path/to/tgstation/ dmdoc ``` -------------------------------- ### Render Maps with Custom Chunks using dmm-tools Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Pipe a JSON configuration to `dmm-tools render-many` to render maps with specified chunks. The output directory and file paths are configurable. ```json { "output_directory": "/tmp/rendered/", "files": [ { "path": "_maps/map_files/MetaStation/MetaStation.dmm", "chunks": [ {"z": 1, "min_x": 1, "min_y": 1, "max_x": 128, "max_y": 128}, {"z": 1, "min_x": 129, "min_y": 1, "max_x": 255, "max_y": 255} ] }, { "path": "_maps/map_files/BoxStation/BoxStation.dmm" } ], "enable": [], "disable": ["random"] } ``` ```bash echo '{ ... }' | dmm-tools render-many ``` -------------------------------- ### Render .dmm Map Files with dmm-tools minimap Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Generates PNG images from .dmm map files. Auto-detects .dme environment files. Supports custom output directories, parallel rendering, spatial sub-region rendering, disabling/enabling render passes, and post-processing with pngcrush or optipng. ```sh # Render a single map (auto-detects tgstation.dme in cwd) cd path/to/tgstation/ dmm-tools minimap _maps/map_files/MetaStation/MetaStation.dmm # Render to a custom output directory dmm-tools minimap -o /tmp/rendered/ _maps/map_files/BoxStation/BoxStation.dmm # Render multiple maps in parallel (4 threads) dmm-tools --jobs 4 minimap \ _maps/map_files/MetaStation/MetaStation.dmm \ _maps/map_files/BoxStation/BoxStation.dmm # Render only a spatial sub-region (x,y or x,y,z; 1-indexed inclusive) dmm-tools minimap --min 10,10 --max 100,100 \ _maps/map_files/BoxStation/BoxStation.dmm # Disable random-generation pass and show space tiles dmm-tools minimap --disable hide-space,random \ _maps/map_files/MetaStation/MetaStation.dmm # Disable all default passes, enable only area-hiding dmm-tools minimap --disable all --enable hide-areas \ _maps/map_files/MetaStation/MetaStation.dmm # Post-process through pngcrush automatically dmm-tools minimap --pngcrush \ _maps/map_files/BoxStation/BoxStation.dmm # Post-process through optipng automatically dmm-tools minimap --optipng \ _maps/map_files/BoxStation/BoxStation.dmm # Use an explicit .dme file dmm-tools -e path/to/custom.dme minimap map.dmm ``` -------------------------------- ### Missing Keyword Arguments in Overrides Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Highlights errors where an override of a proc is missing required keyword arguments. ```dm an override of __PROCNAME__ is missing keyword args / __NUM__ overrides of __PROCNAME__ are missing keyword args ``` -------------------------------- ### DM Documentation Comment Styles Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Demonstrates various ways to write documentation comments in DM, including single-line, block comments, and inline comments for variables. Supports Markdown headings and cross-linking. ```dm /// Single-line doc comment for the following item. #define BLUE rgb(0, 0, 255) /** Block doc comment for the following item. */ /obj/widget var/color = BLUE //! Enclosing comment — applies to 'color' /*! Block enclosing comment — applies to /obj/widget */ /obj/widget/proc/activate() /// This comment applies to the 'activate' proc. // ... // Set a custom title with a Markdown heading at the start of a doc block /** * # Widget * The base widget type used by all UI elements. */ /obj/widget // Cross-links to other documented items /** * See also [BLUE] and [/obj/widget/proc/activate]. * Custom text: [activation proc][/obj/widget/proc/activate] */ /obj/widget/var/label = "default" ``` -------------------------------- ### Enable Debugging Information Source: https://github.com/spacemaniac/spacemandmm/wiki/Setting-up-Debugging Ensure debugging information is enabled by adding `#define DEBUG` in your .dme file's preferences section. ```dm // BEGIN_PREFERENCES #define DEBUG // END_PREFERENCES ``` -------------------------------- ### Documenting Code with dmdoc Source: https://github.com/spacemaniac/spacemandmm/blob/master/crates/dmdoc/README.md Demonstrates the four different doc comment styles supported by dmdoc for block and line comments. These comments can target their enclosing item or the following item. ```dm /// This comment applies to the following macro. #define BLUE rgb(0, 255, 0) /** Block comments work too. */ /obj var/affinity = BLUE //! Enclosing comments follow their item. /proc/chemical_reaction() /*! Block comments work too. */ ``` -------------------------------- ### List Render Passes with dmm-tools list-passes Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Lists available render passes, their descriptions, and default status. Supports human-readable or JSON output for scripting. ```sh # Human-readable output dmm-tools list-passes # JSON output (suitable for scripting) dmm-tools list-passes --json # Example JSON output: # [ # {"name":"hide-space","desc":"Hides space tiles","default":true}, # {"name":"random","desc":"Randomizes random-variant icons","default":true}, # {"name":"hide-areas","desc":"Hides area overlays","default":true}, # ... # ] ``` -------------------------------- ### Configure Auxtools Debugger Engine Source: https://github.com/spacemaniac/spacemandmm/wiki/Setting-up-Debugging Add this TOML block to your project's configuration file to specify the debugger engine. ```toml [debugger] engine = "auxtools" ``` -------------------------------- ### Inconsistent Indentation in Procs Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Explains that indentation within a proc must be consistent and a multiple of the initial indentation. Stepping indentation by more than one multiple at a time is also an error. ```dm inconsistent indentation: {} % {} != 0 Your indentation needs to be a multiple of the first indent encountered, so if you first indent with 2 spaces all further indentation for that proc needs to be a multiple of 2, 5 spaces would result in this error ``` ```dm inconsistent multiple indentation: {} > 1 You also need to step your indentation one multiple at a time, you can't go from 2 space to 6 spaces. ``` -------------------------------- ### VS Code Debugging Commands for DM Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Common keyboard shortcuts for building and running DM projects with the debugger enabled in VS Code using the DM Language Client extension. ```shell # In VS Code with the DM Language Client extension: # F5 → build & run with debugger # Ctrl+F5 → run without debugger # Ctrl+Shift+B → build only # Enable debug symbols in your .dme (add after // BEGIN_PREFERENCES): # #define DEBUG ``` -------------------------------- ### Generate Minimap for DMM File Source: https://github.com/spacemaniac/spacemandmm/blob/master/README.md Use the `dmm-tools minimap` command to generate a minimap PNG from a .dmm map file. Output is saved to `data/minimaps/` by default, or can be specified with the `-o` flag. ```shell cd path/to/tgstation/ dmm-tools minimap _maps/map_files/MetaStation/MetaStation.dmm ``` -------------------------------- ### 'as' Clause on Local Variables Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Explains that the 'as' clause has no effect on local variables. ```dm 'as' clause has no effect on local variables ``` -------------------------------- ### Type Safety: Runtime vs. Compile-Time Access Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Illustrates the difference between runtime search operator ':' and compile-time search operator '.'. Dreamchecker warns when type information is missing for var/proc access. ```dm // 1 foo.field // this uses . // 2 proc/foo() return new /a/type [...] foo().field // this uses : // 3 var/list/foo = list(new /a/type) [...] foo[1].field // this uses : ``` ```dm // 2 proc/foo() set SpacemanDMM_return_type = /a/type // see dreamchecker readme for a macro // 3 var/list/a/type/foo = list(new /a/type) ``` -------------------------------- ### dm-langserver Workspace Symbol Search Prefixes Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Defines prefixes for searching symbols within the dm-langserver, allowing targeted searches for macros, variables, procedures, types, or all symbols. ```shell #foo → search macros only var/foo → search vars only proc/foo → search procs only /foo → search types only foo → search all symbols ``` -------------------------------- ### Compare .dmm Maps with dmm-tools diff-maps Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Compares two .dmm map files and reports differences in size and tile coordinates. Useful for tracking changes between map versions. ```sh # Diff two versions of the same map dmm-tools diff-maps \ _maps/map_files/MetaStation/MetaStation.dmm \ _maps/map_files/MetaStation/MetaStation.dmm.bak # Example output: # different size: (255, 255, 5) (255, 255, 4) # different tile: (14, 32, 2) # different tile: (15, 32, 2) ``` -------------------------------- ### Auxtools Debugger Configuration in SpacemanDMM.toml Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Specifies the debugger engine to use in SpacemanDMM.toml for enabling the DreamMaker debugger via auxtools. ```toml # SpacemanDMM.toml — in the same folder as your .dme [debugger] engine = "auxtools" ``` -------------------------------- ### Operator Overloading for ++/-- Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Explains that using ++/-- on a var of a type that doesn't overload these operators can lead to bugs. Typehinting lists incorrectly can also trigger this. ```dm proc/a/type/operator++() return 1 ``` -------------------------------- ### Positional Arguments After Keyword Arguments Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Illustrates that positional arguments cannot follow keyword arguments in a proc call, even though it might compile, it will cause a runtime error. ```dm proc called with non-kwargs after kwargs: __PROCNAME__() You can't use positional arguments after keyword arguments, `foo(three=3, 2)`. This will compile but will runtime. ``` -------------------------------- ### Enable/Disable Render Passes Source: https://github.com/spacemaniac/spacemandmm/blob/master/crates/dmm-tools-cli/README.md Customize map rendering by enabling or disabling specific render passes. Use comma-separated lists for `--enable` or `--disable`. To disable all default passes, use `--disable all`. ```sh --disable hide-space,random ``` ```sh --disable all --enable hide-areas ``` -------------------------------- ### Filter Parameter Validation Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Demonstrates correct usage of filter parameters, highlighting that some parameters cannot accept multiple flags or unary operations. ```dm filter(type="{}") '{}' parameter must have one value, found bitwise OR ``` ```dm filter() flag fields cannot have unary ops ``` ```dm filter(type="{}") called with invalid '{}' flag '{}' ``` ```dm filter(type="{}") called with invalid '{}' value '{:?}' ``` ```dm filter(type="{}"), extremely invalid value passed to '{}' ``` ```dm filter() called without mandatory keyword parameter 'type' ``` ```dm filter() called with non-string type keyword parameter value '{:?}' ``` ```dm filter() called with invalid type keyword parameter value '{}' ``` ```dm filter(type="{}") called with invalid keyword parameter '{}' ``` -------------------------------- ### Valid Crosslink Forms in DM Documentation Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Illustrates the correct syntax for creating cross-links within DM documentation comments and Markdown files to other code elements. ```dm [DEFINE_NAME] [/path/to/object] [/path/to/object/proc/foo] [/path/to/object/var/bar] [custom text][/path/to/object] ``` -------------------------------- ### DreamChecker Language Extensions (DM Code) Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Utilize opt-in directives for return types, access control, and purity annotations with DreamChecker. Use the `SPACEMAN_DMM` guard for compatibility. ```dm #ifdef SPACEMAN_DMM #define RETURN_TYPE(X) set SpacemanDMM_return_type = X #define SHOULD_CALL_PARENT(X) set SpacemanDMM_should_call_parent = X #define SHOULD_NOT_OVERRIDE(X) set SpacemanDMM_should_not_override = X #define SHOULD_NOT_SLEEP(X) set SpacemanDMM_should_not_sleep = X #define SHOULD_BE_PURE(X) set SpacemanDMM_should_be_pure = X #define PRIVATE_PROC(X) set SpacemanDMM_private_proc = X #define PROTECTED_PROC(X) set SpacemanDMM_protected_proc = X #define CAN_BE_REDEFINED(X) set SpacemanDMM_can_be_redefined = X #define VAR_FINAL var/SpacemanDMM_final #define VAR_PRIVATE var/SpacemanDMM_private #define VAR_PROTECTED var/SpacemanDMM_protected #define UNLINT(X) SpacemanDMM_unlint(X) #else #define RETURN_TYPE(X) #define SHOULD_CALL_PARENT(X) #define SHOULD_NOT_OVERRIDE(X) #define SHOULD_NOT_SLEEP(X) #define SHOULD_BE_PURE(X) #define PRIVATE_PROC(X) #define PROTECTED_PROC(X) #define CAN_BE_REDEFINED(X) #define VAR_FINAL var #define VAR_PRIVATE var #define VAR_PROTECTED var #define UNLINT(X) X #endif // Return type annotation — DreamChecker knows get_mob() returns /mob /proc/get_mob() RETURN_TYPE(/mob) return locate(/mob) in world // Return type: the type of a parameter /proc/clone(datum/D) RETURN_TYPE(D.type) return new D.type() // Return type: strip one list level — returns element type of a /list/obj /proc/first_obj(list/obj/L) RETURN_TYPE(L[_].type) return L[1] // Require children to call parent /mob/proc/on_death() SHOULD_CALL_PARENT(TRUE) // base implementation /mob/living/on_death() // DreamChecker warns if ..() is absent ..() // subtype implementation // Prevent any type from overriding this proc /datum/proc/critical_init() SHOULD_NOT_OVERRIDE(TRUE) // Final variable — cannot be overridden by subtypes /atom VAR_FINAL/uid = generate_uid() // Private proc — only callable from exact same type /datum/proc/internal_helper() PRIVATE_PROC(TRUE) // ... // Protected proc — callable from same type or subtypes /datum/proc/subtype_hook() PROTECTED_PROC(TRUE) // ... // Private and protected variables /datum VAR_PRIVATE/secret_field = null VAR_PROTECTED/shared_state = null // No-sleep constraint — warns if any called proc blocks /datum/proc/tick() SHOULD_NOT_SLEEP(TRUE) // Any sleep() or input() call here is an error // Purity constraint — no side effects, return value must be used /proc/calculate_hash(value) SHOULD_BE_PURE(TRUE) return md5(value) // Allow a proc to be redefined (multiple /proc blocks for same path) /proc/extensible_hook() CAN_BE_REDEFINED(TRUE) // first definition // Suppress a specific lint warning inline var/untyped = UNLINT(some_untyped_expression()) ``` -------------------------------- ### Invalid 'var' Usage Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Covers errors where 'var' is not followed by a name, or where specific 'var' prefixes like `tmp`, `SpacemanDMM_final`, `SpacemanDMM_private`, or `SpacemanDMM_protected` have no effect in certain contexts. ```dm 'var' must be followed by a name ``` ```dm var/tmp has no effect here ``` ```dm var/SpacemanDMM_final has no effect here ``` ```dm var/SpacemanDMM_private has no effect here ``` ```dm var/SpacemanDMM_protected has no effect here ``` -------------------------------- ### Path and Type Definition Errors Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Covers errors related to path definitions, including unprefixed paths, paths with no effect, incorrect path separators, nested absolute paths, and relative path definitions. ```dm path started by '{}', should be unprefixed ``` ```dm path has no effect ``` ```dm path separated by '{}', should be '/' ``` ```dm nested absolute path: {} inside {} ``` ```dm relatively pathed type defined here ``` ```dm relatively pathed proc defined here ``` -------------------------------- ### dmdoc Crosslink Syntax Source: https://github.com/spacemaniac/spacemandmm/blob/master/crates/dmdoc/README.md Illustrates the syntax for creating crosslinks within dmdoc comments to reference other documented code elements. Custom link text can also be specified. ```dm [DEFINE_NAME] [/path_to_object] [/path_to_object/proc/foo] [/path_to_object/var/bar] You can also customize the link text that appears. This is by prepending the custom link text in brackets, such as: `[some define][DEFINE_NAME]`. ``` -------------------------------- ### Setting Manual Titles with dmdoc Source: https://github.com/spacemaniac/spacemandmm/blob/master/crates/dmdoc/README.md Shows how to set a manual title for a documentation entry using a '# Title' directive within a dmdoc block comment. This overrides the default title generation based on the type's name or typepath. ```dm /** * # Fubar */ /obj/foo ``` -------------------------------- ### Integer and Float Parsing Errors Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Details errors that can occur during the parsing of integer and float constants, including precision loss, invalid bases, and malformed numbers. ```dm precision loss of integer constant: "{}" to {} ``` ```dm bad base-{} integer "{}": {} ``` ```dm bad float "{}": {} ``` -------------------------------- ### Auxtools Debugging Stubs in DM Source: https://context7.com/spacemaniac/spacemandmm/llms.txt Defines stub procedures for auxtools debugging in DM. These should be added to your codebase to enable debugging features when the auxtools DLL is loaded. ```dm // Add to a new .dm file in your codebase /proc/auxtools_stack_trace(msg) CRASH(msg) /proc/auxtools_expr_stub() CRASH("auxtools not loaded") /proc/enable_debugging(mode, port) CRASH("auxtools not loaded") /world/New() var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL") if (debug_server) call_ext(debug_server, "auxtools_init")() enable_debugging() . = ..() /world/Del() var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL") if (debug_server) call_ext(debug_server, "auxtools_shutdown")() . = ..() ``` -------------------------------- ### Illegal Bytes and Unexpected Tokens Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Addresses errors related to illegal byte values (e.g., `0x$1`) and situations where the parser encounters unexpected characters or reaches the end of the file prematurely. ```dm illegal byte 0x{:x} if you write a character that can't be part of a token eg `0x$1` ``` ```dm got EOF, expected one of: {} ``` ```dm got '{}', expected one of: {} ``` -------------------------------- ### Unclosed Comments and String Literals Source: https://github.com/spacemaniac/spacemandmm/wiki/WhatErrorsMean Covers errors related to unclosed block comments (`/*`) and unterminated string, raw string, or raw string terminator literals. ```dm still skipping comments at end of file Reached the end of the file with an unclosed `/*`, check for a missing `*/` ``` ```dm unterminated string literal ``` ```dm unterminated raw string ``` ```dm unterminated raw string terminator ``` ```dm empty raw string terminator ``` -------------------------------- ### DreamMaker Preprocessor Directives for DreamChecker Extensions Source: https://github.com/spacemaniac/spacemandmm/blob/master/crates/dreamchecker/README.md Defines preprocessor macros to conditionally enable DreamChecker's custom typing features based on the SPACEMAN_DMM flag. This allows DreamMaker code to be compatible with both standard DreamMaker and DreamChecker. ```dm #ifdef SPACEMAN_DMM #define RETURN_TYPE(X) set SpacemanDMM_return_type = X #define SHOULD_CALL_PARENT(X) set SpacemanDMM_should_call_parent = X #define UNLINT(X) SpacemanDMM_unlint(X) #define SHOULD_NOT_OVERRIDE(X) set SpacemanDMM_should_not_override = X #define SHOULD_NOT_SLEEP(X) set SpacemanDMM_should_not_sleep = X #define SHOULD_BE_PURE(X) set SpacemanDMM_should_be_pure = X #define PRIVATE_PROC(X) set SpacemanDMM_private_proc = X #define PROTECTED_PROC(X) set SpacemanDMM_protected_proc = X #define CAN_BE_REDEFINED(X) set SpacemanDMM_can_be_redefined = X #define VAR_FINAL var/SpacemanDMM_final #define VAR_PRIVATE var/SpacemanDMM_private #define VAR_PROTECTED var/SpacemanDMM_protected #else #define RETURN_TYPE(X) #define SHOULD_CALL_PARENT(X) #define UNLINT(X) X #define SHOULD_NOT_OVERRIDE(X) #define SHOULD_NOT_SLEEP(X) #define SHOULD_BE_PURE(X) #define PRIVATE_PROC(X) #define PROTECTED_PROC(X) #define CAN_BE_REDEFINED(X) #define VAR_FINAL var #define VAR_PRIVATE var #define VAR_PROTECTED var #endif ``` -------------------------------- ### Declare Final Variable in DreamMaker Source: https://github.com/spacemaniac/spacemandmm/blob/master/crates/dreamchecker/README.md Demonstrates how to declare a variable as final using the VAR_FINAL macro provided by DreamChecker extensions. This prevents overriding the variable's value in inherited types. ```dm /a/type VAR_FINAL/foo = somevalue ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.