Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Koneki » Several questions about LDT
Several questions about LDT [message #1416672] Sun, 30 September 2012 05:44 Go to next message
Denis Artemov is currently offline Denis ArtemovFriend
Messages: 38
Registered: September 2012
Member
Hi,

I'm trying LDT right now (0.8 and 0.9 versions). Can't make outlining working. It shows only global variables. How to make it to show more members?

Also if to add any russian comment or text into source, variable highliting, syntax coloring, code assistant become broken. How to fix it?

And how to make code folding to work? It sometimes shows (-) for folding randomly in sources, but folds erroneous block if to click on (-).

PS: Sorry for my English :)
PPS: standalone LDT 32 bit 0.8 and 0.9
Re: Several questions about LDT [message #1416673 is a reply to message #1416672] Sun, 30 September 2012 06:10 Go to previous messageGo to next message
Denis Artemov is currently offline Denis ArtemovFriend
Messages: 38
Registered: September 2012
Member
And sorry for messag doubles :( Please delete other ones
Re: Several questions about LDT [message #1416676 is a reply to message #1416672] Mon, 01 October 2012 13:19 Go to previous messageGo to next message
Marc Aubry is currently offline Marc AubryFriend
Messages: 76
Registered: July 2009
Member
Hi Denis,

First, thanks for using LDT and to take time to post your feedback.

1) See following post which explain elements handle in the outline:
http://www.eclipse.org/forums/index.php/m/896827/?srch=outline#msg_896827

2) Does your Russian character need a special file encoding ? if yes, which one ?
So far, other encoding than UTF-8 are not really supported/tested in LDT.

3) As i know code folding is only working for top level blocks. If you have weird behaviors when folding code please attach a screen-shot or describe the way to reproduce it. If it's sure there is a bug, feel free to open an issue using following link: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Koneki;component=LuaTools

Marc
Re: Several questions about LDT [message #1416678 is a reply to message #1416676] Mon, 01 October 2012 14:51 Go to previous messageGo to next message
Denis Artemov is currently offline Denis ArtemovFriend
Messages: 38
Registered: September 2012
Member
Looks like it is enough to change non ASCII-charasters in sources into any ASCII-charaster before creating AST.

I added this to LuaSourceParser.java:

private static String prepareSourceTextForMetaLua(String text)
{
char[] chars = text.toCharArray();
for (int i = 0; i < chars.length; i++) if (chars[i] > 128) chars[i] = '?';
return new String(chars);
}



and did this:

public IModuleDeclaration parse(IModuleSource input, IProblemReporter reporter) {
LuaSourceRoot module = new LuaSourceRoot(input.getSourceContents().length());

synchronized (LuaSourceParser.class) {
try {
String preparedSource = prepareSourceTextForMetaLua(input.getSourceContents()); // change non ASCII charasters to '?'
module = astBuilder.buildAST(preparedSource); // and then create AST
} catch (LuaException e) {
Activator.logError("Unable to load metalua ast builder :" + input.getFileName(), e); //$NON-NLS-1$
}
...


and my problems with syntax coloring, variables highliting and folding has gone :)
Re: Several questions about LDT [message #1416679 is a reply to message #1416678] Tue, 02 October 2012 12:13 Go to previous messageGo to next message
Denis Artemov is currently offline Denis ArtemovFriend
Messages: 38
Registered: September 2012
Member
PS: Russian charasters not need to be encoded only in utf-8. They can be encoded by windows-1251 which is one byte encoding, but the bug appears both with utf-8 and windows-1251 (without my fix)
Re: Several questions about LDT [message #1416682 is a reply to message #1416679] Thu, 04 October 2012 13:34 Go to previous messageGo to next message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
Registered: July 2009
Senior Member
Hi Denis,
I have some precision/correction about your problems :
1) We currently (v0.8.x) don't support UTF8 encoding, we only support ascii (one byte character exactly).
2) As you found by yourself, all problems about syntax coloring, variables highlighting and folding come from non ascii character in your source file. If you want to follow this problem, a https://bugs.eclipse.org/bugs/show_bug.cgi?id=376304 is opened.

As you could see, it's a serious problem and we https://bugs.eclipse.org/bugs/show_bug.cgi?id=384932 to fix it for the v0.9.0, but we did not found a good solution for now.
Your proposition is interesting but this means if there are non ascii character in code, outline content-assist and documentation will contains "?" char instead of the right one :/.
If we don't find a better solution, this could be the lesser evil.

Thx denis for your feedback and the code you post.
Re: Several questions about LDT [message #1416688 is a reply to message #1416682] Tue, 09 October 2012 17:25 Go to previous messageGo to next message
Denis Artemov is currently offline Denis ArtemovFriend
Messages: 38
Registered: September 2012
Member
Simon Bernard wrote on Thu, 04 October 2012 09:34
> If you want to follow this problem, a bug is opened.


The issue called "Error markers and Variable highlighting problem with non UTF-8 source files" but it seems no matter which coding is used for storing text info files. The bug depends on non-ASCII charasters only.
Re: Several questions about LDT [message #1416696 is a reply to message #1416688] Thu, 11 October 2012 15:40 Go to previous messageGo to next message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
Registered: July 2009
Senior Member
You're right I change the name. :)
Re: Several questions about LDT [message #1416708 is a reply to message #1416696] Wed, 17 October 2012 20:24 Go to previous messageGo to next message
Eclipse UserFriend
Hello Denis!
If you try the latest nightly build (or make your own build ;)) you should have proper support for non-ASCII encoding!!

Benjamin.
Re: Several questions about LDT [message #1416709 is a reply to message #1416672] Thu, 18 October 2012 03:50 Go to previous messageGo to next message
Denis Artemov is currently offline Denis ArtemovFriend
Messages: 38
Registered: September 2012
Member
Simon Bernard,

build not working for me:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:33.597s
[INFO] Finished at: Thu Oct 18 09:26:37 YEKT 2012
[INFO] Final Memory: 110M/247M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.15.0:compile (default-compile) on project org.eclipse.koneki.ldt: Com
pilation failure: Compilation failure:
[ERROR] D:\java\LDT\plugins\org.eclipse.koneki.ldt\src\org\eclipse\koneki\ldt\core\internal\ast\parser\EncodingVisitor.java:[95,0]
[ERROR] luaNode.setStart(fixedOffet(luaNode.start()));
[ERROR] ^^^^^
[ERROR] The method start() is undefined for the type LuaASTNode
[ERROR] D:\java\LDT\plugins\org.eclipse.koneki.ldt\src\org\eclipse\koneki\ldt\core\internal\ast\parser\EncodingVisitor.java:[98,0]
[ERROR] final int nodeEnd = luaNode.end();
[ERROR] ^^^
[ERROR] The method end() is undefined for the type LuaASTNode
[ERROR] 2 problems (2 errors)

Updating from download.eclipse.org/koneki/updates-nightly didn't solve the highliting bug
Re: Several questions about LDT [message #1416712 is a reply to message #1416709] Thu, 18 October 2012 09:32 Go to previous messageGo to next message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
Registered: July 2009
Senior Member
Hi Denis,
I did some tests and it's ok if you use LDT with the last eclipse platform (Juno), but it seems you find a regression with the indigo platform, I will fix that right now.

I see in another post you built the LDT project with the "platform-indigo" profile. This means you force the build to use an old eclipse platform. If you prefer the indigo platform you right to do that but if you have no preferences you should use the last one (which should be theoricaly better), in this case use just a "mvn clean install -P build-product"

I hope this will fix your encoding problem ;).
Re: Several questions about LDT [message #1416715 is a reply to message #1416712] Thu, 18 October 2012 18:18 Go to previous messageGo to next message
Denis Artemov is currently offline Denis ArtemovFriend
Messages: 38
Registered: September 2012
Member
With "mvn clean install -P build-product" it stops on

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4:24.857s
[INFO] Finished at: Fri Oct 19 00:16:07 YEKT 2012
[INFO] Final Memory: 90M/237M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.15.0:test (default-test) on project org.eclipse.koneki.ldt.ui.tests:
There are test failures.
[ERROR]
[ERROR] Please refer to D:\java\LDT\tests\org.eclipse.koneki.ldt.ui.tests\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
Re: Several questions about LDT [message #1416716 is a reply to message #1416715] Thu, 18 October 2012 19:23 Go to previous messageGo to next message
Denis Artemov is currently offline Denis ArtemovFriend
Messages: 38
Registered: September 2012
Member
The highliting bug gone after updating of LDT from repository. Thanks! :)
Re: Several questions about LDT [message #1416717 is a reply to message #1416716] Thu, 18 October 2012 21:43 Go to previous messageGo to next message
Eclipse UserFriend
Denis Artemov wrote on Thu, 18 October 2012 21:23
> The highliting bug gone after updating of LDT from repository. Thanks! :)


Excellent! :)
Please keep on sharing your experience with LDT, and feel free to discuss enhancement requests or bugs along the way

Benjamin
Re: Several questions about LDT [message #1416740 is a reply to message #1416717] Thu, 15 November 2012 18:17 Go to previous messageGo to next message
Denis Artemov is currently offline Denis ArtemovFriend
Messages: 38
Registered: September 2012
Member
Hm... Highlight and folding don't work for my startup.lua file:

local geo = require("geo")
local project = require("sys.project")

-- Подключаем отладчик для LDT, если он присутствует
if geo.is_file(geo.get_scripts_dir() .. '\\..\\lua_debugger\\lua\\debugger.lua') then
package.path = "..\\lua_debugger\\lua\\?.lua;" .. package.path
package.cpath = "..\\lua_debugger\\bin\\?.dll;" .. package.cpath
require("debugger")('localhost', 12345, '0000')
end

-- Инициализируем проект по умолчанию
project.init_project_by_num(0)
Other files seems are ok.
Re: Several questions about LDT [message #1416741 is a reply to message #1416740] Thu, 15 November 2012 20:02 Go to previous messageGo to next message
Eclipse UserFriend
Hello Denis,

Works just fine for me with latest 0.9. I suspect you might be using 0.8...?
If not, please send more details in order for us to try to reproduce

Thank you!
Re: Several questions about LDT [message #1416743 is a reply to message #1416741] Tue, 20 November 2012 14:01 Go to previous messageGo to next message
Denis Artemov is currently offline Denis ArtemovFriend
Messages: 38
Registered: September 2012
Member
I used latest 0.9.
Just try to create startup.lua file and paste text above in it. PS: I use UTF8 encoding for files.
Re: Several questions about LDT [message #1416755 is a reply to message #1416743] Mon, 10 December 2012 13:51 Go to previous messageGo to next message
Marc Aubry is currently offline Marc AubryFriend
Messages: 76
Registered: July 2009
Member
Hi Denis,

It seems we are not able to reproduce the bug on the latest 0.9RC1 version. Maybe you can provide us more details about the steps to reproduce and/or the log file you can find under this path:
<yourWorkspaceFolder>/.metadata/.log.

Thanks,
Marc
Re: Several questions about LDT [message #1416757 is a reply to message #1416755] Tue, 11 December 2012 03:31 Go to previous messageGo to next message
Denis Artemov is currently offline Denis ArtemovFriend
Messages: 38
Registered: September 2012
Member
Hm... I cleaned up the log, opened the file startup.lua and closed LDT. The log file stayed empty.
And I have no idea about way to reproduce. I just open this file.
Re: Several questions about LDT [message #1416766 is a reply to message #1416757] Wed, 09 January 2013 16:20 Go to previous message
Marc Aubry is currently offline Marc AubryFriend
Messages: 76
Registered: July 2009
Member
Sorry, for the late response, but we still don't reproduce on our side.

Maybe, you reproduce the bug in a 0.9 release ?
And if you copy the content in a new file, do you have the same behavior on opening ?

Marc
Previous Topic:How to use LuaFileSystem in LDT?
Next Topic:We need your inputs for the next release of Koneki!
Goto Forum:
  


Current Time: Fri Mar 29 06:43:29 GMT 2024

Powered by FUDForum. Page generated in 0.05343 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top