Skip to content

Commit

Permalink
Merge 972fa95 into 2730859
Browse files Browse the repository at this point in the history
  • Loading branch information
PalumboN committed Mar 26, 2019
2 parents 2730859 + 972fa95 commit 2366d1d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class WollokTypeSystemBuilderParticipant implements IXtextBuilderParticipant {
override build(IBuildContext context, IProgressMonitor monitor) throws CoreException {
val project = context.builtProject
val wollokActivator = WollokActivator.getInstance

// Setting default severity from preferences
WollokTypeSystemActivator.^default.setDefaultValuesFor(project)

Expand All @@ -48,11 +48,11 @@ class WollokTypeSystemBuilderParticipant implements IXtextBuilderParticipant {
listenersInitialized = true
}

context.loadAllResources
val wollokFiles = context.resourceSet.resources.filter[isWollokUserFile].toList

WollokTypeSystemActivator.^default.ifEnabledFor(project) [
// First add all Wollok files to the type system for constraint generation
context.loadAllResources

val wollokFiles = context.resourceSet.resources.filter[isWollokUserFile].toList
log.debug("Infering types for files: " + wollokFiles.map[it.URI.lastSegment])

val ts = it as ConstraintBasedTypeSystem
Expand All @@ -70,16 +70,17 @@ class WollokTypeSystemBuilderParticipant implements IXtextBuilderParticipant {
log.fatal("Type inference failed", e)
}

// Refreshing views - markers (problems tab), then outline and finally active editor
wollokFiles.forEach [
wollokActivator.generateIssues(it)
wollokActivator.refreshTypeErrors(project, it, monitor)
]

wollokActivator.refreshOutline
wollokActivator.refreshErrorsInEditor
]

// Refreshing views: markers (problems tab), then outline and finally active editor
wollokFiles.forEach [
wollokActivator.generateIssues(it)
wollokActivator.refreshMarkers(project, it, monitor)
]
wollokActivator.refreshOutline
wollokActivator.refreshErrorsInEditor

}

def isWollokUserFile(Resource it) { IFile !== null && IFile.isWollokExtension && !isCoreLib }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import org.eclipse.xtext.validation.IResourceValidator
import org.eclipse.xtext.validation.Issue
import org.osgi.framework.BundleContext
import org.uqbar.project.wollok.ui.editor.WollokTextEditor
import org.uqbar.project.wollok.ui.preferences.WollokDynamicDiagramPreferencePage

import static extension org.uqbar.project.wollok.model.ResourceUtils.*
import static extension org.uqbar.project.wollok.utils.WEclipseUtils.*
Expand Down Expand Up @@ -111,7 +110,7 @@ class WollokActivator extends org.uqbar.project.wollok.ui.internal.WollokActivat
mapIssues.put(resource.platformFullPath, issues)
}

def void refreshTypeErrors(IProject project, Resource resource, IProgressMonitor monitor) {
def void refreshMarkers(IProject project, Resource resource, IProgressMonitor monitor) {
Display.^default.syncExec [
val issues = mapIssues.get(resource.platformFullPath)
new MarkerIssueProcessor(resource.IFile, markerCreator, markerTypeProvider).processIssues(issues, monitor)
Expand Down

0 comments on commit 2366d1d

Please sign in to comment.