Giter Club home page Giter Club logo

msl-vscode-extension's Introduction

mIRC Scripting Language Support for Visual Studio Code

This is a Visual Studio Code extension that adds support for mIRC Scripting Language.

Preview

Preview

Features

  • Syntax highlighting
    • mIRC
    • AdiIRC
  • Snippets
    • Alias constructors (constants, commands, identifiers, and command and identifier)
    • Built-in commands (WIP)
    • Built-in identifiers (WIP)
    • Built-in events (WIP)
    • Miscellaneous
  • Error reporting (WIP)

Contributing

All contributions are welcome.

Acknowledgements

The grammar was built based on highlightjs-mirc project, lol2k's vscode-mirc extension and Sreject's language-mircscript project.

Some test/examples were taken from: https://en.wikichip.org/wiki/mirc

License

This project is made available under the MIT License.

Known Issues

  • Commands are restrcited to one line, i.e. $& is ignored.
  • If/elseif/else/while must contain parentheses.

msl-vscode-extension's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

msl-vscode-extension's Issues

Enable for Visual Studio Code for the Web

At the moment this extension cannot be used in the online editor
If you are still working on it I would love to see it availiable there... I like to code while i work and cannot install the main program on the work computers due to restrictions

Bugs and Suggestions

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 '#' 

Matching parameter not working for some events

Hello, first time ever posting on github >_< not even sure if I'm doing this right...

"begin": "^(?i)(on\\x20+(?:me:)?[^:\\s]+:(?:(?:un)?ban|(?:de)?help|(?:de|server)?op|(?:de)?owner|(?:de)?voice|invite|join|kick|(?:server|raw)?mode|part|topic|(?:de)?admin):(?:\\*|#[^:]*):)\\s*",

All the events in this match group support variables, aliases, evaluated variables, and aliases as well

examples:

set %var-chans #channel1,#channel2
alias -l alias_channels { return #channel1,#channel2 }

ON *:JOIN:%var-chans:
ON *:JOIN:$(%var-chans):
ON *:JOIN:$($alias_chans):

I did some testing from my side and replacing (?:\\*|#[^:]*) with (?:\\*|(?:%|#|\\x24\\x28.+\\x29)[^:]*) did the trick for me, maybe you can find a better way...

New logo(s) ...

We're looking for new logo(s)...

I've taken the liberty to spend some time wrestling with the GIMP to create the following:

BLUE_CUBE_MSL

I've set it as an avatar pic for the 'mIRC Scripters' org, replacing the default one.
edit: not definitive, merely a suggestion and see-how-it-looks-check.

Maybe create a new repository where we could publish all (our) creative GIMP/Inkscape/Photoshop ideas to and set a license?

Add support for adiirc? (https://adiirc.com)

It's another IRC client, but comes with built-in mSL.. Some identifiers/commands aren't in mIRC and some mIRC identifiers/commands aren't in adiirc.

Should we add support for adiirc?

I think it would be some extra work, but worth it.

mSL Formatter for VS Code

It would be nice to figure out how we can build a mSL formatter for VSC .

Formatter suppose to work like CTRL + H on mIRC/AdiIRC Scripts Editor

Key combination : Shift + Alt + F says there is not any made yet.

Commands, Identifiers, and events snippets format design

For the next minor version I decided to add the built-in commands, identifiers, and events.

lol2k's version has a basic prefix and body format.
@westor7 had also added all the new commands on the linguist repo I think, we could just use this.

On the current version I am working on I have added description of the commands. This might not be so necessary for everyone, but might help so that one does not need to open something like the help file.

I have added the prefix cmd: to all commands so that when you type cmd, the whole list of commands pops up and you can read through the one you need. I think the same can be done for identifiers and commands, id: for identifiers and event: or on: for events.

An m or a could also be added to the prefixes to separate from mIRC's only and AdiIRC's only built-in commands, identifiers, and events.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.