mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SSR: remove unnecessary parameter
GitOrigin-RevId: bfdf3f9c0bbb7814c31ef4e614907957a478a709
This commit is contained in:
committed by
intellij-monorepo-bot
parent
189d82b146
commit
ddf98bc3d8
+2
-3
@@ -416,9 +416,8 @@ public class JavaStructuralSearchProfile extends StructuralSearchProfile {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiCodeFragment createCodeFragment(Project project, String text, PsiElement context) {
|
||||
final JavaCodeFragmentFactory factory = JavaCodeFragmentFactory.getInstance(project);
|
||||
return factory.createCodeBlockCodeFragment(text, context, true);
|
||||
public PsiCodeFragment createCodeFragment(Project project, String text) {
|
||||
return JavaCodeFragmentFactory.getInstance(project).createCodeBlockCodeFragment(text, null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ public abstract class StructuralSearchProfile {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public PsiCodeFragment createCodeFragment(Project project, String text, @Nullable PsiElement context) {
|
||||
public PsiCodeFragment createCodeFragment(Project project, String text) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ public final class ReplacementPreviewDialog extends DialogWrapper {
|
||||
PsiFile file = null;
|
||||
final StructuralSearchProfile profile = StructuralSearchUtil.getProfileByFileType(myFileType);
|
||||
if (profile != null) {
|
||||
file = profile.createCodeFragment(project, "", null);
|
||||
file = profile.createCodeFragment(project, "");
|
||||
}
|
||||
|
||||
if (file != null) {
|
||||
|
||||
+2
-2
@@ -567,14 +567,14 @@ class EditVarConstraintsDialog extends DialogWrapper {
|
||||
}
|
||||
|
||||
Editor createEditor(final Project project, final String text, final String fileName) {
|
||||
Language groovy = Language.findLanguageByID("Groovy");
|
||||
final Language groovy = Language.findLanguageByID("Groovy");
|
||||
Document doc = null;
|
||||
final FileType fileType = getFileType(fileName);
|
||||
if (groovy != null) {
|
||||
// there is no right way to create a code fragment for generic language, so we use this hole since we need extend resolve scope
|
||||
for (StructuralSearchProfile profile : StructuralSearchProfile.EP_NAME.getExtensions()) {
|
||||
if (profile.isMyLanguage(groovy)) {
|
||||
PsiCodeFragment fragment = Objects.requireNonNull(profile.createCodeFragment(project, text, null));
|
||||
final PsiCodeFragment fragment = Objects.requireNonNull(profile.createCodeFragment(project, text));
|
||||
fragment.forceResolveScope(new StructuralSearchScriptScope(myProject));
|
||||
doc = PsiDocumentManager.getInstance(project).getDocument(fragment);
|
||||
break;
|
||||
|
||||
+2
-2
@@ -285,7 +285,7 @@ public class UIUtil {
|
||||
@NotNull
|
||||
public static Document createDocument(@NotNull Project project, @NotNull LanguageFileType fileType, Language dialect, @NotNull String text,
|
||||
@NotNull StructuralSearchProfile profile) {
|
||||
PsiFile codeFragment = profile.createCodeFragment(project, text, null);
|
||||
PsiFile codeFragment = profile.createCodeFragment(project, text);
|
||||
if (codeFragment == null) {
|
||||
codeFragment = createFileFragment(project, fileType, dialect, text);
|
||||
}
|
||||
@@ -302,7 +302,7 @@ public class UIUtil {
|
||||
@NotNull
|
||||
public static Editor createEditor(@NotNull Project project, @NotNull LanguageFileType fileType, Language dialect, @NotNull String text,
|
||||
@NotNull StructuralSearchProfile profile) {
|
||||
PsiFile codeFragment = profile.createCodeFragment(project, text, null);
|
||||
PsiFile codeFragment = profile.createCodeFragment(project, text);
|
||||
if (codeFragment == null) {
|
||||
codeFragment = createFileFragment(project, fileType, dialect, text);
|
||||
}
|
||||
|
||||
+2
-4
@@ -48,10 +48,8 @@ public class GroovyStructuralSearchProfile extends StructuralSearchProfileBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiCodeFragment createCodeFragment(Project project, String text, @Nullable PsiElement context) {
|
||||
final GroovyCodeFragment result = new GroovyCodeFragment(project, text);
|
||||
result.setContext(context);
|
||||
return result;
|
||||
public PsiCodeFragment createCodeFragment(Project project, String text) {
|
||||
return new GroovyCodeFragment(project, text);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user