Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CUP Eclipse Plugin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr. Michael Petter
CUP Eclipse Plugin
Commits
ef5fa565
Commit
ef5fa565
authored
Nov 28, 2014
by
Johannes Roith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't delete error messages when calling pushtoUIThread multiple times.
parent
c073bc48
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
13 deletions
+25
-13
CupPlugin/src/de/tum/in/www2/cupplugin/controller/DocumentDidChangeJob.java
...um/in/www2/cupplugin/controller/DocumentDidChangeJob.java
+3
-3
CupPlugin/src/de/tum/in/www2/cupplugin/editors/CupEditorErrorReporter.java
...tum/in/www2/cupplugin/editors/CupEditorErrorReporter.java
+22
-10
No files found.
CupPlugin/src/de/tum/in/www2/cupplugin/controller/DocumentDidChangeJob.java
View file @
ef5fa565
...
...
@@ -105,10 +105,10 @@ public class DocumentDidChangeJob extends Job {
if
(
document
==
null
)
return
Status
.
CANCEL_STATUS
;
IFile
file
=
((
FileEditorInput
)
myEditor
.
getEditorInput
()).
getFile
();
CupEditorErrorReporter
errorReporter
=
new
CupEditorErrorReporter
(
file
);
CupEditorErrorReporter
errorReporter
=
new
CupEditorErrorReporter
(
file
);
errorReporter
.
resetOnNextPush
();
CupParser
parser
=
null
;
if
(
jobs
.
contains
(
JobsToDo
.
parseCode
))
{
...
...
CupPlugin/src/de/tum/in/www2/cupplugin/editors/CupEditorErrorReporter.java
View file @
ef5fa565
...
...
@@ -31,14 +31,22 @@ public class CupEditorErrorReporter implements IErrorReporter {
private
IFile
file
;
private
List
<
BufferedMessage
>
lst
=
new
ArrayList
<
BufferedMessage
>();
private
boolean
doResetErrors
;
public
CupEditorErrorReporter
(
IFile
file
)
{
this
.
file
=
file
;
}
public
void
resetOnNextPush
()
{
doResetErrors
=
true
;
}
public
void
pushToUIThread
()
{
List
<
BufferedMessage
>
copy
;
boolean
reset
=
doResetErrors
;
doResetErrors
=
false
;
if
(
lst
.
size
()
<
MAX_DISPLAYED_ERRORS
)
{
copy
=
new
ArrayList
<
BufferedMessage
>(
lst
);
}
else
{
...
...
@@ -59,18 +67,22 @@ public class CupEditorErrorReporter implements IErrorReporter {
lst
.
clear
();
Display
.
getDefault
().
asyncExec
(
new
Runnable
()
{
public
void
run
()
{
IMarker
[]
oldMarkers
;
try
{
oldMarkers
=
file
.
findMarkers
(
CUP_MARKER
,
false
,
10
);
for
(
IMarker
m
:
oldMarkers
)
m
.
delete
();
}
catch
(
CoreException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
// TODO: this only works if we can make sure that asyncExec
// calls are sequential, future pushToUIThread calls
// don't add messages that are deleted here.
if
(
reset
)
{
IMarker
[]
oldMarkers
;
try
{
oldMarkers
=
file
.
findMarkers
(
CUP_MARKER
,
false
,
10
);
for
(
IMarker
m
:
oldMarkers
)
m
.
delete
();
}
catch
(
CoreException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
for
(
BufferedMessage
msg
:
copy
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment