Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Lua Development Tools » Several questions about LDT(Outlining, unicode, folding etc.)
Several questions about LDT [message #927939] 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 local 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 Smile
PPS: standalone LDT 32 bit 0.8 and 0.9

[Updated on: Sun, 30 September 2012 06:25]

Report message to a moderator

Re: Several questions about LDT [message #927964 is a reply to message #927939] 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 Sad Please delete other ones
Re: Several questions about LDT [message #929450 is a reply to message #927939] Mon, 01 October 2012 13:19 Go to previous messageGo to next message
Marc Aubry is currently offline Marc AubryFriend
Messages: 86
Registered: August 2012
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 #929539 is a reply to message #929450] 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 have gone Smile

[Updated on: Mon, 01 October 2012 15:00]

Report message to a moderator

Re: Several questions about LDT [message #930542 is a reply to message #929539] 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 #932835 is a reply to message #930542] 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 bug is opened.

As you could see, it's a serious problem and we plan 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 #938229 is a reply to message #932835] 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 #940392 is a reply to message #938229] 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. Smile
Re: Several questions about LDT [message #948162 is a reply to message #940392] Wed, 17 October 2012 20:24 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin CabéFriend
Messages: 201
Registered: July 2009
Location: Toulouse, France
Senior Member

Hello Denis!
If you try the latest nightly build (or make your own build Wink) you should now have proper support for non-ASCII encoding!!

Benjamin.


[Updated on: Wed, 17 October 2012 20:25]

Report message to a moderator

Re: Several questions about LDT [message #948457 is a reply to message #927939] 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 #948704 is a reply to message #948457] 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 Wink.
Re: Several questions about LDT [message #949128 is a reply to message #948704] 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] org.eclipse.koneki.ldt.metalua.tests .............. SUCCESS [12.808s]
[INFO] org.eclipse.koneki.ldt.core.tests ................. SUCCESS [14.976s]
[INFO] org.eclipse.koneki.ldt.ui.tests ................... FAILURE [13.837s]
[INFO] org.eclipse.koneki.ldt.product-product ............ SKIPPED
[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]

[Updated on: Thu, 18 October 2012 18:19]

Report message to a moderator

Re: Several questions about LDT [message #949173 is a reply to message #949128] 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! Smile
Re: Several questions about LDT [message #949281 is a reply to message #949173] Thu, 18 October 2012 21:43 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin CabéFriend
Messages: 201
Registered: July 2009
Location: Toulouse, France
Senior Member

Denis Artemov wrote on Thu, 18 October 2012 21:23
The highliting bug gone after updating of LDT from repository. Thanks! Smile


Excellent! Smile
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 #985708 is a reply to message #949281] 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 #985723 is a reply to message #985708] Thu, 15 November 2012 20:02 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin CabéFriend
Messages: 201
Registered: July 2009
Location: Toulouse, France
Senior Member

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 #986455 is a reply to message #985723] 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 #990015 is a reply to message #986455] Mon, 10 December 2012 13:51 Go to previous messageGo to next message
Marc Aubry is currently offline Marc AubryFriend
Messages: 86
Registered: August 2012
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 #990133 is a reply to message #990015] 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 #998237 is a reply to message #990133] Wed, 09 January 2013 16:20 Go to previous message
Marc Aubry is currently offline Marc AubryFriend
Messages: 86
Registered: August 2012
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 want your inputs for the next release of Koneki!
Goto Forum:
  


Current Time: Thu Mar 28 11:41:24 GMT 2024

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

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

Back to the top