Currently on the DevForum, syntax highlighting is poor, only compatible with Lua, and even then missing certain libraries.
Current syntax highlighting is not even compliant with Roblox’s Luau, no type checking acknowledgement, missing libraries like task
, and others.
As you can see below,
local Node = {}
Node.__index = Node
type Node = {
_value: any,
_bindable: BindableEvent,
Changed: RBXScriptSignal
}
function Node.new(value: any): Node
local self = setmetatable({
_value = value,
_bindable = Instance.new("BindableEvent"),
Changed = nil
}, Node)
self.Changed = self._bindable.Event
return self
end
function Node:Set(value: any): Node
if self._value ~= value then
self._value = value
self._bindable:Fire()
end
return self
end
function Node:Get(): any
return self._value
end
function Node:Destroy()
if self._bindable == nil then
return
end
self._value = nil
self._bindable:Destroy()
self._bindable = nil
self.Changed = nil
end
return Node
It’s pretty poor. The only reason for the keyword type
to be highlighted at all is that there is a global function type
, which is now usually replaced by typeof
.
Can we talk about how after at least 2 years of being added, it still doesn’t have proper highlighting?
Anyhow, obviously as you can see the Lua part of syntax highlighting seriously need a revamp of sorts, to add compatibility to Luau’s new features.
But another thing to note is that AFAIK there is no support for any other language to highlight. Correct me if I’m wrong.
If this was to be added for anything else, one of my top picks would be json
compatibility, as it is pretty used in a lot of areas inside and outside Roblox, and is also used for data stores.
Discord handles syntax highlighting similarly but not exactly like the forum, it instead, allows you to tell it what language is the code in that block for.
You can do this on Discord in these ways:
```lua
```json
```javascript
```python
This is a great way to do this! Infact, I already do this when making a code block on Discourse because I’m used to it. Normal blocks with no specified language would default to lua.