Skip to content

Fixing compilation after platform update#44

Merged
VISTALL merged 1 commit intoconsulo:masterfrom
unv-unv:compilation-fix
Apr 21, 2026
Merged

Fixing compilation after platform update#44
VISTALL merged 1 commit intoconsulo:masterfrom
unv-unv:compilation-fix

Conversation

@unv-unv
Copy link
Copy Markdown
Contributor

@unv-unv unv-unv commented Apr 21, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Python plugin code to compile against the updated platform APIs (localization + read-action requirements), while keeping behavior the same.

Changes:

  • Migrate live template macros’ getPresentableName() to return LocalizeValue and add @RequiredReadAction where PSI is accessed.
  • Update exit-point highlighting handler to use CodeInsightLocalize and add @RequiredReadAction annotations.
  • Apply minor modernization/formatting (e.g., generics diamond, pattern matching instanceof).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
python-impl/src/main/java/com/jetbrains/python/impl/codeInsight/liveTemplates/PyFunctionNameMacro.java Switch presentable name to LocalizeValue + mark PSI read access with @RequiredReadAction.
python-impl/src/main/java/com/jetbrains/python/impl/codeInsight/liveTemplates/PyClassNameMacro.java Same platform API updates as function macro, plus formatting.
python-impl/src/main/java/com/jetbrains/python/impl/codeInsight/liveTemplates/CollectionElementNameMacro.java Switch presentable name to LocalizeValue, add overrides, and modernize collections usage.
python-impl/src/main/java/com/jetbrains/python/impl/codeInsight/highlighting/PyHighlightExitPointsHandler.java Replace CodeInsightBundle usage with CodeInsightLocalize and add read-action annotations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +52 to +56
@Override
public Result calculateResult(Expression[] params, ExpressionContext context) {
if (params.length != 1) {
return null;
}
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calculateResult can return null (e.g., when params.length != 1 or paramResult == null), but the override isn't annotated as nullable. Consider adding @Nullable (and importing it if needed) to match the other macros in this package and keep nullability analysis accurate.

Copilot uses AI. Check for mistakes.
@VISTALL VISTALL merged commit 315eb21 into consulo:master Apr 21, 2026
5 checks passed
@unv-unv unv-unv deleted the compilation-fix branch April 21, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants