SQF Highlighter – Extension
Category: Pages with SQF errors
Lou Montana (talk | contribs) m (Fix) |
Lou Montana (talk | contribs) m (Fixes) |
||
| Line 216: | Line 216: | ||
== Known Issues == | == Known Issues == | ||
{| class="wikitable sortable" | |||
! class="unsortable" | Issue | |||
! Report Date | |||
! Fix Date | |||
|- | |||
| comment blocks still highlight words as global variables for now | |||
| 2022-03-15 | |||
| 2022-03-17 | |||
|- | |||
| #if are considered as keywords | |||
| 2022-03-15 | |||
| 2022-03-17 | |||
|- | |||
| single-quote strings have issues with other formatting between quotes | |||
| 2022-03-15 | |||
| {{n/a}} | |||
|- | |||
| negative numbers should see the minus sign coloured as well<br>''in the end, they should not'' | |||
| 2022-03-15 | |||
| 2022-03-17 | |||
|} | |||
{{Feature|informative|report other issues on [https://discord.gg/arma Discord]!}} | |||
Revision as of 01:48, 18 March 2022
| SQF Highlighter | |
|---|---|
| Description | Highlights and links SQF commands and functions |
| Author | Lou Montana |
| Version | 0.5b (version is not incremented for now due to continuous updates as of 2022-03-14) |
| Release Date | 2022-03-12: First upload |
| Project Start | 2022-03-08: Project start |
This extension highlights and automatically links SQF commands and functions.
Installation
- Unzip the directory to wiki
/extensions /SQFHighlighter - Add
wfLoadExtension('SQFHighlighter');to LocalSettings.php - There are no settings - the extension creates full path links unless the host is one of the following (then relative links are created):
- community.bistudio.com
- community.bohemia.net
Usage
Using <sqf> tags will auto-generate syntax highlighting and links to the pages.
| Code | Result |
|---|---|
<sqf/> |
-no SQF code provided-
|
<sqf></sqf> |
-no SQF code provided-
|
<sqf> </sqf> |
-no SQF code provided-
|
<sqf>hint "It Works!";</sqf> |
hint "It Works!"; |
<sqf> // your code here hint "good!"; </sqf> |
|
<sqf>
#define fadeInDuration 3
waitUntil { not alive player };
hint DEATH_MESSAGE;
cutText ["", "Black", playerRespawnTime];
private _deathTime = time;
Deaths = Deaths + 1;
/*
wait for resurrection
*/
waitUntil { alive player && { preloadCamera getPosATL player } };
sleep 3;
cutText ["Welcome!", "Black in", fadeInDuration];
// after 10s, end the mission
sleep 10;
[] call BIS_fnc_endMission;
</sqf>
|
#define fadeInDuration 3
waitUntil { not alive player };
hint DEATH_MESSAGE;
cutText ["", "Black", playerRespawnTime];
private _deathTime = time;
Deaths = Deaths + 1;
/*
wait for resurrection
*/
waitUntil { alive player && { preloadCamera getPosATL player } };
sleep 3;
cutText ["Welcome!", "Black in", fadeInDuration];
// after 10s, end the mission
sleep 10;
[] call BIS_fnc_endMission; |
CSS Classes
All elements are <span> but the parent block that is a <div>.
| Element | CSS class | Overview |
|---|---|---|
| parent block | sqfhighlighter-block | |
| error message | sqfhighlighter-error | -no SQF code provided-
|
| comment | sqfhighlighter-comment | // comment
/*
this is
a multiline
comment
*/ |
| string | sqfhighlighter-string | "string" |
| number | sqfhighlighter-number | 42
-6.9
10e10 |
| operator | sqfhighlighter-operator | |
| keyword (if, then, waitUntil, etc) | sqfhighlighter-keyword | |
| command | sqfhighlighter-command | |
| function | sqfhighlighter-function | |
| external function | sqfhighlighter-function-ext | // not just considering BIS_ or BIN_
BIS_fnc_unknownFunction
TAG_fnc_spawnGroup |
| local variable | sqfhighlighter-localvar | _localVar |
| global variable | sqfhighlighter-globalvar | |
| macro | sqfhighlighter-macro | #define
#if
#endif |
| constant (#defined value) | sqfhighlighter-const | // anything #defined or anything UNDERSCORED_ALL_CAPS
#define testVar
testVar;
otherVar;
MY_CONSTANT; |
| array start ([) | sqfhighlighter-arraystart | [... |
| array end (]) | sqfhighlighter-arrayend | ...] |
| code start ({) | sqfhighlighter-codestart | {... |
| code end (}) | sqfhighlighter-codeend | ...} |
| parenthese start ({) | sqfhighlighter-parenthesestart | (... |
| parenthese end (}) | sqfhighlighter-parentheseend | ...) |
Known Issues
| Issue | Report Date | Fix Date |
|---|---|---|
| comment blocks still highlight words as global variables for now | 2022-03-15 | 2022-03-17 |
| #if are considered as keywords | 2022-03-15 | 2022-03-17 |
| single-quote strings have issues with other formatting between quotes | 2022-03-15 | N/A |
| negative numbers should see the minus sign coloured as well in the end, they should not |
2022-03-15 | 2022-03-17 |