mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
FLEET-T-2087 support template variables and positioning in extract/altEnter templates
GitOrigin-RevId: c4937d2d04e95468786f834737882e163dbb8f45
This commit is contained in:
committed by
intellij-monorepo-bot
parent
689c47802f
commit
3c4170ccb9
@@ -10,8 +10,11 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Used to build and run a live template.
|
||||
*
|
||||
* @see TemplateManager
|
||||
*/
|
||||
public abstract class Template implements PresentableLookupValue {
|
||||
@@ -26,17 +29,24 @@ public abstract class Template implements PresentableLookupValue {
|
||||
private boolean myUseStaticImport;
|
||||
|
||||
public abstract void addTextSegment(@NotNull String text);
|
||||
|
||||
public abstract void addVariableSegment(@NonNls @NotNull String name);
|
||||
|
||||
@NotNull
|
||||
public Variable addVariable(@NonNls @NotNull String name, @NotNull Expression defaultValueExpression, boolean isAlwaysStopAt) {
|
||||
return addVariable(name, defaultValueExpression, defaultValueExpression, isAlwaysStopAt);
|
||||
}
|
||||
|
||||
public abstract List<Variable> getVariables();
|
||||
|
||||
@NotNull
|
||||
public abstract Variable addVariable(@NotNull Expression expression, boolean isAlwaysStopAt);
|
||||
|
||||
@NotNull
|
||||
public Variable addVariable(@NonNls @NotNull String name, Expression expression, Expression defaultValueExpression, boolean isAlwaysStopAt) {
|
||||
public Variable addVariable(@NonNls @NotNull String name,
|
||||
Expression expression,
|
||||
Expression defaultValueExpression,
|
||||
boolean isAlwaysStopAt) {
|
||||
return addVariable(name, expression, defaultValueExpression, isAlwaysStopAt, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -385,6 +385,7 @@ public class TemplateImpl extends TemplateBase implements SchemeElement {
|
||||
return myVariables.get(i).skipOnStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Variable> getVariables() {
|
||||
return new ArrayList<>(myVariables);
|
||||
}
|
||||
|
||||
+4
-1
@@ -1019,7 +1019,10 @@ public abstract class InplaceRefactoring {
|
||||
finally {
|
||||
if (!bind) {
|
||||
try {
|
||||
((EditorImpl)InjectedLanguageEditorUtil.getTopLevelEditor(myEditor)).stopDumbLater();
|
||||
Editor editor = InjectedLanguageEditorUtil.getTopLevelEditor(myEditor);
|
||||
if (editor instanceof EditorImpl) {
|
||||
((EditorImpl)editor).stopDumbLater();
|
||||
}
|
||||
}
|
||||
finally {
|
||||
FinishMarkAction.finish(myProject, myEditor, myMarkAction);
|
||||
|
||||
Reference in New Issue
Block a user