sejerpz / vtg

Automatically exported from code.google.com/p/vtg
0 stars 0 forks source link

Bugs in parsing Makefiles and Resolve Symbols #165

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. bzr branch lp:synapse-project
2. open some .vala file into src/ folder with gedit from terminal
3. lots of error and no autocomplete

What is the expected output? What do you see instead?
I expect to have autocomplete working.

What version of the product are you using? On what operating system?
Lastest checked out from gitorious.

Please provide any additional information below.
First of all, there is a problem in the vbfautotools.vala around line 206:
The regexp(s) should be:
//Extract AC_CONFIG_FILES
reg = new GLib.Regex ("AC_CONFIG_FILES\\(\\[([^\\]\\)]*)\\]\\)", 
RegexCompileFlags.MULTILINE);
bool res = reg.match (buffer, RegexMatchFlags.NEWLINE_CR, out match);
if (!res) {
  reg = new GLib.Regex ("AC_OUTPUT\\(\\[([^\\]\\)]*)\\]\\)", RegexCompileFlags.MULTILINE);
  res = reg.match (buffer, RegexMatchFlags.NEWLINE_CR, out match);
}

Also if you look at synapse's src/Makefile.am,
you can see at the first line an "include $(top_src)/Makefile.common",
this will throw an error in process_include_directives (..),
that error should be catched inside process_include_directives,
otherwise it'll crash all the refresh(..)[line 84] internal loop.

There's also a bug when fetching packages [line 160]:
if the configure.ac has multilne packages you should remove tokens that 
contains only a "\".
So I added a:
if (pkg == "\\") {idx++; continue;}
Inside the loop at line 164.

If you do those things, vbfautotools is working correctly, but autocomplete is 
not working: (there are a lot of)
** Message: symbolresolver.vala:54: file 
/home/alby/dev/synapse-project/src/tile-view/tile.vala - can't resolve using 
directive: Gtk

I don't know how symbolresolver is working, so I can't help at the moment.

Thank you.

Original issue reported on code.google.com by albyrock87 on 13 Mar 2011 at 2:25

GoogleCodeExporter commented 9 years ago
What about opening the project with the menu' File -> open project?

You have just to select the folder containing the configure.ac script from the 
dialog.

If you still want to open source files directly and automatically open the 
whole project just go in the plugin option and enable 'project automatically 
find root folder' options.

With your correction and one of this step vala toys should work  as expected.

Thanks for your suggestions I will review and include them in the next release. 
By the way do you mind attach here a patch done with git diff ?

Original comment by seje...@gmail.com on 13 Mar 2011 at 2:58

GoogleCodeExporter commented 9 years ago
Attached the patch :)

I've tried now the open project, and it (almost) works:
It doesn't show sources in (synapse's) src/*.vala, and it shows files under 
src/*/*.vala, I don't know why...

Original comment by albyrock87 on 13 Mar 2011 at 3:15

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch, I'll review ASAP!

I didn't understand the following:

It doesn't show sources in (synapse's) src/*.vala, and it shows files under 
src/*/*.vala, I don't know why...

The project view is not a filesystem kind of view so you should see something 
like:

Target Name 1 (exec o lib)
    +-- Source Name 1
    +-- Source Name 2

Or are you saying the some source file are not visible at all in that view?

Original comment by seje...@gmail.com on 13 Mar 2011 at 3:27

GoogleCodeExporter commented 9 years ago
 Synapse tree is structured like:
src.
...core
.......*.vala
...plugins
.......*.vala
...main.vala
...ui-*.vala

Now core and plugins results in 2 intermediate library that are used by 
main.vala and ui-*.vala
When i open the project i can't see main.vala and ui-*.vala
Why? Is it my fault?

Original comment by albyrock87 on 13 Mar 2011 at 4:47

GoogleCodeExporter commented 9 years ago
I mean : there's no exec target.. 

Original comment by albyrock87 on 13 Mar 2011 at 4:49

GoogleCodeExporter commented 9 years ago
Ok found the bug: sometimes only "_VALASOURCES" is present and not "_SOURCES".

Attached updated patch =)

Original comment by albyrock87 on 14 Mar 2011 at 12:51

Attachments:

GoogleCodeExporter commented 9 years ago
I just committed a fix based on your patch, but now I don't have the time to 
test with your project.

So can you give me some feedback if it works for you too?

P.S.
If you want you can email me your real name for the THANKS file or if you 
prefere I can use your nick. I'm fine with either :)

Original comment by seje...@gmail.com on 14 Mar 2011 at 2:02

GoogleCodeExporter commented 9 years ago
I can confirm that now it works perfectly!

I'll mail you in a few minutes with my real name!
Thank you for your work, vtg helps me a lot!
Also I have Vala 0.11.6 so I can confirm that it works with 0.11.6!

Original comment by albyrock87 on 14 Mar 2011 at 2:16

GoogleCodeExporter commented 9 years ago

Original comment by seje...@gmail.com on 27 Jul 2011 at 11:34

GoogleCodeExporter commented 9 years ago

Original comment by seje...@gmail.com on 27 Jul 2011 at 11:36