1. Jon S Akhtar
  2. Lua For IDEA
  3. Issues


Issue #150 resolved

Upvalues colored incorrectly

Robert M.
created an issue

Sometimes upvalues aren't colored correctly. Note the TILE_SIZE variable:


I didn't notice any pattern - it seems to happen randomly. Tell me if you need more information!

Comments (8)

  1. Robert M. reporter
    • changed status to open

    Hey Jon,

    it seems like one of the recent updates changed the upvalue coloring again. Not sure if this is by design but the coloring looks like this now for me:


    In my opinion the index variables on line 29 should use the purple color too - unless I'm missing something here of course.

    Here is the code in case you want to test it yourself:

    function ripairs(array)
        local index = #array;
        local function iterator()
            local curIndex, value;
            if index > 0 then
                curIndex, value = index, array[index];
                index = index - 1;
            return curIndex, value;
        return iterator;
  2. Jon S Akhtar repo owner

    Ok. One of the features of upvalue highlighting is preserving the semantic identifier type of the upvalued identifier (parameter or local). So by default upvalues, have no color and display an underline. If you add color you lose that feature. But you are right. I did introduce a bug. I just corrected it. It will be in the next build.

  3. Log in to comment