mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
embedded live templates: support default values
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@ public class EmbeddedLiveTemplatesTest extends LightPlatformCodeInsightFixtureTe
|
||||
public void testSupportVariables() throws Exception {
|
||||
|
||||
doTest("First: #[[$Var$]]# Second: #[[$Var$]]#",
|
||||
"First: <caret> Second: ");
|
||||
"First: Var Second: Var");
|
||||
}
|
||||
|
||||
protected void doTest(String text, String result) {
|
||||
|
||||
+3
-3
@@ -93,11 +93,11 @@ public abstract class CreateFromTemplateActionBase extends AnAction {
|
||||
|
||||
Set<String> variables = new HashSet<String>();
|
||||
for (int i = 0; i < count; i++) {
|
||||
String name = template.getSegmentName(i);
|
||||
variables.add(name);
|
||||
variables.add(template.getSegmentName(i));
|
||||
}
|
||||
variables.removeAll(TemplateImpl.INTERNAL_VARS_SET);
|
||||
for (String variable : variables) {
|
||||
template.addVariable(variable, null, variable, true);
|
||||
template.addVariable(variable, null, "\"" + variable + "\"", true);
|
||||
}
|
||||
WriteCommandAction.runWriteCommandAction(project, new Runnable() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user