Bug 376304 - [ast] Error markers and Variable highlighting problem with non-ASCII characters
Summary: [ast] Error markers and Variable highlighting problem with non-ASCII characters
Status: RESOLVED FIXED
Alias: None
Product: LDT
Classification: Tools
Component: LuaDevelopmentTools (show other bugs)
Version: unspecified   Edit
Hardware: All Mac OS X - Carbon (unsup.)
: P3 normal
Target Milestone: ---   Edit
Assignee: Kevin KIN-FOO CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday
: 383326 (view as bug list)
Depends on:
Blocks: 384932
  Show dependency tree
 
Reported: 2012-04-08 21:49 EDT by xu cao CLA
Modified: 2012-10-18 13:12 EDT (History)
4 users (show)

See Also:
kkinfoo: review?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xu cao CLA 2012-04-08 21:49:46 EDT
Build Identifier: M20120208-0800

If the source code contains non-ASCII characters, the feature Error markers and Variable highlighting won't work as expect and they will appear in wrong places.

Reproducible: Always

Steps to Reproduce:
1. Input some lua codes like 


function RYTL:get(...)
	if 1 == arg.n then
        if type(arg[1) == "table" then
            local _elements = document:getElementsByProperty(arg[1]);
            elements = {};
            for i, c in ipairs(_elements) do
                elements[i] = Control:new(c);
            end
            return elements;
        end
    end
end

there will be an error marker because ']' is expected after 'arg[1'

2. Insert some non-ASCII characters as below

-- 联动相关方法
--visible、invisible、enable、disable在checkbox不选择中时要执行相反功能。而radio/select则不需要,他们只需执行新选择的radio/option对应的功能;
--参数长度任意,每个参数为控件的name,参数之间用逗号分隔,如RYTVisiable("",userName,password),当多个控件有相同的name时同等处理;
--调用此方法后,请调用screen:reflash();
--第一个参数为引起控件本身的name值,checkbox必需填值,其它控件可选,也可传空值("")。
function RYTL:get(...)
	if 1 == arg.n then
        if type(arg[1) == "table" then
            local _elements = document:getElementsByProperty(arg[1]);
            elements = {};
            for i, c in ipairs(_elements) do
                elements[i] = Control:new(c);
            end
            return elements;
        end
    end
end

the the error marker will appear in the wrong position, and the Variable highlighting doesn't work either.
Comment 1 Benjamin Cabé CLA 2012-04-16 09:29:07 EDT
There's a tentative fix at https://github.com/SierraWireless/org.eclipse.koneki.ldt/tree/bug/376304
Comment 2 Benjamin Cabé CLA 2012-05-14 08:26:10 EDT
Xu Cao, can you confirm that the fix proposed in comment 1 is doing the job correctly?

Thanks!
Comment 3 xu cao CLA 2012-05-14 23:26:06 EDT
Hi, 

    According to my test, it still doesn't work in my environment. There is no error marker even all the input source codes are ASCII characters. I guess maybe there is something wrong in my building process of LDT. If this fix doesn't affect other features of LDT,  why not publish it and then we could download and test it in the production environment.
Comment 4 Kevin KIN-FOO CLA 2012-06-22 12:12:48 EDT
*** Bug 383326 has been marked as a duplicate of this bug. ***
Comment 5 Benjamin Cabé CLA 2012-06-22 12:54:06 EDT
(In reply to comment #3)

Mehhh, it looks like I didn't put the right commit at all in the bug/376304 branch :(
And now I am unable to find anywhere the fix I had... I will try to find it or rewrite it though...
Sorry for the mess, Xu Cao!
Comment 6 Kevin KIN-FOO CLA 2012-10-18 13:12:48 EDT
Fixed with 0fa22ff499d80318461173292d3d77c02019b7d1 and 76e761b4e2a460367f45494c390763b29c25a49b