deprecate ServiceManager.getService(project)

GitOrigin-RevId: 3805c3aac4e084c828558bf1b1570339f7f3b4a3
This commit is contained in:
Vladimir Krivosheev
2021-03-26 22:16:00 +01:00
committed by intellij-monorepo-bot
parent 75b5dfce25
commit 809b7ca201
347 changed files with 912 additions and 2096 deletions

View File

@@ -1,22 +1,7 @@
/*
* Copyright 2000-2014 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
*
* 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.
*/
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.jetbrains.python.psi;
import com.intellij.lang.ASTNode;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
@@ -26,7 +11,7 @@ import org.jetbrains.annotations.Nullable;
public abstract class PyElementGenerator {
public static PyElementGenerator getInstance(Project project) {
return ServiceManager.getService(project, PyElementGenerator.class);
return project.getService(PyElementGenerator.class);
}
public abstract ASTNode createNameIdentifier(String name, LanguageLevel languageLevel);

View File

@@ -1,21 +1,6 @@
/*
* Copyright 2000-2014 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
*
* 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.
*/
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.jetbrains.python.psi;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiElement;
@@ -34,7 +19,7 @@ import java.util.List;
*/
public abstract class PyPsiFacade {
public static PyPsiFacade getInstance(Project project) {
return ServiceManager.getService(project, PyPsiFacade.class);
return project.getService(PyPsiFacade.class);
}
@NotNull

View File

@@ -1,7 +1,6 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.jetbrains.python.psi.types;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.RecursionManager;
@@ -128,7 +127,7 @@ public final class TypeEvalContext {
*/
@NotNull
private static TypeEvalContext getContextFromCache(@NotNull final Project project, @NotNull final TypeEvalContext context) {
return ServiceManager.getService(project, TypeEvalContextCache.class).getContext(context);
return project.getService(TypeEvalContextCache.class).getContext(context);
}
public TypeEvalContext withTracing() {