Skip to content

Latest commit

 

History

History

README.md

Intellij IDEA - KerboScript(kOS) Plugin

This plugin enables support for kOS KerboScript in IntelliJ IDEA IDE.

Current kOS version supported: 1.1.2

INSTALL

  1. Install Intellij IDEA
  2. Install KerboScript(kOS)

COMPILE

  1. Download IntelliJ and install the plugins recommended in the prerequisites steps (no need to check out community source files or create a project)
  2. Run ./gradlew buildPlugin (or gradlew.bat on Windows) to build the plugin
  3. Either install the plugin from build/distributions/KerboScript(kOS).zip or run ./gradlew runIde to start up a sandboxed copy of the IDE with the plugin installed in it

Note that Gradle tasks such as buildPlugin or runIde can also be run from within the Gradle tab in IntelliJ.

REFACTORING

Inline (Ctrl+Alt+N)

Variable usage

local b to a^2.
local c to sqrt(|b).
local d to b - 1.

will become

local b to a^2.
local c to sqrt((a^2)).
local d to b - 1.

Variable declaration

local |b to a^2.
local c to sqrt(b).
local d to b - 1.

will become

local c to sqrt((a^2)).
local d to (a^2) - 1.

Simple function

function f {
    parameter x.
    parameter y.

    return x^2 + y.
}

local a to f(b, c).

will become

local a to ((b)^2 + (c)).

Differentiate (Ctrl+Alt+D)

Variable

local y to x^2.

will become

local y_ to 2*x_*x.

Function

function f {
    parameter x.
    parameter y.

    return x^2 + y.
}

will become

function f_ {
    parameter x.
    parameter x_.
    parameter y_.

    return 2*x_*x + y_.
}

Please note that all derivative functions are created in separate file

Simplify (Shift+Ctrl+S)

local x to (a/b) + c + c + a*a + b/b.

will become

local x to a/b + 2*c + a^2 + 1.

Normalize (Shift+Ctrl+O)

local x to (a/b) + c + c + a*a + b/b.

will become

local x to (a + 2*c*b + a^2*b + b)/b.