Commit 9985222f authored by Daniel Endreß's avatar Daniel Endreß

Added feature to only call the gdsl compiler on save. Removed Compiler preference page.

parent f52c633a
......@@ -253,6 +253,9 @@
class="gdsl.plugin.ui.GDSLExecutableExtensionFactory:org.eclipse.xtext.builder.IXtextBuilderParticipant">
</participant>
</extension>
<!--
Commented out to remove compiler pages.
These specify settings for code generation.
<extension
point="org.eclipse.ui.preferencePages">
<page
......@@ -277,6 +280,7 @@
<filter name="projectNature" value="org.eclipse.xtext.ui.shared.xtextNature"/>
</page>
</extension>
-->
<!-- Quick Outline -->
<extension
......
......@@ -19,7 +19,7 @@ public class GDSLPluginPreferences {
public static final boolean D_ENABLE_COMPILER = false;
public static final String D_COMPILER_INVOCATION = "./build/gdslc";
public static final boolean D_USE_TYPECHECKER = true;
public static final int D_ITERATION_TYPECHEKCER = 10;
public static final int D_ITERATION_TYPECHEKCER = 8;
public static boolean getCompilerEnablement() {
return getPreferenceStore().getBoolean(P_ENABLE_COMPILER, D_ENABLE_COMPILER);
......
......@@ -124,9 +124,8 @@ public class GDSLCompilerTools {
private static void setMarkers(final GDSLError[] errors) {
for (final GDSLError e : errors) {
final IResource resource = e.resource;
IMarker marker;
try {
marker = resource.createMarker(IMarker.PROBLEM);
final IMarker marker = resource.createMarker(IMarker.PROBLEM);
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
marker.setAttribute(IMarker.LINE_NUMBER, e.line);
marker.setAttribute(IMarker.CHAR_START, e.charStart);
......
......@@ -69,6 +69,14 @@ class GDSLValidator extends AbstractGDSLValidator {
@Check
def checkExternalCompiler(Model model){
val resource = model.eResource
if(!resource.trackingModification){
// Set tracking modification to track whether the file has been modified
resource.setTrackingModification(true)
}
if(resource.modified){
return //Do not validate if changes not saved
}
val projectPath = GDSLProjectProperties.obtainProject(resource).location
val workspaceRoot = ResourcesPlugin.workspace.root
......
......@@ -106,6 +106,15 @@ public class GDSLValidator extends AbstractGDSLValidator {
@Check
public void checkExternalCompiler(final Model model) {
final Resource resource = model.eResource();
boolean _isTrackingModification = resource.isTrackingModification();
boolean _not = (!_isTrackingModification);
if (_not) {
resource.setTrackingModification(true);
}
boolean _isModified = resource.isModified();
if (_isModified) {
return;
}
IProject _obtainProject = GDSLProjectProperties.obtainProject(resource);
final IPath projectPath = _obtainProject.getLocation();
IWorkspace _workspace = ResourcesPlugin.getWorkspace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment