diff options
author | nsandonato | 2011-07-08 19:24:43 +0000 |
---|---|---|
committer | nsandonato | 2011-07-08 19:24:43 +0000 |
commit | 0d97f115f3b647cfbdc1d4174d3abde399cb208f (patch) | |
tree | ee726e7a4229b774a135cf96ac682aeb030ce985 /bundles/org.eclipse.wst.sse.ui | |
parent | 0af0345bea7bb5a3532a75e8cc4f8a0ef7403fcc (diff) | |
download | webtools.sourceediting-0d97f115f3b647cfbdc1d4174d3abde399cb208f.tar.gz webtools.sourceediting-0d97f115f3b647cfbdc1d4174d3abde399cb208f.tar.xz webtools.sourceediting-0d97f115f3b647cfbdc1d4174d3abde399cb208f.zip |
[323421] Can not find the tag library descriptor for "/WEB-INF/<tld> suddenly showing up
Diffstat (limited to 'bundles/org.eclipse.wst.sse.ui')
-rw-r--r-- | bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java index 84c485fdb0..5f4bd9f30f 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java @@ -33,6 +33,11 @@ import org.eclipse.jface.text.reconciler.IReconcilingStrategy; import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.text.source.projection.ProjectionViewer; +import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser; +import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandler; +import org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParser; +import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument; +import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion; import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder; import org.eclipse.wst.sse.ui.internal.IReleasable; import org.eclipse.wst.sse.ui.internal.Logger; @@ -54,6 +59,19 @@ public class DocumentRegionProcessor extends DirtyRegionProcessor { private static final boolean DEBUG_VALIDATORS = Boolean.TRUE.toString().equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/reconcilerValidators")); //$NON-NLS-1$ /** + * Marks the entire document dirty when a parser-level change is notified + * that might affect the entire document + */ + class DirtyRegionParseHandler implements StructuredDocumentRegionHandler { + public void nodeParsed(IStructuredDocumentRegion aCoreStructuredDocumentRegion) { + } + + public void resetNodes() { + setEntireDocumentDirty(getDocument()); + } + } + private DirtyRegionParseHandler fResetHandler = new DirtyRegionParseHandler(); + /** * A strategy to use the defined default Spelling service. */ private IReconcilingStrategy fSpellcheckStrategy; @@ -321,6 +339,13 @@ public class DocumentRegionProcessor extends DirtyRegionProcessor { public void setDocument(IDocument doc) { + if (getDocument() instanceof IStructuredDocument) { + RegionParser parser = ((IStructuredDocument) getDocument()).getParser(); + if (parser instanceof StructuredDocumentRegionParser) { + ((StructuredDocumentRegionParser) parser).removeStructuredDocumentRegionHandler(fResetHandler); + } + } + super.setDocument(doc); IReconcilingStrategy validatorStrategy = getValidatorStrategy(); @@ -336,6 +361,13 @@ public class DocumentRegionProcessor extends DirtyRegionProcessor { fFoldingStrategy.uninstall(); } fFoldingStrategy = null; + + if (getDocument() instanceof IStructuredDocument) { + RegionParser parser = ((IStructuredDocument) doc).getParser(); + if (parser instanceof StructuredDocumentRegionParser) { + ((StructuredDocumentRegionParser) parser).addStructuredDocumentRegionHandler(fResetHandler); + } + } } protected void setEntireDocumentDirty(IDocument document) { @@ -397,6 +429,13 @@ public class DocumentRegionProcessor extends DirtyRegionProcessor { } fReconcileListeners = new ISourceReconcilingListener[0]; + + if (getDocument() instanceof IStructuredDocument) { + RegionParser parser = ((IStructuredDocument) getDocument()).getParser(); + if (parser instanceof StructuredDocumentRegionParser) { + ((StructuredDocumentRegionParser) parser).removeStructuredDocumentRegionHandler(fResetHandler); + } + } } super.uninstall(); } |