mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
IDEA-81462 When live template has two parameters which appear on the same line, second disappears while first is being entered
This commit is contained in:
@@ -267,7 +267,7 @@ public class LiveTemplateTest extends LightCodeInsightFixtureTestCase {
|
||||
|
||||
@Override
|
||||
protected void invokeTestRunnable(final Runnable runnable) throws Exception {
|
||||
if ("testNavigationActionsDontTerminateTemplate".equals(getName()) || "testTemplateWithEnd".equals(getName())) {
|
||||
if (name in ["testNavigationActionsDontTerminateTemplate", "testTemplateWithEnd", "testDisappearingVar"]) {
|
||||
runnable.run();
|
||||
return;
|
||||
}
|
||||
@@ -375,4 +375,23 @@ public class LiveTemplateTest extends LightCodeInsightFixtureTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testUseDefaultValueForQuickResultCalculation() {
|
||||
myFixture.configureByText 'a.txt', '<caret>'
|
||||
|
||||
final TemplateManager manager = TemplateManager.getInstance(getProject());
|
||||
final Template template = manager.createTemplate("vn", "user", '$V1$ var = $V2$;');
|
||||
template.addVariable("V1", "", "", true);
|
||||
template.addVariable("V2", "", '"239"', true);
|
||||
|
||||
writeCommand { manager.startTemplate(editor, template) }
|
||||
|
||||
myFixture.checkResult '<caret> var = 239;'
|
||||
|
||||
myFixture.type 'O'
|
||||
myFixture.checkResult 'O<caret> var = 239;'
|
||||
|
||||
myFixture.type '\t'
|
||||
myFixture.checkResult 'O var = <selection>239</selection>;'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user