From 92799f2136e77ff95afad897a70c7cc89f603549 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Wed, 2 Sep 2009 09:56:09 +0400 Subject: [PATCH] decoupling CachedValueManager from PSI --- .../JavaConcatenationInjectorManager.java | 4 ++-- .../src/com/intellij/psi/PsiManager.java | 2 ++ .../com/intellij/psi/meta/PsiMetaData.java | 3 +-- .../intellij/facet/impl/FacetFinderImpl.java | 2 +- .../src/com/intellij/mock/MockPsiManager.java | 10 ++++------ .../psi/impl/PsiCachedValuesFactory.java | 2 +- .../com/intellij/psi/impl/PsiManagerImpl.java | 12 ++++++++--- .../psi/impl/PsiParameterizedCachedValue.java | 2 +- .../impl/include/FileIncludeManagerImpl.java | 2 +- .../intellij/psi/impl/meta/MetaRegistry.java | 4 ++-- .../impl/providers/FileReferenceSet.java | 4 ++-- .../tree/injected/InjectedLanguageUtil.java | 4 ++-- .../com/intellij/psi/util/CachedValue.java | 20 +++++++++---------- .../psi/util/CachedValuesManager.java | 20 +++++++++---------- .../psi/util/ParameterizedCachedValue.java | 2 +- .../ParameterizedCachedValueProvider.java | 2 +- .../com/intellij/util/CachedValueBase.java | 8 +++++--- .../com/intellij/util/CachedValueImpl.java | 1 - .../util/ParameterizedCachedValueImpl.java | 1 - .../src/META-INF/LangExtensions.xml | 3 +++ .../src/META-INF/PlatformExtensionPoints.xml | 2 ++ .../src/META-INF/PlatformExtensions.xml | 3 +++ .../DomElementAnnotationsManagerImpl.java | 7 +------ .../psi/impl/source/xml/XmlDocumentImpl.java | 6 +++--- 24 files changed, 67 insertions(+), 59 deletions(-) diff --git a/java/java-impl/src/com/intellij/psi/impl/source/tree/injected/JavaConcatenationInjectorManager.java b/java/java-impl/src/com/intellij/psi/impl/source/tree/injected/JavaConcatenationInjectorManager.java index 575762ab084a..aea014e2bfc6 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/tree/injected/JavaConcatenationInjectorManager.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/tree/injected/JavaConcatenationInjectorManager.java @@ -10,8 +10,8 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Key; import com.intellij.openapi.util.ModificationTracker; import com.intellij.psi.*; -import com.intellij.psi.impl.ParameterizedCachedValueImpl; import com.intellij.psi.impl.PsiManagerEx; +import com.intellij.psi.impl.PsiParameterizedCachedValue; import com.intellij.psi.util.CachedValueProvider; import com.intellij.psi.util.ParameterizedCachedValue; import com.intellij.psi.util.ParameterizedCachedValueProvider; @@ -123,7 +123,7 @@ public class JavaConcatenationInjectorManager implements ProjectComponent, Modif if (registrar.result != null) { // store this everywhere ParameterizedCachedValue cachedValue = context.getManager().getCachedValuesManager().createParameterizedCachedValue(this, false); - ((ParameterizedCachedValueImpl)cachedValue).setValue(result); + ((PsiParameterizedCachedValue)cachedValue).setValue(result); for (PsiElement operand : operands) { operand.putUserData(INJECTED_PSI_IN_CONCATENATION, cachedValue); diff --git a/platform/lang-api/src/com/intellij/psi/PsiManager.java b/platform/lang-api/src/com/intellij/psi/PsiManager.java index 622a51c84948..ed170a7641d5 100644 --- a/platform/lang-api/src/com/intellij/psi/PsiManager.java +++ b/platform/lang-api/src/com/intellij/psi/PsiManager.java @@ -150,6 +150,8 @@ public abstract class PsiManager extends UserDataHolderBase { * which are automatically recalculated based on changes of the elements on which they depend. * * @return the cached values manager instance. + * @deprecated + * @see CachedValuesManager#getManager(com.intellij.openapi.project.Project) */ @NotNull public abstract CachedValuesManager getCachedValuesManager(); diff --git a/platform/lang-api/src/com/intellij/psi/meta/PsiMetaData.java b/platform/lang-api/src/com/intellij/psi/meta/PsiMetaData.java index d9a4af7638f5..3bbbdf97168b 100644 --- a/platform/lang-api/src/com/intellij/psi/meta/PsiMetaData.java +++ b/platform/lang-api/src/com/intellij/psi/meta/PsiMetaData.java @@ -17,7 +17,6 @@ package com.intellij.psi.meta; import com.intellij.psi.PsiElement; import com.intellij.psi.filters.ElementFilter; -import com.intellij.psi.util.CachedValue; import org.jetbrains.annotations.NonNls; /** @@ -39,7 +38,7 @@ public interface PsiMetaData { /** * @return objects this meta data depends on. - * @see CachedValue + * @see com.intellij.psi.util.CachedValue */ Object[] getDependences(); } diff --git a/platform/lang-impl/src/com/intellij/facet/impl/FacetFinderImpl.java b/platform/lang-impl/src/com/intellij/facet/impl/FacetFinderImpl.java index f4d685869bac..1c9d42606c5b 100644 --- a/platform/lang-impl/src/com/intellij/facet/impl/FacetFinderImpl.java +++ b/platform/lang-impl/src/com/intellij/facet/impl/FacetFinderImpl.java @@ -14,9 +14,9 @@ import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.module.Module; import com.intellij.psi.PsiManager; +import com.intellij.psi.util.CachedValueProvider; import com.intellij.psi.util.CachedValuesManager; import com.intellij.psi.util.CachedValue; -import com.intellij.psi.util.CachedValueProvider; import com.intellij.util.SmartList; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.NotNull; diff --git a/platform/lang-impl/src/com/intellij/mock/MockPsiManager.java b/platform/lang-impl/src/com/intellij/mock/MockPsiManager.java index d6e2a62f42f4..f283fdfeef9c 100644 --- a/platform/lang-impl/src/com/intellij/mock/MockPsiManager.java +++ b/platform/lang-impl/src/com/intellij/mock/MockPsiManager.java @@ -9,10 +9,7 @@ import com.intellij.openapi.util.Key; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; import com.intellij.psi.codeStyle.CodeStyleManager; -import com.intellij.psi.impl.CachedValuesManagerImpl; -import com.intellij.psi.impl.PsiManagerEx; -import com.intellij.psi.impl.PsiModificationTrackerImpl; -import com.intellij.psi.impl.PsiTreeChangeEventImpl; +import com.intellij.psi.impl.*; import com.intellij.psi.impl.cache.CacheManager; import com.intellij.psi.impl.cache.impl.CompositeCacheManager; import com.intellij.psi.impl.file.impl.FileManager; @@ -24,6 +21,7 @@ import com.intellij.psi.util.CachedValuesManager; import com.intellij.psi.util.PsiModificationTracker; import com.intellij.util.IncorrectOperationException; import com.intellij.util.ThrowableRunnable; +import com.intellij.util.CachedValuesManagerImpl; import gnu.trove.THashMap; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -112,7 +110,7 @@ public class MockPsiManager extends PsiManagerEx { @NotNull public CachedValuesManager getCachedValuesManager() { if (myCachedValuesManager == null) { - myCachedValuesManager = new CachedValuesManagerImpl(this); + myCachedValuesManager = new CachedValuesManagerImpl(myProject, new PsiCachedValuesFactory(this)); } return myCachedValuesManager; } @@ -234,4 +232,4 @@ public class MockPsiManager extends PsiManagerEx { public CacheManager getCacheManager() { return myCompositeCacheManager; } -} +} \ No newline at end of file diff --git a/platform/lang-impl/src/com/intellij/psi/impl/PsiCachedValuesFactory.java b/platform/lang-impl/src/com/intellij/psi/impl/PsiCachedValuesFactory.java index 8151c2e9904d..dda37c58a039 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/PsiCachedValuesFactory.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/PsiCachedValuesFactory.java @@ -51,4 +51,4 @@ public class PsiCachedValuesFactory implements CachedValuesFactory { } }; } -} \ No newline at end of file +} diff --git a/platform/lang-impl/src/com/intellij/psi/impl/PsiManagerImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/PsiManagerImpl.java index e02079b81691..4870b608251e 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/PsiManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/PsiManagerImpl.java @@ -22,6 +22,7 @@ import com.intellij.openapi.startup.StartupManager; import com.intellij.openapi.util.Computable; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.Key; +import com.intellij.openapi.util.NotNullLazyValue; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.VirtualFileFilter; import com.intellij.psi.*; @@ -64,7 +65,13 @@ public class PsiManagerImpl extends PsiManagerEx implements ProjectComponent { private final CacheManager myCacheManager; private final PsiModificationTrackerImpl myModificationTracker; private final ResolveCache myResolveCache; - private final CachedValuesManager myCachedValuesManager; + private final NotNullLazyValue myCachedValuesManager = new NotNullLazyValue() { + @NotNull + @Override + protected CachedValuesManager compute() { + return CachedValuesManager.getManager(myProject); + } + }; private final List myTreeChangePreprocessors = ContainerUtil.createEmptyCOWList(); private final List myTreeChangeListeners = ContainerUtil.createEmptyCOWList(); @@ -119,7 +126,6 @@ public class PsiManagerImpl extends PsiManagerEx implements ProjectComponent { myModificationTracker = new PsiModificationTrackerImpl(myProject); myTreeChangePreprocessors.add(myModificationTracker); myResolveCache = new ResolveCache(this); - myCachedValuesManager = new CachedValuesManagerImpl(this); if (startupManager != null) { ((StartupManagerEx)startupManager).registerPreStartupActivity( @@ -695,7 +701,7 @@ public class PsiManagerImpl extends PsiManagerEx implements ProjectComponent { @NotNull public CachedValuesManager getCachedValuesManager() { - return myCachedValuesManager; + return myCachedValuesManager.getValue(); } public void moveDirectory(@NotNull final PsiDirectory dir, @NotNull PsiDirectory newParent) throws IncorrectOperationException { diff --git a/platform/lang-impl/src/com/intellij/psi/impl/PsiParameterizedCachedValue.java b/platform/lang-impl/src/com/intellij/psi/impl/PsiParameterizedCachedValue.java index 1f9f740c6822..2e836f8f2dd3 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/PsiParameterizedCachedValue.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/PsiParameterizedCachedValue.java @@ -61,4 +61,4 @@ public abstract class PsiParameterizedCachedValue extends PsiCachedValue public ParameterizedCachedValueProvider getValueProvider() { return myProvider; } -} \ No newline at end of file +} diff --git a/platform/lang-impl/src/com/intellij/psi/impl/include/FileIncludeManagerImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/include/FileIncludeManagerImpl.java index 175b94a6208c..b4c2d72537ed 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/include/FileIncludeManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/include/FileIncludeManagerImpl.java @@ -33,7 +33,7 @@ import com.intellij.psi.util.ParameterizedCachedValueProvider; import com.intellij.psi.util.CachedValuesManager; import com.intellij.util.containers.HashMap; import com.intellij.util.containers.MultiMap; -import com.intellij.util.ArrayUtil; +import com.intellij.util.*; import java.util.ArrayList; import java.util.List; diff --git a/platform/lang-impl/src/com/intellij/psi/impl/meta/MetaRegistry.java b/platform/lang-impl/src/com/intellij/psi/impl/meta/MetaRegistry.java index 695c510c531c..c41d7e9c03ef 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/meta/MetaRegistry.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/meta/MetaRegistry.java @@ -8,13 +8,13 @@ import com.intellij.openapi.util.Key; import com.intellij.openapi.util.UserDataCache; import com.intellij.patterns.ElementPattern; import com.intellij.psi.PsiElement; +import com.intellij.psi.util.CachedValue; +import com.intellij.psi.util.CachedValueProvider; import com.intellij.psi.filters.ElementFilter; import com.intellij.psi.filters.position.PatternFilter; import com.intellij.psi.meta.MetaDataContributor; import com.intellij.psi.meta.MetaDataRegistrar; import com.intellij.psi.meta.PsiMetaData; -import com.intellij.psi.util.CachedValue; -import com.intellij.psi.util.CachedValueProvider; import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FileReferenceSet.java b/platform/lang-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FileReferenceSet.java index 7d8fc938712b..d5a31a0a8c37 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FileReferenceSet.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FileReferenceSet.java @@ -9,10 +9,10 @@ import com.intellij.openapi.util.Key; import com.intellij.openapi.util.TextRange; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; -import com.intellij.psi.util.CachedValue; import com.intellij.psi.util.CachedValueProvider; import com.intellij.psi.util.CachedValuesManager; -import com.intellij.psi.util.PsiModificationTracker; +import com.intellij.psi.util.CachedValue; +import com.intellij.psi.util.*; import com.intellij.util.Function; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java index 71fe926db88a..6dc49e83267e 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java @@ -16,9 +16,9 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.*; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; -import com.intellij.psi.impl.ParameterizedCachedValueImpl; import com.intellij.psi.impl.PsiDocumentManagerImpl; import com.intellij.psi.impl.PsiManagerEx; +import com.intellij.psi.impl.PsiParameterizedCachedValue; import com.intellij.psi.impl.source.DummyHolder; import com.intellij.psi.tree.IElementType; import com.intellij.psi.util.CachedValueProvider; @@ -196,7 +196,7 @@ public class InjectedLanguageUtil { ParameterizedCachedValue cachedValue = psiManager.getCachedValuesManager().createParameterizedCachedValue(INJECTED_PSI_PROVIDER, false); Document hostDocument = hostPsiFile.getViewProvider().getDocument(); CachedValueProvider.Result result = new CachedValueProvider.Result(places, PsiModificationTracker.MODIFICATION_COUNT, hostDocument); - ((ParameterizedCachedValueImpl)cachedValue).setValue(result); + ((PsiParameterizedCachedValue)cachedValue).setValue(result); current.putUserData(INJECTED_PSI_KEY, cachedValue); } } diff --git a/platform/platform-api/src/com/intellij/psi/util/CachedValue.java b/platform/platform-api/src/com/intellij/psi/util/CachedValue.java index a42a9426a82c..0ad969663787 100644 --- a/platform/platform-api/src/com/intellij/psi/util/CachedValue.java +++ b/platform/platform-api/src/com/intellij/psi/util/CachedValue.java @@ -1,17 +1,17 @@ /* - * Copyright 2000-2007 JetBrains s.r.o. + * Copyright 2000-2009 JetBrains s.r.o. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.intellij.psi.util; diff --git a/platform/platform-api/src/com/intellij/psi/util/CachedValuesManager.java b/platform/platform-api/src/com/intellij/psi/util/CachedValuesManager.java index 2a1ca8d6615c..a362717fe7f8 100644 --- a/platform/platform-api/src/com/intellij/psi/util/CachedValuesManager.java +++ b/platform/platform-api/src/com/intellij/psi/util/CachedValuesManager.java @@ -1,17 +1,17 @@ /* - * Copyright 2000-2007 JetBrains s.r.o. + * Copyright 2000-2009 JetBrains s.r.o. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.intellij.psi.util; diff --git a/platform/platform-api/src/com/intellij/psi/util/ParameterizedCachedValue.java b/platform/platform-api/src/com/intellij/psi/util/ParameterizedCachedValue.java index 6f6a260d1ae7..0ae977e58f0a 100644 --- a/platform/platform-api/src/com/intellij/psi/util/ParameterizedCachedValue.java +++ b/platform/platform-api/src/com/intellij/psi/util/ParameterizedCachedValue.java @@ -25,4 +25,4 @@ public interface ParameterizedCachedValue { ParameterizedCachedValueProvider getValueProvider(); boolean hasUpToDateValue(); -} \ No newline at end of file +} diff --git a/platform/platform-api/src/com/intellij/psi/util/ParameterizedCachedValueProvider.java b/platform/platform-api/src/com/intellij/psi/util/ParameterizedCachedValueProvider.java index 10fd41258d20..9de8c42488bc 100644 --- a/platform/platform-api/src/com/intellij/psi/util/ParameterizedCachedValueProvider.java +++ b/platform/platform-api/src/com/intellij/psi/util/ParameterizedCachedValueProvider.java @@ -20,4 +20,4 @@ import org.jetbrains.annotations.Nullable; public interface ParameterizedCachedValueProvider { @Nullable CachedValueProvider.Result compute(P param); -} \ No newline at end of file +} diff --git a/platform/platform-impl/src/com/intellij/util/CachedValueBase.java b/platform/platform-impl/src/com/intellij/util/CachedValueBase.java index 17201d9224c0..fb3830f13041 100644 --- a/platform/platform-impl/src/com/intellij/util/CachedValueBase.java +++ b/platform/platform-impl/src/com/intellij/util/CachedValueBase.java @@ -1,15 +1,14 @@ package com.intellij.util; import com.intellij.openapi.Disposable; -import com.intellij.openapi.project.Project; import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.editor.Document; +import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.ModificationTracker; import com.intellij.openapi.util.Ref; import com.intellij.psi.util.CachedValueProvider; import com.intellij.reference.SoftReference; -import com.intellij.util.ArrayUtil; -import com.intellij.util.TimedReference; import com.intellij.util.concurrency.JBLock; import com.intellij.util.concurrency.JBReentrantReadWriteLock; import com.intellij.util.concurrency.LockFactory; @@ -158,6 +157,9 @@ public abstract class CachedValueBase { if (dependency instanceof ModificationTracker) { return ((ModificationTracker)dependency).getModificationCount(); } + if (dependency instanceof Document) { + return ((Document)dependency).getModificationStamp(); + } else { LOG.error("Wrong dependency type: " + dependency.getClass()); return -1; diff --git a/platform/platform-impl/src/com/intellij/util/CachedValueImpl.java b/platform/platform-impl/src/com/intellij/util/CachedValueImpl.java index 013bcd99fb32..d895ebc6ce96 100644 --- a/platform/platform-impl/src/com/intellij/util/CachedValueImpl.java +++ b/platform/platform-impl/src/com/intellij/util/CachedValueImpl.java @@ -10,7 +10,6 @@ package com.intellij.util; import com.intellij.psi.util.CachedValue; import com.intellij.psi.util.CachedValueProvider; -import com.intellij.util.CachedValueBase; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/platform/platform-impl/src/com/intellij/util/ParameterizedCachedValueImpl.java b/platform/platform-impl/src/com/intellij/util/ParameterizedCachedValueImpl.java index c5fb75a4e388..552b07e78bc5 100644 --- a/platform/platform-impl/src/com/intellij/util/ParameterizedCachedValueImpl.java +++ b/platform/platform-impl/src/com/intellij/util/ParameterizedCachedValueImpl.java @@ -11,7 +11,6 @@ package com.intellij.util; import com.intellij.psi.util.CachedValueProvider; import com.intellij.psi.util.ParameterizedCachedValue; import com.intellij.psi.util.ParameterizedCachedValueProvider; -import com.intellij.util.CachedValueBase; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/platform/platform-resources/src/META-INF/LangExtensions.xml b/platform/platform-resources/src/META-INF/LangExtensions.xml index f9e99f8fb8a9..f6926c464177 100644 --- a/platform/platform-resources/src/META-INF/LangExtensions.xml +++ b/platform/platform-resources/src/META-INF/LangExtensions.xml @@ -140,6 +140,9 @@ serviceImplementation="com.intellij.pom.core.impl.PomModelImpl"/> + + diff --git a/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml b/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml index 0c0cdc56daa5..0413b84c8824 100644 --- a/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml +++ b/platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml @@ -48,6 +48,8 @@ + + diff --git a/platform/platform-resources/src/META-INF/PlatformExtensions.xml b/platform/platform-resources/src/META-INF/PlatformExtensions.xml index c18423adc459..10e7c7457992 100644 --- a/platform/platform-resources/src/META-INF/PlatformExtensions.xml +++ b/platform/platform-resources/src/META-INF/PlatformExtensions.xml @@ -114,6 +114,9 @@ + + diff --git a/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementAnnotationsManagerImpl.java b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementAnnotationsManagerImpl.java index 3ae92b17923f..14f523b56899 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementAnnotationsManagerImpl.java +++ b/xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementAnnotationsManagerImpl.java @@ -22,7 +22,6 @@ import com.intellij.profile.Profile; import com.intellij.profile.ProfileChangeAdapter; import com.intellij.profile.codeInspection.InspectionProfileManager; import com.intellij.profile.codeInspection.InspectionProjectProfileManager; -import com.intellij.psi.PsiManager; import com.intellij.psi.util.CachedValue; import com.intellij.psi.util.CachedValueProvider; import com.intellij.psi.util.CachedValuesManager; @@ -99,11 +98,7 @@ public class DomElementAnnotationsManagerImpl extends DomElementAnnotationsManag private final ProjectRootManager myProjectRootManager; private final CachedValuesManager myCachedValuesManager; private long myModificationCount; - - public DomElementAnnotationsManagerImpl(Project project, InspectionProfileManager manager, ProjectRootManager projectRootManager, - PsiManager psiManager) { - this(project, manager, projectRootManager, psiManager.getCachedValuesManager()); - } + public DomElementAnnotationsManagerImpl(Project project, final InspectionProfileManager inspectionProfileManager, ProjectRootManager projectRootManager, final CachedValuesManager cachedValuesManager) { myCachedValuesManager = cachedValuesManager; diff --git a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDocumentImpl.java b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDocumentImpl.java index 2475fb930038..906bb5ca769c 100644 --- a/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDocumentImpl.java +++ b/xml/impl/src/com/intellij/psi/impl/source/xml/XmlDocumentImpl.java @@ -11,7 +11,7 @@ import com.intellij.pom.impl.PomTransactionBase; import com.intellij.pom.xml.XmlAspect; import com.intellij.pom.xml.impl.events.XmlDocumentChangedImpl; import com.intellij.psi.*; -import com.intellij.psi.impl.CachedValueImpl; +import com.intellij.psi.impl.PsiCachedValueImpl; import com.intellij.psi.impl.meta.MetaRegistry; import com.intellij.psi.impl.source.html.dtd.HtmlNSDescriptorImpl; import com.intellij.psi.impl.source.tree.TreeElement; @@ -133,7 +133,7 @@ public class XmlDocumentImpl extends XmlElementImpl implements XmlDocument { CachedValue cachedValue = defaultDescriptorsCache.get(namespace); if (cachedValue == null) { - defaultDescriptorsCache.put(namespace, cachedValue = new CachedValueImpl(getManager(), new CachedValueProvider() { + defaultDescriptorsCache.put(namespace, cachedValue = new PsiCachedValueImpl(getManager(), new CachedValueProvider() { public Result compute() { final XmlNSDescriptor defaultNSDescriptorInner = getDefaultNSDescriptorInner(namespace, strict); @@ -145,7 +145,7 @@ public class XmlDocumentImpl extends XmlElementImpl implements XmlDocument { ? defaultNSDescriptorInner.getDependences() : ExternalResourceManager.getInstance()); } - }, false)); + })); } return cachedValue.getValue(); }