jEdit Community - Resources for users of the jEdit Text Editor
Using addError & addExtraMessage - the ErrorList plugin API
Submitted by PaulCollingwood on Friday, 20 April, 2007 - 20:40
I have been using jEdit alongside the Microsoft Visual C++ IDE (MSDEV) application for quite some time now, whilst writing embedded apps simulations PCs hosting XP.
Some time ago I bolted together a support tool that detected compilation log creation (.plg files generated by MSVC when compiling C/C++ projects) and then opened and parsed the errors & warnings.
From this data a bsh script file is generated, an then executed by jEdit to populate the ErrorList plugin's window accordingly.
So I can compile within another IDE, but edit and correct code within jEdit. Quite handy.
I later extended this tool to collate PC-Lint analysis results (also invoked within the IDE) in the same manner.

A typical example of the bsh file generated by the tool is as follows (I have only included a single addError invocation, but this is enough to demonstrate the script format):

//-----------------------------------------------------

import org.gjt.sp.jedit.*;
import org.gjt.sp.util.*;
import org.gjt.sp.jedit.gui.OptionsDialog;
import org.gjt.sp.jedit.msg.*;
import java.io.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import errorlist.*;
import java.util.*;
import gnu.regexp.*;
import console.*;

void run()
{
void log_errors()
{
errorlist.DefaultErrorSource errsrc;
errsrc = new errorlist.DefaultErrorSource("MSVC");
errorlist.ErrorSource.registerErrorSource(errsrc);
jEdit.getAction("error-list-clear").invoke(null);

errsrc.addError(ErrorSource.ERROR, "C:\\my_projects\\hw_if\\control\\ctrlapi.c",944,0,0,"LNT787: (Info -- enum constant 'DTV_PL_ASIG_AV_IP1_AUDIO' not used within switch)");

errsrc = null;
}

if(jEdit.getLastView() == null)
VFSManager.runInAWTThread(this);
else
log_errors();
}

run();

//-----------------------------------------------------

The problem I have here is that I wish to extend some of the messages in the plugin output to be multi-line, but I cannot see how to use the addExtraMessage method with the preceding code - can anybody explain how I would modify my bsh script output to permit this?

PS - if anyone else out there running a Windows OS also wants to generate errors/warnings in jEdit from externally generated files, then let me know!
User login
Browse archives
« April 2024  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82347
Context Free Art (*.cfdg)   0.31   46055
JBuilder scheme   .001   18494
BBEdit scheme   1.0   18115
ColdFusion scheme   1.0   18023
R Edit Mode - extensive version   0.1   17472
Advanced HTML edit mode   1.0   16205
Matlab Edit Mode   1.0   16067
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14292