Get Extension Log on VS Code/VSCodium

Extension log can be helpful for troubleshooting if the extension is not behaving as expected. To get the extension log:

  1. Open the Command Palette (default keybind is Ctrl+Shift+P on Linux/Windows, Cmd+Shift+P on macOS).

  2. Type or paste in workbench.action.showOutputChannels and press Enter.

  3. Type or paste in Spyglass Language Server and press Enter.

  4. The log output panel should now be open. You can select all and copy the log to share it with others.

The log may contain file paths that include your username or other personal information. If you prefer not to share this information, please review the log and redact any sensitive details before sharing it with others.

Reset Extension Cache on VS Code/VSCodium

The extension uses cache to accelerate various operations. Occasionally the cache may get outdated or corrupted and cause issues. To do a quick cache reset:

  1. Open the Command Palette (default keybind is Ctrl+Shift+P on Linux/Windows, Cmd+Shift+P on macOS).

  2. Type or paste in spyglassmc.resetProjectCache and press Enter.

  3. Restart the editor.

If that did not work, you may also try a full cache reset:

  1. Open the Command Palette (default keybind is Ctrl+Shift+P on Linux/Windows, Cmd+Shift+P on macOS).

  2. Type or paste in spyglassmc.showCacheRoot and press Enter.

  3. The extension’s cache folder should now be shown in your OS’s file explorer. You may see folders named downloader, http, symbols, and/or virtual-uris in it. The default location of the cache folder is:

    • Linux: $XDG_CACHE_HOME/spyglassmc-nodejs or ~/.cache/spyglassmc-nodejs

    • macOS: ~/Library/Caches/spyglassmc-nodejs

    • Windows: %LOCALAPPDATA%\spyglassmc-nodejs\Cache (e.g. C:\Users\<USER>\AppData\Local\spyglassmc-nodejs\Cache)

  4. Close the editor.

    • This step is important as otherwise the extension may write bad data from memory to disk right after you’ve deleted them.

  5. Delete all contents inside the cache folder.

  6. Restart the editor.

Support Modded Commands

  1. Create a spyglass.json config file in the root of your workspace.

    {
      "env": {
        "mcmetaSummaryOverrides": {
          "commands": {
            "path": "./commands.json",
            "replace": false
          }
        }
      }
    }
  2. Create a commands.json file to define the structure of the custom commands. You can either generate this file with a mod like Command Extractor, or write the file manually. Here is the vanilla command tree for reference.

  3. Spyglass should be smart enough to ignore any modded arguments it cannot understand. You may create an issue if you’d like certain modded arguments to be supported.