Skip to content

Commit 9d4751f

Browse files
[python, ds, jupyter]: Migrate Python support to V2
Layout: JPS modules `intellij.python.community` `intellij.python.community.impl` `intellij.python.parser` `intellij.python.psi` `intellij.python.psi.impl` `intellij.python.ast` use package `com.jetbrains.python` and go to `intellij.python.community.impl` v2 module JPS module `intellij.python` uses package `com.intellij.python.pro` and goes to `intellij.python/pro` v2 module Both v2 modules (along with lots of others) come with `PythonId` (prof) or `PythonCore` (community) plugins DS bundles `intellij.python.community.impl` Idea and other Mini IDEs get `PythonCore` or `PythonId` plugin that bundle modules for Idea and mini IDEs GitOrigin-RevId: 98f418c52d90d51b9adf3250c561f2c36c767e2d
1 parent 692d133 commit 9d4751f

47 files changed

Lines changed: 260 additions & 137 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/misc.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

commandInterface/src/META-INF/command-line-plugin.xml renamed to commandInterface/src/intellij.commandInterface.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
<idea-plugin>
2-
1+
<idea-plugin package="com.intellij.commandInterface">
2+
<dependencies>
3+
<plugin id="com.intellij.modules.platform"/>
4+
<plugin id="com.intellij.modules.lang"/>
5+
</dependencies>
36
<!--
47
Extension points to support gnu command line language.
58
See {@link com.intellij.commandInterface.commandLine}
@@ -10,12 +13,13 @@
1013
<lang.parserDefinition language="CommandLine"
1114
implementationClass="com.intellij.commandInterface.commandLine.CommandLineParserDefinition"/>
1215
<lang.syntaxHighlighter language="CommandLine"
13-
implementationClass="com.intellij.commandInterface.commandLine.CommandLineSyntaxHighlighter"/>
16+
implementationClass="com.intellij.commandInterface.commandLine.CommandLineSyntaxHighlighter"/>
1417
<psi.referenceContributor language="CommandLine"
1518
implementation="com.intellij.commandInterface.commandLine.CommandLineReferenceContributor"/>
1619
<lang.elementManipulator forClass="com.intellij.commandInterface.commandLine.CommandLineElement"
1720
implementationClass="com.intellij.commandInterface.commandLine.CommandLineElementManipulator"/>
18-
<localInspection language="CommandLine" shortName="CommandLineInspection" bundle="com.intellij.commandInterface.CommandInterfaceBundle" key="commandLine.inspection.name"
21+
<localInspection language="CommandLine" shortName="CommandLineInspection" bundle="com.intellij.commandInterface.CommandInterfaceBundle"
22+
key="commandLine.inspection.name"
1923
enabledByDefault="true" level="WARNING"
2024
groupKey="INSP.GROUP.python"
2125
groupBundle="messages.PyBundle"

community-resources/resources/META-INF/IdeaPlugin.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<module value="com.intellij.modules.idea"/>
66
<module value="com.intellij.modules.idea.community"/>
77
<module value="com.intellij.modules.java-capable"/>
8-
<module value="com.intellij.modules.python-core-capable"/>
9-
8+
<module value="com.intellij.modules.python-core-capable"/> <!-- Python plugin can be installed -->
9+
<module value="com.intellij.modules.python-in-non-pycharm-ide-capable"/> <!-- Enable Non-Pycharm-IDE support in Python plugin -->
1010
<content>
1111
<module name="intellij.notebooks.visualization"/>
1212
<module name="intellij.notebooks.ui"/>

platform/build-scripts/src/org/jetbrains/intellij/build/python/PythonCommunityPluginModules.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ object PythonCommunityPluginModules {
2020
"intellij.python.community.core.impl",
2121
"intellij.python.pydev",
2222
"intellij.python.community.impl",
23+
"intellij.python.community.impl.community_only",
2324
"intellij.python.langInjection",
2425
"intellij.python.copyright",
2526
"intellij.python.terminal",
@@ -37,6 +38,7 @@ object PythonCommunityPluginModules {
3738
fun pythonCommunityPluginLayout(body: ((PluginLayout.PluginLayoutSpec) -> Unit)? = null): PluginLayout {
3839
val communityOnlyModules = persistentListOf(
3940
"intellij.python.community.plugin.minor",
41+
"intellij.python.community.plugin.minor.rider",
4042
)
4143
return pythonPlugin("intellij.python.community.plugin", pythonCommunityName, COMMUNITY_MODULES + communityOnlyModules) { spec ->
4244
body?.invoke(spec)

plugins/sh/python/resources/intellij.sh.python.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<idea-plugin package="com.intellij.sh.python">
22
<dependencies>
33
<plugin id="com.intellij.modules.python"/>
4+
<module name="intellij.python.community.impl"/>
45
</dependencies>
56
<extensions defaultExtensionNs="com.intellij">
67
<runMarkerContributionAdditionalCondition implementation="com.intellij.sh.python.PythonFileMarkerContributionAdditionalCondition"/>

python/IntelliLang-python/resources/intellij.python.langInjection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<idea-plugin package="com.intellij.python.langInjection">
22
<dependencies>
33
<plugin id="org.intellij.intelliLang"/>
4+
<module name="intellij.python.community.impl"/>
45
</dependencies>
56
<extensions defaultExtensionNs="org.intellij.intelliLang">
67
<languageSupport implementation="com.intellij.python.langInjection.PyLanguageInjectionSupport"/>

python/build/src/org/jetbrains/intellij/build/pycharm/PyCharmCommunityProperties.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class PyCharmCommunityProperties(private val communityHome: Path) : PyCharmPrope
4444
PluginLayout.plugin(listOf(
4545
"intellij.pycharm.community.customization",
4646
"intellij.pycharm.community.ide.impl",
47+
"intellij.pycharm.community.ide.impl.promotion",
4748
"intellij.jupyter.viewOnly",
4849
"intellij.jupyter.core"
4950
)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="inheritedJdk" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
<orderEntry type="module" module-name="intellij.platform.projectModel" />
11+
<orderEntry type="module" module-name="intellij.platform.ide.core" />
12+
<orderEntry type="module" module-name="intellij.platform.ide" />
13+
<orderEntry type="module" module-name="intellij.pycharm.community.ide.impl" />
14+
<orderEntry type="module" module-name="intellij.python.community.impl" />
15+
<orderEntry type="module" module-name="intellij.platform.ide.impl" />
16+
<orderEntry type="module" module-name="intellij.platform.lang.impl" />
17+
<orderEntry type="module" module-name="intellij.platform.statistics" />
18+
<orderEntry type="library" name="http-client" level="project" />
19+
</component>
20+
</module>

python/ide/impl/src/com/intellij/pycharm/community/ide/impl/PyCharmProfessionalAdvertiser.java renamed to python/ide/impl/intellij.pycharm.community.ide.impl.promotion/src/com/intellij/pycharm/community/ide/impl/promotion/PyCharmProfessionalAdvertiser.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
2-
package com.intellij.pycharm.community.ide.impl;
2+
package com.intellij.pycharm.community.ide.impl.promotion;
33

44
import com.intellij.ide.BrowserUtil;
55
import com.intellij.lang.annotation.AnnotationHolder;
@@ -12,6 +12,7 @@
1212
import com.intellij.openapi.vfs.VirtualFile;
1313
import com.intellij.psi.PsiElement;
1414
import com.intellij.psi.PsiFile;
15+
import com.intellij.pycharm.community.ide.impl.PyCharmCommunityCustomizationBundle;
1516
import com.jetbrains.python.PyCellUtil;
1617
import com.jetbrains.python.psi.PyFile;
1718
import com.jetbrains.python.psi.impl.PyPsiUtils;
@@ -20,7 +21,7 @@
2021

2122
import java.util.Objects;
2223

23-
public final class PyCharmProfessionalAdvertiser implements Annotator {
24+
final class PyCharmProfessionalAdvertiser implements Annotator {
2425
private static final NotificationGroup BALLOON_NOTIFICATIONS = NotificationGroupManager.getInstance().getNotificationGroup("PyCharm Professional Advertiser");
2526

2627
@Override

0 commit comments

Comments
 (0)