Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh problems view #1617

Merged
merged 1 commit into from
Apr 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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