ErrorMarker verschwinden jetzt wieder.
This commit is contained in:
parent
8f588df670
commit
d7c9247a27
@ -1,13 +1,7 @@
|
|||||||
package typinferenzplugin;
|
package typinferenzplugin;
|
||||||
|
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
import org.eclipse.core.resources.IMarker;
|
|
||||||
import org.eclipse.jface.text.IDocument;
|
|
||||||
import org.eclipse.jface.text.source.Annotation;
|
import org.eclipse.jface.text.source.Annotation;
|
||||||
|
|
||||||
import typinferenzplugin.editor.JavEditor;
|
|
||||||
|
|
||||||
public class ErrorMarker extends JavMarker{
|
public class ErrorMarker extends JavMarker{
|
||||||
|
|
||||||
private String message;
|
private String message;
|
||||||
@ -36,7 +30,6 @@ public class ErrorMarker extends JavMarker{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getPositionInCode() {
|
public int getPositionInCode() {
|
||||||
return point.getPositionInCode();
|
return point.getPositionInCode();
|
||||||
@ -52,10 +45,4 @@ public class ErrorMarker extends JavMarker{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setAnnotation(Annotation addAnnotation) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,10 @@ import static org.eclipse.core.runtime.IStatus.ERROR;
|
|||||||
import static typinferenzplugin.Activator.PLUGIN_ID;
|
import static typinferenzplugin.Activator.PLUGIN_ID;
|
||||||
import static java.util.Collections.singletonList;
|
import static java.util.Collections.singletonList;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
@ -51,7 +53,7 @@ import typinferenzplugin.error.ErrorOutput;
|
|||||||
|
|
||||||
//Example from: http://help.eclipse.org/indigo/index.jsp
|
//Example from: http://help.eclipse.org/indigo/index.jsp
|
||||||
/**
|
/**
|
||||||
* Editor f<EFBFBD>r .jav-Dateien Anmerkung: Für jede ge<EFBFBD>ffntete Datei wird eine
|
* Editor für .jav-Dateien Anmerkung: Für jede ge<EFBFBD>ffntete Datei wird eine
|
||||||
* Instanz des Editors erstellt
|
* Instanz des Editors erstellt
|
||||||
*
|
*
|
||||||
* @author janulrich
|
* @author janulrich
|
||||||
@ -124,7 +126,6 @@ public class JavEditor extends TextEditor implements UnifyResultListener {
|
|||||||
private void typeReconstruction() {
|
private void typeReconstruction() {
|
||||||
Job job = Job.create("Doing type recoustruction...", (ICoreRunnable) monitor -> {
|
Job job = Job.create("Doing type recoustruction...", (ICoreRunnable) monitor -> {
|
||||||
// do something long running
|
// do something long running
|
||||||
Vector<JavMarker> markers = new Vector<JavMarker>();
|
|
||||||
if (!this.typeReplaceMarkers.isEmpty() || !this.errorMarkers.isEmpty()) {
|
if (!this.typeReplaceMarkers.isEmpty() || !this.errorMarkers.isEmpty()) {
|
||||||
LOG.log(new Status(ERROR, PLUGIN_ID,
|
LOG.log(new Status(ERROR, PLUGIN_ID,
|
||||||
"Fehler: Zuerst Marker löschen, bevor Typinferenz durchgeführt werden kann"));
|
"Fehler: Zuerst Marker löschen, bevor Typinferenz durchgeführt werden kann"));
|
||||||
@ -134,10 +135,10 @@ public class JavEditor extends TextEditor implements UnifyResultListener {
|
|||||||
try {
|
try {
|
||||||
typeinference.run(this);
|
typeinference.run(this);
|
||||||
} catch (TypeinferenceException texc) {
|
} catch (TypeinferenceException texc) {
|
||||||
//markers.add(new ErrorMarker(texc.getMessage(), new CodePoint(texc.getOffset())));
|
ErrorMarker errorMarker = new ErrorMarker(texc.getMessage(), new CodePoint(texc.getOffset()));
|
||||||
this.placeMarkers(extractResource(), singletonList(new ErrorMarker(texc.getMessage(), new CodePoint(texc.getOffset()))));
|
this.errorMarkers.add(errorMarker);
|
||||||
|
this.placeMarkers(extractResource(), singletonList(errorMarker));
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Start the Job
|
// Start the Job
|
||||||
|
@ -31,13 +31,6 @@
|
|||||||
<groupId>org.antlr</groupId>
|
<groupId>org.antlr</groupId>
|
||||||
<artifactId>antlr4</artifactId>
|
<artifactId>antlr4</artifactId>
|
||||||
<version>4.7</version>
|
<version>4.7</version>
|
||||||
<!--exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.antlr</groupId>
|
|
||||||
<artifactId>antlr-runtime</artifactId>
|
|
||||||
<version>3.5.2</version>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions-->
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
@ -143,43 +136,6 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.eclipse.tycho</groupId>
|
|
||||||
<artifactId>target-platform-configuration</artifactId>
|
|
||||||
<version>${tycho.version}</version>
|
|
||||||
<configuration>
|
|
||||||
<pomDependencies>consider</pomDependencies>
|
|
||||||
|
|
||||||
<environments>
|
|
||||||
<environment>
|
|
||||||
<os>linux</os>
|
|
||||||
<ws>gtk</ws>
|
|
||||||
<arch>x86</arch>
|
|
||||||
</environment>
|
|
||||||
<environment>
|
|
||||||
<os>linux</os>
|
|
||||||
<ws>gtk</ws>
|
|
||||||
<arch>x86_64</arch>
|
|
||||||
</environment>
|
|
||||||
<environment>
|
|
||||||
<os>win32</os>
|
|
||||||
<ws>win32</ws>
|
|
||||||
<arch>x86</arch>
|
|
||||||
</environment>
|
|
||||||
<environment>
|
|
||||||
<os>win32</os>
|
|
||||||
<ws>win32</ws>
|
|
||||||
<arch>x86_64</arch>
|
|
||||||
</environment>
|
|
||||||
<environment>
|
|
||||||
<os>macosx</os>
|
|
||||||
<ws>cocoa</ws>
|
|
||||||
<arch>x86_64</arch>
|
|
||||||
</environment>
|
|
||||||
</environments>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
Loading…
Reference in New Issue
Block a user