Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs and Suggestions #19

Open
westor7 opened this issue Feb 11, 2021 · 1 comment
Open

Bugs and Suggestions #19

westor7 opened this issue Feb 11, 2021 · 1 comment

Comments

@westor7
Copy link
Collaborator

westor7 commented Feb 11, 2021

Hello,

I've founded some items that were incorrectly highlight and some that are missing, i would like to share them and we will see how many of these could be fixed/added , i will also try my self to help on these.

Tested under: One Dark Pro (theme)

alias test1 {
  echo -a IS: /load -rs $qt($script)
  ; the >> -rs << should not be highlighted
}

on *:close:#*: { echo -s IS: $1- }
; that event does not get highlight

on ^*:topic:%channels: { echo -a OK }
ON *:TOPIC:$($channels): { echo -a OK }
ctcp *:*:%channels: { echo -a OK }
ctcp *:*:$($channels): { echo -a OK }
; these event coding style does not get highlight
; its because >> :%channels: << and >> :$($channels): <<

on ^*:open:?:*$test*: { my_custom_command $1- }
; /my_custom_command does not get highlight

alias testme { echo -a IS: $(test) }
; the >> $ << does not get highlight on $()

alias test { echo -a IS $file($mircini).size }
; here it should highlight >> .size << and not only the $prop name (size), it should include also the '.' as already does '-' for flags (-whatever)

alias test2 { .timer[test] 1 5 echo mysignal $nick }
; here are 2
; 1 = the >> .timer[test] << the ']' should also be highlight because its the /timer name
; 2 = the >> echo << does not get highlight, it should because its a /command

alias test3 { echo -a IS: $+(%,variable) }
alias test4 { echo -a IS: $+($,alias) }
; here the >> % << and >> $ << inside the $() should get a highlight

alias test5 { 
  if ($(!) !isin %trusted) {
    if ($left(%trusted,1) != *) %trusted = * $+ %trusted
      %trusted = *! $+ %trusted
  }

  echo -a nothing
  return $false 
  echo -a anything
  /noop
}
; here for an unknown reason it stops highlighing after the if statement

alias test6 {

 ; if (%test) { echo ok }
 ; elseif (%test2) { echo ok2 }
 
 if ($me) { echo -a ok }
 
 echo -a Not getting highlight
}
; here if having some comment out lines that ending with '}' then it stops progressing the highlight on the rest code

alias test7 {
  if ($1 isnum 1-600) { echo -a OK }
  if ($1 isnum 601-) { echo -a OK }
}
; here the >> 1-600 << and >> 601 << numbers does not getting highlight

alias test8 {
  goto next

  noop

  :next

  noop
}
; here, i don't know if it is not yet supported but, >> :next << group should be highlight

alias test9 {
  var %pattern = var %re /^(?:(https?)(?::\/\/))?([^\s\/]+)(.*)$/F
}
; here the regex pattern seems not getting a highlight, i am not sure if this is fully supported.

alias test10 { echo -a IS: $left(test,1-) }
; here the >> 1- << does not gets a highlight, as '-1' does

alias test11 { bset -ta &gif 61 +M8p47Eh4SAD4z9FkwqDh05tzOJ2LSsCGo52S7ByuHQYJLu1yghX7fkR8MiD }
; here the >> +M8p47Eh4SAD4z9FkwqDh05tzOJ2LSsCGo52S7ByuHQYJLu1yghX7fkR8MiD << should not get a highlight

alias test12 { 
  var %ticks = %ticks % 1000

  %ticks = % 1000
}
; here the 2nd >> 1000 << number does not get highlight as 1st does with /var

alias test13 { scon -a debug -c off }
; here the >> debug << should get a highlight color because its a valid /command

ON !*:JOIN:#: { echo -a Channel is: # }
; here the >> # << does not get a highlight as it parsing, ok i know it could be '$chan' instead but some people keep using '#' 
@Kedyn
Copy link
Member

Kedyn commented Feb 19, 2021

Errors/Enhancements:

  • switches
  • on close channel target
  • on topic targets
  • ctcp event targets
  • on open matching text
  • $() as $eval identifier
  • . on props should be highlighted
  • timer name
  • % and $ should be highlighted
  • alias code block and code block end together
  • commented }
  • number ranges
  • goto label
  • number ranges (1-)
  • bset text
  • number highlighting inconsistent
  • scon commands
  • channel symbol to be treated as a special character/identifier

Notes:

  1. We currently do not use a strict switches highlighting rule, we use a global rule so it takes into account commands that use switches that are separated by spaces and other arguments.
  2. No documentation was found on having the channel symbol as a valid target on close event
  3. Might not only be a problem for on topic because we use a non-variable/non-identifier friendly on the targets for events
  4. Same as 3.
  5. Currently grouped with the on close event, which does not require a matchtext argument
  6. $() needs to be added as a valid identifier
  7. To be consistent with the switches highlighting . should be added to the highlighting part
  8. Unknown reason as to why it is not highlighting the last characters as the regex says to include non-space characters, might have to do with the (?=\b) flag
  9. I do not agree with this as % and $ are not variables nor identifiers and should be treated as text only
  10. Seems as if the if code block does not consume the } and the alias code block takes it
  11. Single line comments are stopped when it finds a }
  12. Highlighting number ranges is more of an enhancement rather than a bug
  13. Same as 12.
  14. Same as 12.
  15. Same as 12.
  16. Same as 1.
  17. Unknown reason as to why is not highlighting the number, numbers are part of the constant group in the language file
  18. Again, we are using more global rules to parse each command, we would need to add a specific rule for certain commands
  19. Same as 12.

I believe we could split this issue into 2, one with all the bugs and another one with all the enhancements, as issues should take a different priority over enhancements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants