SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: Musenka on March 31, 2008, 11:04:40 pm

Title: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: Musenka on March 31, 2008, 11:04:40 pm
Hello.
I have downloaded SlickEdit 2008 trial and discovered some problem with new "Message List".
When I build my project in SlickEdit using Visual Studio 2005 C++ compiler, warnings and errors are correctly displayed in the "Build" window. No any problems in output. Error parsing using message patterns works OK ("Build -> Configure Error Parsing" as in old good SlickEdit 2007). But new "Message List" does not catch ANY messages from "Build". I was not able to transfer any of my build messages to "Message List" although MS VC++ compiler/builder generated many messages of different types...
I did not find anything helpful in SE 2008 documentation.
How can I debug the issue? How can I trace message capturing (MS VC++ compiler/builder --> "Build" --> "Message List" )?
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: LBCEi on March 31, 2008, 11:14:38 pm
I'm seeing the same problem in a VS2003 project.
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: Musenka on April 01, 2008, 03:25:17 pm
So is this really nice feature really working? (in general  ;D...)
Has anyone used "Message List" with MS Visual C++ (2003/2005) without problems?
Maybe, we have some Microsoft Specific Problem here  ;)
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: Nathan on April 01, 2008, 09:23:41 pm
Hey guys,

Matthew and I have been looking at this today. It turns out that right now post-build functions are only used when our own build system, vsbuild, is being used. In this case vsbuild is not being used, MS's devenv is.

I'll talk to a few of the other developers to see if we can come up something that can work to do post-build actions 'most of the time', instead of 'never'.

In the meanwhile, you can manually get the error markers to come up by calling 'set_error_markers' from the command line.

Nathan
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: hs2 on April 01, 2008, 09:34:30 pm
Oh no ... this is a long standing request that the build system is enhanced in exactly this way w/o the 'dirty' tricks using injected macro calls to trigger the error parser incl. markers sync'd to the end of a custom build tool execution.
BTW: I still didn't get an answer to my question if there IS another (more safe) method than echoing <binary 1> to inject macro calls from an external script.
HS2
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: Musenka on April 03, 2008, 03:00:30 pm
OK.
'set_error_markers' command works as expected: updates the message list. But manual invoking is not very comfortable...
Is there any simple way to catch 'switching to Message List windows' event like '_switchbuf_...'? ('_switchbuf_...' works fine and I use it to automatically highlight current file in the projects tree http://community.slickedit.com/index.php?topic=3038.msg12793#msg12793 (http://community.slickedit.com/index.php?topic=3038.msg12793#msg12793)). Something like writing '_switch?????_...' procedure and checking if we are in Message List now (in this procedure's body). When we are in Message List, we can invoke all commands we need. The solution is not elegant and 100% clean, of course.
Maybe there is some other simple way  ???... before the problem is solved in general (by SE developers).
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: Nathan on April 03, 2008, 03:26:53 pm
Alrighty, we have a better workaround for now:

1) Go to Project > Project Properties... > Tools.
2) Select "Build" in the list of tools.
3) Check "Beep on completion"

Bizarre. But it works if you can live with a beep.

We'll be looking into using the same mechanism used for beeping for everything else that needs to run post-build.

Let me know if that doesn't work for you.
Nathan
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: hs2 on April 03, 2008, 03:31:13 pm
Sorry - didn't try my real life projects with v13 yet.
Is it now possible to run post-build commands for any build tool (sync'd to the finish of it) ?
That would be really great !
HS2
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: Nathan on April 03, 2008, 04:09:09 pm
I can *almost* guarantee that the bell hack will work for any build tool, but compile.e is full of some hairy code.

The important thing is that something calls _vsbuild_signal_init() to set up the necessary timers, etc. This is done directly if the project is using vsbuild, or by the AddVSBuildToCommandLine() function in other cases.

AddVSBuildToCommandLine() should be called if you turn on the bell, or if you ask for Verbose output (the checkbox above "Beep on completion").

Give the bell a shot when you have the time and hopefully it will work.
Nathan

Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: Musenka on April 04, 2008, 09:53:28 pm
Yes, the bell works fine  :D
Thank you.
Very interesting solution!
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: chrisant on June 05, 2008, 11:48:03 pm
The "beep on completion" workaround doesn't appear as if it's going to work for me:

I have only one tool in my project:

I do not have a Compile tool, and given the way this build system works, I'm not even sure what I would make it do.
Without "beep on completion" checked for the Build tool, no errors show up in the Message List.
When I check "beep on completion", then the tool doesn't run -- it says this in the Build window:
Quote
C:\off\dev14\csi>c:\slick\win\vsbuild build -b C:\off\dev14\csi\coauth\coauth\CoAuthUncProv.cpp -beep C:\off\dev14\Office.vpw C:\off\dev14\csi\Csi.vpj -signal 9009
Command 'compile' not defined in project file 'C:\off\dev14\csi\Csi.vpj'

I don't have a "compile" command.  Nor can vsbuild be expected to figure out dependencies.  Furthermore, I want to build everything recursively from %rp, but "beep on completion" seems to make it want to build a single .cpp file.

Is there some other way I can get the errors to show up in the Message List properly?

Is a real fix coming in 13.0.1?

Thanks!
C
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: Lee on June 06, 2008, 12:31:27 pm
We have worked on this for the upcoming 13.0.1 release, it should work any for all build tools commands without any of the previously used workarounds to get both message list reporting and error-markers in buffers.
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: hs2 on June 06, 2008, 01:12:53 pm
Great ! Can't wait for v13.0.1 ...
HS2
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: chrisant on June 06, 2008, 06:49:30 pm
Awesome, thanks, Lee!
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: mrothman on June 24, 2008, 08:03:58 pm
I've got 13.0.1 and this still seems flaky (but maybe I'm doing something wrong?)

I have a tool in the build menu (let's call it "foo").  I created my own Error Regular Expression to parse foo's output, which works nicely (and which incidentally includes a Macro added to the ErrorRE.xml file, as described in error.e).  When I run "foo" from the build menu, the first line of output says it's using vsbuild.  The errors can be parsed and followed correctly if I double click on them in the build toolbar.  But nothing shows up in the message list.

If I run set-error-markers, boom, they are all there.

Only other wrinkle - it was working without the call to set-error-markers for a few tries earlier today. I am of course scratching my head trying to figure out what might have changed.  Only thing I can remember doing is adding a context menu for the file type which is input for "foo", and that menu can also run foo by calling a macro which calls

execute('project_usertool foo')

However, I don't see how this could have much to do with it - and in any case, it doesn't work either when called directly from the build menu or from the context menu.  However, I will try removing the context menu, but I think that's a red herring...
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: Lee on June 24, 2008, 08:48:45 pm
I'll look into it, I've tested this with examples similar to what you describe, and it works correctly on my end.  Any more info or reproducible samples you can post/send will be helpful.  Were you still using any of the previous workarounds or have any advanced settings enabled for the build tool?  What output are you seeing in the Build window?   As a test, does it start working again if you restart the editor? 
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: mrothman on June 26, 2008, 01:40:50 am
Well, on top of everything else, I'm having a lot of trouble posting a response to Lee's help.  I get an http 501 error every time, from several machines at work, and my home machine.  Sigh... I'm going to try to post it in several pieces.

Thanks for checking into this Lee.  It worked for a while again this morning, but now it has stopped working again.  The only thing I can remember doing in the interim is re-ordering the error parsing expressions in the "Error Regular Expressions" dialog.  That caused it to use the wrong expression to parse my errors until I figured out what was going on, but I turned off the offending expression and now it's using mine again.  Yes, I have restarted SlickEdit since then (several times).

 Here's some more information:
1) I was not using any of the workarounds, as I didn't upgrade to 13 until 13.0.1 was available.  Nothing special in the build tool - I have enabled capture output, output to build window and clear build window.  I have NOT enabled build first, command is slick-c macro or run in x terminal.  Verbose output and beep on completion are grayed out and not selected.
2) Here are my error regular expression, the macro function that I am running to find the file name, and the output from a sample run of the tool.

Here's the error expression:
^:p\:{#1:i}\:{#3?+}$

A clarification: you will note in the error output (next post) that the tool actually DOES print out the file name at the beginning of each line.  However, it does so in a way which is relative to it's own idea of where in the build tree it's processing from. So, there's no consistent way to figure out how to prepend the complete path to the file.  That's why I went with the solution of using a macro to search for the complete path, which the tool prints out just before processing each file.
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: mrothman on June 26, 2008, 01:46:29 am
And here's the output:

[...src/services/io] /mathworks/home/mrothman/apps/slickedit/bin/vsbuild -command "sbcc -l /sandbox/mrothman/Amvm/matlab/src/services/io/MLStringSink.cpp"
VSLICKERRORPATH=/mathworks/devel/sandbox/mrothman/Amvm/matlab/src/services/io
sbcc -l /sandbox/mrothman/Amvm/matlab/src/services/io/MLStringSink.cpp
Configuring setmwe for sandbox, '/mathworks/devel/sandbox/mrothman/Amvm'
gmake: Entering directory `/mathworks/devel/sandbox/mrothman/Amvm/matlab/src/services'

sbcc-start: --- /sandbox/mrothman/Amvm/matlab/src/services/io/MLStringSink.cpp ---

io/MLStringSink.cpp: lint in RELEASE mode (tip: sbcc -lintmsg NUM)
FlexeLint for C/C++ (Unix)FlexeLint (Linux) Vers. 8.00w, Copyright Gimpel Software 1985-2007
--- Module:   io/MLStringSink.cpp (C++)
io/MLStringSink.cpp:26:<Note#1932> Base class 'MLSinkBase' is not abstract -- More Effective C++ #33
gmake: Leaving directory `/mathworks/devel/sandbox/mrothman/Amvm/matlab/src/services'

-- sbcc summary -----------
Total lint messages    : 1

Finally, I wanted to post the macro, but for some reason that is what is giving the http server issues!  Instead, I'm attaching it as a file.
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: Lee on June 26, 2008, 02:48:51 pm
Something is failing in the setup for vsbuild, there should be -signal option in the command-line.  vsbuild and SlickEdit use a socket for inter-process communication on localhost (127.0.0.1) and port number 9009.  If the -signal option was left off, that means the SlickEdit wasn't able to open the socket.  This could be a platform issue or just something dumb in the macro code, I'll need to investigate this further to find out.  You could try changing the port number, Macro > Set Macro Variable or set-var on the command-line: def_vsbuild_signal_port.   I'm also curious if it starts working after rebooting your system.

I'm guessing from the output your a Linux user, what distro are you using?
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: mrothman on June 26, 2008, 04:55:16 pm
Changed the port number, now the -signal appears in the vsbuild line, and things are fine.  Of course, they were fine yesterday for a while also...  But I'm hopeful

I will check with our systems people to see if 9009 happens to be used for something in house.

As far as distro, I'm running Debian.  I'm no linux expert, but here's what cat /proc/version outputs:

Linux version 2.6.22.8-mw017 (root@bat1826glnxa64) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP Tue Sep 25 13:15:57 EDT 2007

Thanks for your continuing help!  One more thing, since you are obviously the expert in this area.  I posted this question over on the slick c board, but I'll ask you too.  Is there someway to get the message list to be reparsed from what's in the build window?  I note that anytime I run ANYTHING in the build window, even "ls", the message list is de-populated, and the next-error stuff thinks there are no errors if I try to navigate to errors in the build window.  This means if I want to (for example) use our (sigh) in-house version control to check out a file to fix an error, I have to avoid using the build window command line.  Otherwise, in effect I lose all my error output.

Thanks!

P.S. One other thing occurs to me - I routinely do all my linux work by vnc-ing into my server.  Any chance that could be affecting the port issue?  (You can see I'm not a linux expert...)
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: Lee on June 26, 2008, 06:52:59 pm
Hoping that it's just a port conflict, that's easy enough to workaround.  I've definitely confirmed that the message list and error markers are being cleared when entering commands in the Build window, I have been asked to look into it.  In the command process_enter (in macros/stdcmds.e), there is an explicit call to reset_next_error.  That *probably* doesn't need to be there, unless you plan on calling grep or directly invoking your build tools in Build window.  But even then, there's no callback handler for re-parsing the message list in that case, so it's probably safe to remove.  It's on my task list when I get the chance, it does need to be addressed.  It's small enough that you can make the change on your own for now if you'd like, barring any future hotfixes to stdcmds.e in this release.
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: mrothman on June 26, 2008, 07:29:51 pm
A hero point for Lee!  Great stuff.
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: hs2 on June 29, 2008, 04:09:36 pm
@Lee: ??? When I'm saving stdcmds.e with 'strip traing spaces = ON' (my Files default) I get an error on loading another module which imports 'stdcmds.e':
error msg: illegal character
here:
stdcmds.e - _GetLanguageSetupOptions() [line 10398]:
Code: [Select]
      'WW='word_wrap_style ',' 'IWT='indent_with_tabs ','\
Weird, isn't it ?
This also happens with stock macro modules. Example: strip trailing spaces in stdcmds.e, modify cbrowser.e and try to reload it.
Strange enough stdcmds.e itself loads w/o error (as it should).
If I leave all trailing spaces untouched and just apply your patch it works.

Could you please clarify what's going on here ?
HS2
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: chrisant on June 29, 2008, 07:28:56 pm
I noticed this a month or two ago (I think 13.0.0, but it might have even been 12.0.3, I don't remember for sure).

It happened to me after I added about 20 lines of code to stdcmds.e.  Then compiling other macros that #import it caused stdcmds.e to get an "invalid character" error in the middle of a statement concatenating a long string together (same one hs2 is seeing, I think).  I reduced the total number of characters that I had added to stdcmds.e and eventually it started working.  I assumed that there is some kind of size limit that's being hit and leading to the "invalid character" error, but it was only a guess and I didn't have a solid repro so I didn't report it.

For comparison, I do not have 'strip trailing spaces' on.  But I do have a macro that strips trailing spaces only from modified lines (I work in large codebases with lots of people, and we do not want to perturb the sources unnecessarily, especially since it leads to unnecessary merge conflicts).
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: hs2 on June 29, 2008, 09:20:11 pm
Seems an '#import' specific problem... However, it's really annoying since modifying a module (also my own while migrating or later on) may lead to this unexpected and misleading error. No chance to find the problem in a systematic way :(

@chrisant: Besides that everybody should be forced to use spaces, strip the trailing ones and to use a decent diff/merge tool capable to ignore 'unimportant changes' ;) - could you please share your 'strip_trailing_spaces_from_modified_lines_only()' macro ? I afraid I need it in a new project due to various reasons and I don't want to reinvent the wheel. Thanks !

HS2
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: chrisant on June 30, 2008, 12:43:02 am
Here's the trouble with having the merge tool ignore the spaces...  I was personally involved in finding that flaw in three major source control systems.  One of them was obsolete, another realized the underlying math flaw in ignoring spaces during a merge and immediately hotfixed it, and the other source control system I was in charge of so of course we immediately hotfixed it too.  :P

When merging Base + Theirs + Yours the merge computes diffs between Base vs Theirs and between Base vs Yours.  It then aligns the two sets of diffs.  Where they intersect it is considered a conflict.  Where they do not intersect an automatic choice is made whether to keep the set of modified lines in Theirs or in Yours.

But if spaces are ignored then there are two problems that occur.

1.  A cosmetic problem:  by ignoring spaces, the merge will not merge changes that occur in spaces.  So for example, suppose the Theirs copy has indented a chunk of lines, but the Yours file has made a non-space functional change.  If spaces are ignored, then it appears that Theirs has no changes.  So, the result of the merge will either lose the indentation completely, or it will preserve the indentation on most lines but lose the indentation on the lines modified in the Yours file.  The natural reaction is to look for heuristic band-aids to apply to "nudge" the merge results to be what we desire for certain specific scenarios.  The risk in doing so is that each heuristic can have a ripple effect to cause some seemingly unrelated other scenario to begin to go awry.  It's dangerous to apply heuristics (case in point, ignoring spaces has at least two ripple effects).

2.  Silent removal/duplication of code:  ignoring spaces can perturb the Longest Common Subsequence (LCS) found between Base vs Theirs and between Base vs Yours.  The LCS's may be perturbed in such a way that two changes that would otherwise be in conflict do not get interpreted as intersecting.  This can then lead to silent removal or duplication of changes.  I use words like "can" and "may" because it does not always happen, but it can/may/does happen sometimes.  It's silent.

There are probably merge papers on the interwebs that go into more detail about these types of issues, but that's the basic idea.  I would say that hypothetically it should be possible to build a set of heuristics that check and balance and influence each other to arrive at consistently desirable results.  The hitch is that it's not safe to see an issue and devise a heuristic for that specific issue alone -- there are too many unseen scenarios that are easily perturbed by ripple effects.  It's a field that could use some intense academic research.

Anyways:

Here is a link to where I posted the macro (http://community.slickedit.com/index.php?topic=3088.0).
Title: Re: SlickEdit 2008 (trial version): "Message List" feature problems...
Post by: hs2 on June 30, 2008, 08:26:41 am
Thanks for the interesting background information chrisant !
As usual things are sometimes much more complicated behind the scenes...
I was only aware of a few of the more obvious issues. I thought that at least ignoring trailing whitespaces should be save to do. Leading whitespaces can't be always ignored e.g. when dealing with makefiles. And of course I don't ignore whitespaces within code lines. However, thanks for re-sharing the macro :) I knew that there was already a discussion about that...

@SlickTeam: Do you think that it's a useful feature to add a 3rd value for 'strip trailing spaces' == 'restrict to new/modified lines' ?

HS2