mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-15 10:15:35 +00:00
Add Haxe language support via vshaxe/haxe-language-server
Includes full setup with ls provider, tests, docs, etc.
This commit is contained in:
1 parent
ded6f9a93c
commit
e9b6c0ff85
18 files changed
+772
-3
No files matched your search
@@ -0,0 +1,3 @@
|
||||
export/
|
||||
dump/
|
||||
bin/
|
||||
@@ -0,0 +1,3 @@
|
||||
-cp src
|
||||
-main Main
|
||||
--no-output
|
||||
@@ -0,0 +1,40 @@
|
||||
import utils.Helper;
|
||||
|
||||
/**
|
||||
* Main class for testing Haxe language server functionality.
|
||||
*
|
||||
* This class tests:
|
||||
* - Symbol discovery (class, methods, fields)
|
||||
* - Within-file references
|
||||
* - Cross-file references to utils.Helper
|
||||
*/
|
||||
class Main {
|
||||
var message:String;
|
||||
var count:Int;
|
||||
|
||||
public function new() {
|
||||
message = greet("World");
|
||||
count = Helper.addNumbers(5, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* Greet someone by name.
|
||||
*/
|
||||
public function greet(name:String):String {
|
||||
return "Hello, " + name + "!";
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate and return the formatted result.
|
||||
*/
|
||||
public function calculateResult():String {
|
||||
var sum = Helper.addNumbers(count, 20);
|
||||
var formatted = Helper.formatMessage(message);
|
||||
return formatted + " (sum: " + Std.string(sum) + ")";
|
||||
}
|
||||
|
||||
public static function main() {
|
||||
var app = new Main();
|
||||
Sys.println(app.calculateResult());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package utils;
|
||||
|
||||
/**
|
||||
* Utility functions for the Haxe test application.
|
||||
*
|
||||
* This class provides helper functions used by the Main class.
|
||||
*/
|
||||
class Helper {
|
||||
/**
|
||||
* Format a message by adding brackets around it.
|
||||
*/
|
||||
public static function formatMessage(msg:String):String {
|
||||
return "[ " + msg + " ]";
|
||||
}
|
||||
|
||||
/**
|
||||
* Add two numbers together.
|
||||
*/
|
||||
public static function addNumbers(x:Int, y:Int):Int {
|
||||
return x + y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiply two numbers.
|
||||
*/
|
||||
public static function multiplyNumbers(x:Int, y:Int):Int {
|
||||
return x * y;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user