java records: forbid to extract superclass

GitOrigin-RevId: b7f4b4b503e96b32373fa0b371a8454884219cdd
This commit is contained in:
Anna Kozlova
2020-11-03 09:49:42 +01:00
committed by intellij-monorepo-bot
parent 92b796100b
commit ebf97ab3ba
15 changed files with 68 additions and 6 deletions

5
.gitignore vendored
View File

@@ -4,17 +4,16 @@
.idea/gradle_extensions.xml
.idea/libraries/Gradle__*.xml
.idea/shelf
.idea/usage.statistics.xml
.idea/workspace.xml
/android
/config
/out
/python/helpers/.idea
/system
/test-config
/test-system
/univocity-parsers
build/dependencies/.gradle
build/dependencies/build
edu/dependencies/.gradle
edu/dependencies/build
stale_outputs_checked
/android

2
build/.gitignore vendored
View File

@@ -1,3 +1,5 @@
/kotlinc/
/jdk/
/download/
kotlin-plugin*.zip
dependencies/buildSrc/build

2
build/protobuf/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/bin/
/cache/

View File

@@ -97,6 +97,12 @@ public class ExtractSuperclassHandler implements ElementsHandler, ExtractSupercl
return;
}
if (mySubclass.isRecord()) {
String message = RefactoringBundle.getCannotRefactorMessage(JavaRefactoringBundle.message("superclass.cannot.be.extracted.from.a.record"));
CommonRefactoringUtil.showErrorHint(project, editor, message, getRefactoringName(), HelpID.EXTRACT_SUPERCLASS);
return;
}
List<MemberInfo> memberInfos = MemberInfo.extractClassMembers(mySubclass, new MemberInfo.Filter<>() {
@Override
public boolean includeMember(PsiMember element) {

View File

@@ -636,6 +636,7 @@ source.folder.0.has.package.prefix.1=Source folder {0} has package prefix ''{1}'
static.initializer.description=static initializer of class {0}
superclass.cannot.be.accessed.in.subclass=Superclass won't be accessible in subclass
superclass.cannot.be.extracted.from.an.enum=Superclass cannot be extracted from enum
superclass.cannot.be.extracted.from.a.record=Superclass cannot be extracted from record
synthetic.jsp.class.is.referenced.in.the.method=Synthetic jsp class is referenced in method
target.0.is.not.accessible.from.1=Target {0} is not accessible from {1}
the.field.should.be.declared.in.a.class=The field should be declared in a class

1
platform/built-in-server/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
start-up-visualizer/node_modules

View File

@@ -1,2 +0,0 @@
node_modules/
dist/

9
platform/elevation/rpc/.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
# Gradle
/build/
/.gradle/
/.idea/
local.properties
# these are intentionally un-ignored
!/gen
!*.iml

17
plugins/markdown/.gitignore vendored Normal file
View File

@@ -0,0 +1,17 @@
/build/
.gradle
.idea/workspace.xml
.idea/modules.xml
.idea/misc.xml
.idea/gradle.xml
.idea/compiler.xml
.idea/shelf/
.idea/libraries/
.idea/.name
.idea/*.png
/out
.DS_Store
*.patch

15
plugins/sh/.gitignore vendored Normal file
View File

@@ -0,0 +1,15 @@
.idea/workspace.xml
.idea/modules.xml
.idea/compiler.xml
.idea/misc.xml
.idea/gradle.xml
.idea/shelf/
.idea/libraries/
.idea/.name
*.iml
/build/
/jps-plugin/build/
.gradle
out/*
.DS_Store

1
python/build/dependencies/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build/

View File

@@ -1 +1,6 @@
pydev/build
pydev/build
/.idea/
/venv*/
.tox/
# pyenv's interpreters list
.python-version

View File

@@ -0,0 +1,4 @@
/attach_x86.dylib
/attach_x86_64.dylib
/attach_linux_x86.o
/attach_linux_x86_64.o

View File

@@ -39,6 +39,7 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
stubtest-output*
# Translations
*.mo

View File

@@ -0,0 +1 @@
/build/