Language server for redscript
- error and warning diagnostics
- autocompletion for methods and fields
- hover for function definitions and types
Language server for redscript
License: MIT License
Language server for redscript
Static method invocations using the this
qualifier are not allowed in redscript. The IDE allows this semantic.
public class EdgerunningRecoverySystem extends ScriptableSystem {
private func GetRecoverHumanityPeriodInc() -> Float {
[...]
let recoveryRate = this.GetRecoverHumanityRate(this.config.recoveryRate, this.config.recoveryThres, freeLoad);
LDebug(s"Recovery rate is \(recoveryRate). rate = \(this.config.recoveryRate), thres = \(this.config.recoveryThres), freeLoad = \(freeLoad)");
let inc = recoveryRate * dayFrac;
LDebug(s"Recovery increment is \(inc). dayFrac = \(dayFrac)");
return inc;
}
public static func GetRecoverHumanityRate(const rate: Float, const thres: Float, const load: Float) -> Float {
[...]
}
}
The above syntax is valid for the IDE, but yields the following compilation error:
2022-11-09T12:52:02.2708629+01:00 [ERROR] At D:\Program Files\Steam\steamapps\common\Cyberpunk 2077\r6\scripts\WannabeEdgerunnerRecovery\core\System.reds:180:24:
let recoveryRate = this.GetRecoverHumanityRate(this.config.recoveryRate, this.config.recoveryThres, freeLoad);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
method GetRecoverHumanityRate;FloatFloatFloat is static
2022-11-09T12:52:49.7671769+01:00 [ERROR] Compilation error: REDScript compilation failed. The game will start, but none of the scripts will take effect. This is caused by errors in:
- WannabeEdgerunnerRecovery
You can try updating or removing these scripts to resolve the issue. If you need more information, consult the logs.
The error can be fixed using explicit type qualification.
let recoveryRate = EdgerunningRecoverySystem.GetRecoverHumanityRate(this.config.recoveryRate, this.config.recoveryThres, freeLoad);
Check for the static
modifier for symbols when using the this
qualifier, and yield an equivalent error to the compiler.
Postscriptum: Love this project
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.