Open config2000 opened 2 years ago
@pmgl May I work on this?
Pasting the below into 'mylang' option of https://microsoft.github.io/monaco-editor/monarch.html you can pretty much most of microScript code to syntax highlighting/auto-complete. Note that there are more commands added to microScript since I put the below together,
Hoping to see auto-completed added the the IDE.
keywords: [ 'local','global','object','class','extends','super','this','new', 'if','then','else','elsif','print','end', 'for','to','in','by','break','continue', 'function','return','while', 'and','or','not','true','false', 'max','min','round','ceil','floor','abs','sqrt','pow','PI','log','epx', 'sin','cos','tan','asin','acos','atan','atan2', 'sind','cosd','tand','asind','acosd','atand','atan2d', 'random','seed','next','nextInt', 'length','substring','startsWith','endsWith','indexOf','lastIndexOf','replace','toUpperCase','toLowerCase','split', 'push','insert','insertAt','removeAt','contains','removeElement','concat' ],
typeKeywords: [ 'set','get', 'screen','width','height','clear','setColor','setAlpha', 'fillRect','fillRound','fillRoundRect', 'drawRect','drawRound','drawRoundRect','drawLine','fillPolygon','drawPolygon', 'drawPolyline','setLineWidth','setLineDash', 'setLinearGradient','setRadialGradient', 'setTranslation','setDrawRotation','setDrawScale','setDrawAnchor','setBlending', 'setCursorVisible', 'sprites','drawSprite','drawSpritePart', 'maps','drawMap','block_width','block_height','clone', 'drawText','drawTextOutline','setFont','loadFont','isFontReady','textWidth', 'inputs','keyboard','mouse','touch','gamepad','touches','touching','press','pressed','release','left','right','middle', 'system','time', 'storage', 'audio','playSound','playMusic','setVolume','setPitch','setPan','play','stop','getPosition','getDuration','beep','cancelBeeps' ],
One thing I really miss in that is in other IDE's is auto-complete. Ace supports auto-completion via a 'live-autocompletion' option:
https://ace.c9.io/build/kitchen-sink.html
Please consider adding auto-complete for microScript Lua and Javascript is already supported by the Ace IDE so that should be straight-forward enough.