VS Code Setup: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
Ikzann (talk | contribs)
Created page with "This guide assumes that you have a recent enough version of the Java JDK, ANT, and VS Code. Completing Compiling from Source is a requirement for this guide, although exp..."
 
Ikzann (talk | contribs)
m fix formatting
Line 6: Line 6:
# Install the following files in .vscode:
# Install the following files in .vscode:


launch.json:
===== launch.json: =====
<nowiki>
{
{
    "version": "0.2.0",
    "version": "0.2.0",
    "configurations": [
    "configurations": [
        {
        {
            "type": "java",
            "type": "java",
            "name": "Debug (Launch)-KoLmafia<kolmafia>",
            "name": "Debug (Launch)-KoLmafia<kolmafia>",
            "request": "launch",
            "request": "launch",
            "mainClass": "net.sourceforge.kolmafia.KoLmafia",
            "mainClass": "net.sourceforge.kolmafia.KoLmafia",
            "projectName": "kolmafia",
            "projectName": "kolmafia",
            "args": "--CLI"
            "args": "--CLI"
        }
        }
    ]
    ]
}
}
</nowiki>
 
settings.json:
<nowiki>
{
    "files.exclude": {
        "**/.classpath": true,
        "**/.factorypath": true,
        "**/.project": true,
        "**/.settings": true,
        "**/*.class": true
    },
    "java.project.referencedLibraries": [
        "lib/**/*.jar",
        "src/**/*.jar"
    ]
}
</nowiki>


===== settings.json: =====
{
    "files.exclude": {
        "**/.classpath": true,
        "**/.factorypath": true,
        "**/.project": true,
        "**/.settings": true,
        "**/*.class": true
    },
    "java.project.referencedLibraries": [
        "lib/**/*.jar",
        "src/**/*.jar"
    ]
}
Test by pressing F5 to run KoLmafia.
Test by pressing F5 to run KoLmafia.
====== Optional Steps ======
====== Optional Steps ======
* For easier coding, download the [[:File:KoLMafia Style.xml|KoLMafia Style Definitions]] and figure out how to install them in VS Code.
* For easier coding, download the [[:File:KoLMafia Style.xml|KoLMafia Style Definitions]] and figure out how to install them in VS Code.

Revision as of 01:29, 19 November 2020

This guide assumes that you have a recent enough version of the Java JDK, ANT, and VS Code. Completing Compiling from Source is a requirement for this guide, although experienced developers can skip to whatever step is appropriate.

Build and Config Project Setup

  1. Open the KoLmafia directory in VS Code.
  2. Install the Java Extension Pack, Language Support for Java, Project Manager for Java, and Debugger for Java VS Code extensions.
  3. Install the following files in .vscode:
launch.json:
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "Debug (Launch)-KoLmafia<kolmafia>",
            "request": "launch",
            "mainClass": "net.sourceforge.kolmafia.KoLmafia",
            "projectName": "kolmafia",
            "args": "--CLI"
        }
    ]
}
settings.json:
{
    "files.exclude": {
        "**/.classpath": true,
        "**/.factorypath": true,
        "**/.project": true,
        "**/.settings": true,
        "**/*.class": true
    },
    "java.project.referencedLibraries": [
        "lib/**/*.jar",
        "src/**/*.jar"
    ]
}

Test by pressing F5 to run KoLmafia.

Optional Steps