Skip to content

Commit

Permalink
Set a job family on the update markers from diagnostics job
Browse files Browse the repository at this point in the history
so that it can be waited for all this jobs to finish.
  • Loading branch information
rubenporras authored and mickaelistria committed Sep 26, 2023
1 parent cf3d644 commit cb8f917
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Expand Up @@ -21,6 +21,12 @@

public class LanguageServerPlugin extends AbstractUIPlugin {

/**
* Constant identifying the job family identifier for the background update markers from diagnostics job.
*
*/
public static final Object FAMILY_UPDATE_MARKERS = new Object();

public static final String PLUGIN_ID = "org.eclipse.lsp4e"; //$NON-NLS-1$

public static final boolean DEBUG = Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.lsp4e/debug")); //$NON-NLS-1$
Expand Down
Expand Up @@ -133,6 +133,10 @@ private void updateEditorAnnotations(@NonNull ISourceViewer sourceViewer, Publis

private WorkspaceJob updateMarkers(PublishDiagnosticsParams diagnostics, IResource resource) throws CoreException {
WorkspaceJob job = new WorkspaceJob("Update markers from diagnostics") { //$NON-NLS-1$
@Override
public boolean belongsTo(Object family) {
return LanguageServerPlugin.FAMILY_UPDATE_MARKERS == family;
}

@Override
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
Expand Down

0 comments on commit cb8f917

Please sign in to comment.