Skip to content

Commit

Permalink
fixed format
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHaxe committed Sep 5, 2023
1 parent 9b8f0d2 commit 8267a7d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class DeterminePackageFeature {
context.languageServerProtocol.onRequest(LanguageServerMethods.DeterminePackage, onDeterminePackage);
}

public function onDeterminePackage(params:{fsPath:String}, token:Null<CancellationToken>, resolve:{pack:String}->Void,
reject:ResponseError<NoData>->Void) {
public function onDeterminePackage(params:{fsPath:String}, token:Null<CancellationToken>, resolve:{pack:String}->Void, reject:ResponseError<NoData>->Void) {
final handle = if (context.haxeServer.supports(DisplayMethods.DeterminePackage)) handleJsonRpc else handleLegacy;
handle(new FsPath(params.fsPath), token, resolve, reject);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class DocumentFormattingFeature {
context.languageServerProtocol.onRequest(DocumentRangeFormattingRequest.type, onDocumentRangeFormatting);
}

function onDocumentFormatting(params:DocumentFormattingParams, token:CancellationToken, resolve:Array<TextEdit>->Void,
reject:ResponseError<NoData>->Void) {
function onDocumentFormatting(params:DocumentFormattingParams, token:CancellationToken, resolve:Array<TextEdit>->Void, reject:ResponseError<NoData>->Void) {
format(params.textDocument.uri, null, resolve, reject);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ class MissingArgumentsAction {
return args.map(tree -> tree.toString());
}

public static function makeHoverRequest<T>(context:Context, fileName:String, pos:Int,
token:CancellationToken):Promise<Null<HoverDisplayItemOccurence<T>>> {
public static function makeHoverRequest<T>(context:Context, fileName:String, pos:Int, token:CancellationToken):Promise<Null<HoverDisplayItemOccurence<T>>> {
var request:HoverRequestContext<T> = {
params: cast {
file: cast fileName,
Expand Down
6 changes: 2 additions & 4 deletions test/haxeLanguageServer/helper/TypeHelperTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ class TypeHelperTest extends Test {
assertPrintedEquals(parseDisplayType, "function(a:String, b:Bool)", "String -> Bool -> Void",
{argumentTypeHints: true, returnTypeHint: NonVoid, useArrowSyntax: false});

assertPrintedEquals(parseDisplayType, "function():String", "Void -> String",
{argumentTypeHints: true, returnTypeHint: NonVoid, useArrowSyntax: false});
assertPrintedEquals(parseDisplayType, "function():String", "Void -> String", {argumentTypeHints: true, returnTypeHint: NonVoid, useArrowSyntax: false});
}

function testPrintArrowFunctionDeclaration() {
function assert(expected, functionType, argumentTypeHints = false) {
assertPrintedEquals(parseDisplayType, expected, functionType,
{argumentTypeHints: argumentTypeHints, returnTypeHint: Always, useArrowSyntax: true});
assertPrintedEquals(parseDisplayType, expected, functionType, {argumentTypeHints: argumentTypeHints, returnTypeHint: Always, useArrowSyntax: true});
}

assert("() ->", "Void -> Void");
Expand Down

0 comments on commit 8267a7d

Please sign in to comment.