From fd339f6c9e60fd674d28a7bfdc889c70b1f65916 Mon Sep 17 00:00:00 2001 From: Semyon Proshev Date: Thu, 11 Jul 2019 20:31:03 +0300 Subject: [PATCH] Move some python-related file types definitions to new API GitOrigin-RevId: b8372289edb46c2298617100e35020bd6f6af370 --- python/rest/resources/META-INF/rest.xml | 2 +- .../jetbrains/rest/RestFileTypeFactory.java | 30 ----------------- python/src/META-INF/python-core-buildout.xml | 6 +++- python/src/META-INF/python-core-common.xml | 14 ++++++-- .../python/PythonFileTypeFactory.java | 21 ------------ .../config/BuildoutCfgFileTypeFactory.java | 18 ----------- .../python/pyi/PyiFileTypeFactory.java | 32 ------------------- 7 files changed, 18 insertions(+), 105 deletions(-) delete mode 100644 python/rest/src/com/jetbrains/rest/RestFileTypeFactory.java delete mode 100644 python/src/com/jetbrains/python/PythonFileTypeFactory.java delete mode 100644 python/src/com/jetbrains/python/buildout/config/BuildoutCfgFileTypeFactory.java delete mode 100644 python/src/com/jetbrains/python/pyi/PyiFileTypeFactory.java diff --git a/python/rest/resources/META-INF/rest.xml b/python/rest/resources/META-INF/rest.xml index dbb1d120d8fe..3829651b2ec8 100644 --- a/python/rest/resources/META-INF/rest.xml +++ b/python/rest/resources/META-INF/rest.xml @@ -5,7 +5,7 @@ - + diff --git a/python/rest/src/com/jetbrains/rest/RestFileTypeFactory.java b/python/rest/src/com/jetbrains/rest/RestFileTypeFactory.java deleted file mode 100644 index b46a839ac56a..000000000000 --- a/python/rest/src/com/jetbrains/rest/RestFileTypeFactory.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2000-2013 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. - */ -package com.jetbrains.rest; - -import com.intellij.openapi.fileTypes.FileTypeConsumer; -import com.intellij.openapi.fileTypes.FileTypeFactory; -import org.jetbrains.annotations.NotNull; - -/** - * User : catherine - */ -public class RestFileTypeFactory extends FileTypeFactory { - @Override - public void createFileTypes(final @NotNull FileTypeConsumer consumer) { - consumer.consume(RestFileType.INSTANCE, RestFileType.DEFAULT_EXTENSION); - } -} \ No newline at end of file diff --git a/python/src/META-INF/python-core-buildout.xml b/python/src/META-INF/python-core-buildout.xml index caae3219a2e7..90607355fc7c 100644 --- a/python/src/META-INF/python-core-buildout.xml +++ b/python/src/META-INF/python-core-buildout.xml @@ -8,7 +8,11 @@ - + diff --git a/python/src/META-INF/python-core-common.xml b/python/src/META-INF/python-core-common.xml index e40586c7f113..bfc941720e18 100644 --- a/python/src/META-INF/python-core-common.xml +++ b/python/src/META-INF/python-core-common.xml @@ -16,7 +16,13 @@ - + + + @@ -615,7 +621,11 @@ - + diff --git a/python/src/com/jetbrains/python/PythonFileTypeFactory.java b/python/src/com/jetbrains/python/PythonFileTypeFactory.java deleted file mode 100644 index b631a3016c58..000000000000 --- a/python/src/com/jetbrains/python/PythonFileTypeFactory.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2000-2018 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; - -import com.intellij.ide.highlighter.XmlFileType; -import com.intellij.openapi.fileTypes.FileTypeConsumer; -import com.intellij.openapi.fileTypes.FileTypeFactory; -import com.jetbrains.pyqt.QtUIFileType; -import org.jetbrains.annotations.NonNls; -import org.jetbrains.annotations.NotNull; - -/** - * @author yole - */ -public class PythonFileTypeFactory extends FileTypeFactory { - @Override - public void createFileTypes(@NonNls @NotNull final FileTypeConsumer consumer) { - consumer.consume(PythonFileType.INSTANCE, "py;pyw;"); - consumer.consume(QtUIFileType.INSTANCE, "ui"); - consumer.consume(XmlFileType.INSTANCE, "qrc"); - } -} \ No newline at end of file diff --git a/python/src/com/jetbrains/python/buildout/config/BuildoutCfgFileTypeFactory.java b/python/src/com/jetbrains/python/buildout/config/BuildoutCfgFileTypeFactory.java deleted file mode 100644 index 780dab5894d4..000000000000 --- a/python/src/com/jetbrains/python/buildout/config/BuildoutCfgFileTypeFactory.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2000-2018 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.buildout.config; - -import com.intellij.openapi.fileTypes.ExactFileNameMatcher; -import com.intellij.openapi.fileTypes.FileTypeConsumer; -import com.intellij.openapi.fileTypes.FileTypeFactory; -import com.jetbrains.python.buildout.BuildoutFacet; -import org.jetbrains.annotations.NotNull; - -/** - * @author traff - */ -public class BuildoutCfgFileTypeFactory extends FileTypeFactory { - @Override - public void createFileTypes(final @NotNull FileTypeConsumer consumer) { - consumer.consume(BuildoutCfgFileType.INSTANCE, new ExactFileNameMatcher(BuildoutFacet.BUILDOUT_CFG, true)); - } -} \ No newline at end of file diff --git a/python/src/com/jetbrains/python/pyi/PyiFileTypeFactory.java b/python/src/com/jetbrains/python/pyi/PyiFileTypeFactory.java deleted file mode 100644 index 52b4c066e8c1..000000000000 --- a/python/src/com/jetbrains/python/pyi/PyiFileTypeFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2000-2015 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. - */ -package com.jetbrains.python.pyi; - -import com.intellij.openapi.fileTypes.FileTypeConsumer; -import com.intellij.openapi.fileTypes.FileTypeFactory; -import com.jetbrains.python.PythonFileType; -import org.jetbrains.annotations.NotNull; - -/** - * @author vlan - */ -public class PyiFileTypeFactory extends FileTypeFactory { - @Override - public void createFileTypes(@NotNull FileTypeConsumer consumer) { - final PythonFileType instance = PyiFileType.INSTANCE; - consumer.consume(instance, instance.getDefaultExtension()); - } -}