# HG changeset patch # User Alexander Simon # Date 1247234931 -14400 # Node ID a98c3d6ff6fecf0f389b760c7c941a740afd554e # Parent 19736edf750ae767474a0f2d93df06363afab578 fixrd IZ#168360: code assistance not handling #ifndef directives in header files correctly diff -r 19736edf750a -r a98c3d6ff6fe cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/csm/core/DeepReparsingUtils.java --- a/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/csm/core/DeepReparsingUtils.java Fri Jul 10 17:40:52 2009 +0400 +++ b/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/csm/core/DeepReparsingUtils.java Fri Jul 10 18:08:51 2009 +0400 @@ -81,6 +81,8 @@ for (CsmFile parent : coherence) { if (!topParents.contains(parent)) { invalidateFileAndPreprocState(project, parent); + } else { + clearFileStateCache(parent); } } if (scheduleParsing) { @@ -112,6 +114,8 @@ for (CsmFile parent : coherence) { if (!topParents.contains(parent)) { invalidateFileAndPreprocState(project, parent); + } else { + clearFileStateCache(parent); } } if (scheduleParsing) { @@ -142,6 +146,8 @@ } else { coherenceLibrary.add(parent); } + } else { + clearFileStateCache(parent); } } if (!TraceFlags.DEEP_REPARSING_OPTIMISTIC) { @@ -198,6 +204,8 @@ } else { coherenceLibrary.add(parent); } + } else { + clearFileStateCache(parent); } } if (!TraceFlags.DEEP_REPARSING_OPTIMISTIC) { @@ -324,6 +332,8 @@ for (CsmFile incl : coherence) { if (!topParents.contains(incl)) { invalidateFileAndPreprocState(project, incl); + } else { + clearFileStateCache(incl); } } try { @@ -367,6 +377,7 @@ private static void invalidateFileAndPreprocState(final ProjectBase project, final CsmFile parent) { if (parent.getProject() == project) { FileImpl parentImpl = (FileImpl) parent; + clearFileStateCache(parentImpl); project.invalidatePreprocState(parentImpl.getBuffer().getFile()); parentImpl.markReparseNeeded(false); if (TraceFlags.USE_DEEP_REPARSING_TRACE) { @@ -380,6 +391,7 @@ CsmProject project = parent.getProject(); if (project instanceof ProjectBase) { FileImpl parentImpl = (FileImpl) parent; + clearFileStateCache(parentImpl); ((ProjectBase) project).invalidatePreprocState(parentImpl.getBuffer().getFile()); parentImpl.markReparseNeeded(false); if (TraceFlags.USE_DEEP_REPARSING_TRACE) { @@ -388,4 +400,10 @@ } } } + + private static void clearFileStateCache(final CsmFile parent){ + if (parent instanceof FileImpl){ + ((FileImpl)parent).clearStateCache(); + } + } } diff -r 19736edf750a -r a98c3d6ff6fe cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/csm/core/ProjectImpl.java --- a/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/csm/core/ProjectImpl.java Fri Jul 10 17:40:52 2009 +0400 +++ b/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/csm/core/ProjectImpl.java Fri Jul 10 18:08:51 2009 +0400 @@ -144,7 +144,7 @@ } } file.setBuffer(buf); - file.clearStateCache(); + //file.clearStateCache(); // no need for deep parsing util call here, because it will be called as external notification change anyway // DeepReparsingUtils.reparseOnEdit(file, this); }