Closed grymmjack closed 1 year ago
Agreed. This and any new font styles should be controlled by a setting.
This is ready to test in dev.
The setting doesn't seem to work, and the highlighting does not factor int the return type variety:
I have in my settings:
"qb64.isBoldingSubsAndFunctionsEnabled": true,
And it's not bolded.
Note that a function that ends in a type suffix is also not matched.
Actually. I think it was the font rendering on the Mac. I was using my Mac.
On PC, it's absolutely working.
"qb64.isBoldingSubsAndFunctionsEnabled": true,
"qb64.isBoldingSubsAndFunctionsEnabled": false,
Sorry for the false info @LordDurus good to close this I think :)
There is a bug though. It looks like you need negative lookbehind in the regex for '
Negative lookbehind is written as (?<!text)
From: https://www.regular-expressions.info/lookaround.html
See how it's highlighting the comment too?
Also some strange formatting here:
Another strange one:
From my strings.bi here:
''
' QB64_GJ_LIB
' GRYMMJACK'S STRINGS LIB
'
' Some commonly used functions that I missed in QB64 coming from PHP
'
' USAGE:
' Insert '$INCLUDE:'path_to_GJ_LIB/STRINGS/STRINGS.BI' at the top of file
' Insert '$INCLUDE:'path_to_GJ_LIB/STRINGS/STRINGS.BM' at the bottom of file
'
' @author Rick Christy <grymmjack@gmail.com>
' @uses STRINGS.BM
'
$LET GJ_LIB_STRINGS_INC_BI = 1
CONST GJ_LIB_MAX_STR_POSITIONS = 50
DECLARE FUNCTION str_implode$ (arr$(), delim$)
DECLARE SUB str_explode (target$, delim$, dest$(), numParts%)
DECLARE SUB str_find_pos (target$, search$, arrFound%(), numFound%)
DECLARE FUNCTION str_insert$ (s$, ins$, p%)
DECLARE FUNCTION str_remove$ (s$, del$)
DECLARE FUNCTION str_del (s$, del$)
DECLARE FUNCTION str_replace$ (s$, search$, replace$)
DECLARE FUNCTION str_rep$ (s$, search$, replace$)
DECLARE FUNCTION str_slice_pos (s$, startPos%, endPos%)
Last thing: good job on fixing the type suffixes on functions and subs highlighting. Works good:
Looks like there are 2 more issues. 1) Comments 2) Weird color on the function declaration
I think I have the issue with declare function fixed.
The problem was the regex was matching function and not declare function.
Still need to fix:
I think I have it working. Let me know if you find anything else.
I pushed this to dev in v.0.9.1
Testing :)
Found another case of the comments getting highlighted (GOTO command)
Took awhile, but looks good now
https://github.com/QB64Official/vscode/blob/3f6e6633a6d325d660b981a4bdbab245f59e64af/src/decoratorFunctions.ts#L95 https://github.com/QB64Official/vscode/blob/3f6e6633a6d325d660b981a4bdbab245f59e64af/src/decoratorFunctions.ts#L100
We can instead use the
settings.json
and"fontStyle": "bold"
in the"settings"
block if bold is desired.I cannot unset it, I have tried.
The setting is working, just is bold by default which should not be forced on the user.