Issues

Issue #150 resolved

Upvalues colored incorrectly

rmcode
created an issue

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

upvalueColors.png

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

Comments (8)

  1. rmcode 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:

    iter.png

    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;
            end
            return curIndex, value;
        end
    
        return iterator;
    end
    
  2. Jon 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