0

I'm playing a game that allows you to write Lua in-game to make things happen, and I'm working on a VS Code extension that supports the game's custom functions. I got stuck when I wanted to highlight the fact that the PixelData:GetPixel method returns a Color object, which has the properties r, g, and b. How would I reference the properties that have been called off of one of those color objects?

Also if anyone has any resources on this they could share, I wasn't able to find one that clicked with me.

Here's what I have so far:

{
  "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
  "name": "Lua",
  "patterns": [
    {
      "include": "#keywords"
    },
    {
      "include": "#strings"
    }
  ],
  "repository": {
    "keywords": {
      "patterns": [
        {
          "name": "keyword.control.lua",
          "match": "\\b(if|while|for|return)\\b"
        },
        {
          "name": "entity.name.function.custom",
          "match": "\\b(output|output_array|output_image|trigger|read_var|write_var|write_var_array|color)\\b"
        },
        {
          "name": "variable.other.custom",
          "match": "\\bV[1-8]\\b"
        },
        {
          "name": "support.class.custom",
          "begin": "\\bPixelData\\b",
          "patterns": [
            {
              "name": "support.function.custom",
              "match": "\\bSetPixel\\b"
            },
            {
              "name": "support.function.custom",
              "match": "\\bGetPixel\\b"
            }
          ],
          "end": ""
        }
      ]
    },
    "strings": {
      "name": "string.quoted.double.lua",
      "begin": "\"",
      "end": "\"",
      "patterns": [
        {
          "name": "constant.character.escape.lua",
          "match": "\\\\."
        }
      ]
    }
  },
  "scopeName": "source.lua"
}
JShoe
  • 3,186
  • 9
  • 38
  • 61

0 Answers0