vscode-sqflint icon indicating copy to clipboard operation
vscode-sqflint copied to clipboard

_input0, _input1,... not recognized as defined in BIS_fnc_sortBy

Open Wyqer opened this issue 7 years ago • 1 comments

Reference: https://community.bistudio.com/wiki/BIS_fnc_sortBy

_this select 1: input parameters (Array)
    - used in the eval algorithm (object/numbers/strings ..)
    - input params are referenced in the sorting algorithm by _input0, _input1 .. _input9
    - max. number of 10 input params is supported (0-9)

_input0 etc. are shown as possible not defined, which is basically right, but not if it's used in the parameter list of the above function.

Example: https://github.com/Wyqer/kp_liberation/blob/v0.97/Missionframework/modules/01_core/fnc/fn_core_getNearestSector.sqf#L25

Wyqer avatar Jan 08 '18 18:01 Wyqer

Ok, I don't think adding _input0, _input1 ... as globally ignored variables would fix the issue as those are specific only for this function.

Mabye add possibility to specify local variables, which aren't directly defined using comments?

// @var _input0 BOOL first value description
// @var _input1 SCALAR second value description

params ["_range", ["_centerPos", getPos player]];

private _return = "";
private _foundSectors = KPLIB_sectors_all select {((markerPos _x) distance _centerPos) < _range};
private _sortedSectors = [_foundSectors, [_centerPos], {(markerPos _x) distance _input0}, "ASCEND"] call BIS_fnc_sortBy;
if !(_sortedSectors isEqualTo []) then {_return = _sortedSectors select 0;};

_return

but this is probably a bit too much to ask for as it would require you modify code just to get rid of warning.

SkaceKamen avatar Jan 10 '18 10:01 SkaceKamen