Merge branch 'master' into copy_libs

# Conflicts:
#	JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/.classpath
#	JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/META-INF/MANIFEST.MF
#	JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/build.properties
This commit is contained in:
Michael Uhl 2018-12-19 20:15:30 +01:00
commit 345f0cf14b
7 changed files with 87 additions and 37 deletions

View File

@ -1,23 +1,60 @@
Manifest-Version: 1.0 Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: JavaCompilerPlugin.Plugin Bundle-Name: TypinferenzPlugin
Bundle-SymbolicName: JavaCompilerPlugin.Plugin;singleton:=true Bundle-SymbolicName: TypinferenzPlugin;singleton:=true
Bundle-Version: 0.1.0.qualifier Bundle-Version: 0.1.0.qualifier
Bundle-Vendor: de.dhbwstuttgart Bundle-Vendor: de.dhbwstuttgart
Bundle-ActivationPolicy: lazy Bundle-Activator: typinferenzplugin.Activator
Bundle-ClassPath: .,
bin,
lib
Automatic-Module-Name: JavaCompilerPlugin.Plugin;singleton:=true
Require-Bundle: org.eclipse.ui, Require-Bundle: org.eclipse.ui,
javax.inject,
org.eclipse.core.runtime, org.eclipse.core.runtime,
org.eclipse.jface.text, org.eclipse.jface.text,
org.eclipse.jdt.ui,
org.eclipse.ui.editors, org.eclipse.ui.editors,
org.eclipse.ui.workbench, org.eclipse.ui.workbench,
org.eclipse.core.resources, org.eclipse.core.resources,
org.eclipse.swt,
org.eclipse.osgi,
org.eclipse.jface,
org.eclipse.e4.ui.services,
org.eclipse.e4.ui.workbench,
org.eclipse.e4.ui.di,
org.eclipse.e4.core.di.annotations,
org.eclipse.equinox.p2.core,
org.eclipse.equinox.p2.operations,
org.eclipse.equinox.p2.engine,
org.eclipse.equinox.ds,
org.eclipse.equinox.event,
org.eclipse.equinox.p2.repository;bundle-version="2.3.200",
org.eclipse.equinox.p2.metadata;bundle-version="2.3.100",
org.eclipse.ui.ide, org.eclipse.ui.ide,
org.eclipse.ui.views, org.eclipse.ui.views,
org.eclipse.equinox.ds;visibility:=reexport org.eclipse.equinox.ds; visibility:=reexport
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Provide-Capability: osgi.ee;osgi.ee="JavaSE";version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9" Bundle-ActivationPolicy: lazy
Bundle-Activator: typinferenzplugin.Activator Bundle-ClassPath: .,
lib/animal-sniffer-annotations.jar,
lib/antlr4.jar,
lib/antlr4-runtime.jar,
lib/antlr-runtime.jar,
lib/asm.jar,
lib/bcel.jar,
lib/checker-qual.jar,
lib/commons-io.jar,
lib/error_prone_annotations.jar,
lib/failureaccess.jar,
lib/guava.jar,
lib/icu4j.jar,
lib/j2objc-annotations.jar,
lib/javassist.jar,
lib/JavaTXcompiler.jar,
lib/javax.json.jar,
lib/jsr305.jar,
lib/listenablefuture.jar,
lib/org.abego.treelayout.core.jar,
lib/reflections.jar,
lib/ST4.jar,
bin,
typinferenzplugin
Import-Package: javax.annotation;version="1.2.0"
Automatic-Module-Name: TypinferenzPlugin

View File

@ -2,7 +2,7 @@
<?eclipse version="3.4"?> <?eclipse version="3.4"?>
<plugin> <plugin>
<!-- Jav-Editor: --> <!-- Jav-Editor: -->
<extension <extension
point="org.eclipse.ui.editors"> point="org.eclipse.ui.editors">
<editor <editor
@ -16,19 +16,19 @@
</editor> </editor>
</extension> </extension>
<!-- Marker <!-- Marker
Tutorial dazu: http://cubussapiens.hu/2011/05/custom-markers-and-annotations-the-bright-side-of-eclipse/ Tutorial dazu: http://cubussapiens.hu/2011/05/custom-markers-and-annotations-the-bright-side-of-eclipse/
--> -->
<extension <extension
id="typinferenzplugin.replacemarker" id="typinferenzplugin.replacemarker"
name="TypeReplaceMarker" name="TypeReplaceMarker"
point="org.eclipse.core.resources.markers"> point="org.eclipse.core.resources.markers">
<super type="org.eclipse.core.resources.problemmarker" /> <super type="org.eclipse.core.resources.problemmarker" />
<super type="org.eclipse.core.resources.textmarker" /> <super type="org.eclipse.core.resources.textmarker" />
</extension> </extension>
<!-- Src: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_ui_editors_annotationTypes.html --> <!-- Src: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_ui_editors_annotationTypes.html -->
<extension <extension
point="org.eclipse.ui.editors.annotationTypes"> point="org.eclipse.ui.editors.annotationTypes">
<type <type
name="typinferenzplugin.annotation" name="typinferenzplugin.annotation"
@ -69,8 +69,8 @@
</specification> </specification>
</extension> </extension>
<!-- ExtensionPoint für die QuickFixes der ReplaceMarker Quelle: http://wiki.eclipse.org/FAQ_How_do_I_implement_Quick_Fixes_for_my_own_language%3F --> <!-- ExtensionPoint für die QuickFixes der ReplaceMarker Quelle: http://wiki.eclipse.org/FAQ_How_do_I_implement_Quick_Fixes_for_my_own_language%3F -->
<extension point="org.eclipse.ui.ide.markerResolution"> <extension point="org.eclipse.ui.ide.markerResolution">
<markerResolutionGenerator <markerResolutionGenerator
markerType="typinferenzplugin.replacemarker" markerType="typinferenzplugin.replacemarker"
class="typinferenzplugin.marker.QuickFixer"/> class="typinferenzplugin.marker.QuickFixer"/>

View File

@ -38,7 +38,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ür .jav-Dateien * Editor für .jav-Dateien
* Anmerkung: Für jede geÃffnete Datei wird eine Instanz des Editors erstellt * Anmerkung: Für jede geöffntete Datei wird eine Instanz des Editors erstellt
* @author janulrich * @author janulrich
* *
*/ */
@ -115,7 +115,7 @@ public class JavEditor extends TextEditor{
}catch(TypeinferenceException texc){ }catch(TypeinferenceException texc){
markers.add(new ErrorMarker(texc.getMessage(),new CodePoint(texc.getOffset()))); markers.add(new ErrorMarker(texc.getMessage(),new CodePoint(texc.getOffset())));
} }
//Anschließend die TypeReplaceMarker im Quellcode anzeigen: https://stackoverflow.com/questions/8945371/how-to-implement-quick-fix-quick-assist-for-custom-eclipse-editor //Anschließend die TypeReplaceMarker im Quellcode anzeigen: https://stackoverflow.com/questions/8945371/how-to-implement-quick-fix-quick-assist-for-custom-eclipse-editor
System.out.println("Typinferez durchgeführt. Berechnete Marker:\n"+markers); System.out.println("Typinferez durchgeführt. Berechnete Marker:\n"+markers);
IResource activeDocument = extractResource(); IResource activeDocument = extractResource();
@ -182,7 +182,7 @@ public class JavEditor extends TextEditor{
} }
/** /**
* LÃscht die zu marker gehÃrende Annotation * Löscht die zu marker gehörende Annotation
* @param marker * @param marker
*/ */
private void deleteAnnotation(JavMarker marker){ private void deleteAnnotation(JavMarker marker){
@ -211,7 +211,7 @@ public class JavEditor extends TextEditor{
/** /**
* Diese Funktion führt einen ReplaceMarker aus. * Diese Funktion führt einen ReplaceMarker aus.
* @param typeReplaceMarker * @param typeReplaceMarker
*/ */
public void runReplaceMarker(TypeReplaceMarker typeReplaceMarker) { public void runReplaceMarker(TypeReplaceMarker typeReplaceMarker) {
@ -239,7 +239,7 @@ public class JavEditor extends TextEditor{
/** /**
* Aktualisiert die OutlinePage, falls vorhanden. * Aktualisiert die OutlinePage, falls vorhanden.
* Muss nach Ãnderungen an markers aufgerufen werden. * Muss nach Änderungen an markers aufgerufen werden.
*/ */
private void updateOutlinePage() { private void updateOutlinePage() {
if(this.outlinePage!= null && this.sourceFile != null && this.errorMarkers != null) if(this.outlinePage!= null && this.sourceFile != null && this.errorMarkers != null)
@ -255,7 +255,7 @@ public class JavEditor extends TextEditor{
} }
/** /**
* Ermittelt die momentan an dem Dokument, für welches dieser Editor zuständig ist, angebrachten TypeReplaceMarker. * Ermittelt die momentan an dem Dokument, für welches dieser Editor zuständig ist, angebrachten TypeReplaceMarker.
* Dabei werden die ReplaceMarker herausgefiltert, welche mindestens einen Typ an dem übergebenen offset einsetzen. * Dabei werden die ReplaceMarker herausgefiltert, welche mindestens einen Typ an dem übergebenen offset einsetzen.
* @param offset * @param offset
* @return * @return

View File

@ -14,6 +14,7 @@ import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ContentAssistant; import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.ContextInformation; import org.eclipse.jface.text.contentassist.ContextInformation;
import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContentAssistant; import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.contentassist.IContextInformation; import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.presentation.IPresentationReconciler; import org.eclipse.jface.text.presentation.IPresentationReconciler;
@ -44,8 +45,9 @@ public class JavViewerConfiguration extends SourceViewerConfiguration {
private JavEditor editor; private JavEditor editor;
public JavViewerConfiguration(JavEditor parentEditor){ public JavViewerConfiguration(JavEditor editor){
super(); super();
this.editor = editor; this.editor = editor;
} }
@ -125,6 +127,16 @@ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceVie
ret.setInformationControlCreator(getInformationControlCreator(sourceViewer)); ret.setInformationControlCreator(getInformationControlCreator(sourceViewer));
return ret; return ret;
} }
@Override
public IContentAssistant getContentAssistant(ISourceViewer sv) {
ContentAssistant ca = new ContentAssistant();
IContentAssistProcessor pr = new JafCompletionProcess();
ca.setContentAssistProcessor(pr, IDocument.DEFAULT_CONTENT_TYPE);
ca.setInformationControlCreator(getInformationControlCreator(sv));
return ca;
}
} }

View File

@ -17,7 +17,7 @@
</license> </license>
<plugin <plugin
id="JavaCompilerPlugin.Plugin" id="TypinferenzPlugin"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"

View File

@ -1,8 +1,7 @@
<project> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.dhbwstuttgart</groupId>
<artifactId>JavaCompilerPlugin</artifactId> <artifactId>JavaCompilerPlugin</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<parent> <parent>
<groupId>de.dhbwstuttgart</groupId> <groupId>de.dhbwstuttgart</groupId>

View File

@ -7,8 +7,10 @@
<properties> <properties>
<tycho.version>1.2.0</tycho.version> <tycho.version>1.2.0</tycho.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<eclipse-repo.url>http://download.eclipse.org/releases/oxygen</eclipse-repo.url> <eclipse-repo.url>http://download.eclipse.org/releases/oxygen</eclipse-repo.url>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</properties> </properties>
<repositories> <repositories>