Skip to content

Commit

Permalink
fix(generate): 修复本地新增的postfix超级加倍问题...
Browse files Browse the repository at this point in the history
Closes #43
  • Loading branch information
gudqs7 committed Jun 20, 2022
1 parent 94413e4 commit 1c37c30
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group 'cn.gudqs7.idea.plugins'
version '2.3.1'
version '2.3.2'

repositories {
mavenCentral()
Expand Down
5 changes: 5 additions & 0 deletions parts/changeNotes.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf8">

<pre>
<strong>Release v2.3.2</strong>
1:fix issue #43(本地新增的postfix超级加倍问题......)

English:
1: fix issue #43 (locally added postfix super doubling problem...)
<strong>Release v2.3.1</strong>
1:fix: 修复 Generate Convert 在方法上作用时, 生成的代码不带换行问题.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
import cn.gudqs7.plugins.generate.setter.template.GenerateAllSetterWithChainTemplate;
import cn.gudqs7.plugins.generate.setter.template.GenerateAllSetterWithDefaultValTemplate;
import cn.gudqs7.plugins.generate.setter.template.GenerateAllSetterWithoutDefaultValTemplate;
import com.intellij.codeInsight.template.postfix.templates.JavaPostfixTemplateProvider;
import com.intellij.codeInsight.template.postfix.templates.PostfixTemplate;
import com.intellij.codeInsight.template.postfix.templates.PostfixTemplateProvider;
import com.intellij.openapi.editor.Editor;
import com.intellij.psi.PsiFile;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;

Expand All @@ -16,7 +18,7 @@
/**
* @author WQ
*/
public class GeneratePostfixTemplateProvider extends JavaPostfixTemplateProvider {
public class GeneratePostfixTemplateProvider implements PostfixTemplateProvider {

private final Set<PostfixTemplate> templates;

Expand All @@ -36,4 +38,24 @@ public GeneratePostfixTemplateProvider() {
public Set<PostfixTemplate> getTemplates() {
return templates;
}

@Override
public boolean isTerminalSymbol(char currentChar) {
return false;
}

@Override
public void preExpand(@NotNull PsiFile file, @NotNull Editor editor) {

}

@Override
public void afterExpand(@NotNull PsiFile file, @NotNull Editor editor) {

}

@Override
public @NotNull PsiFile preCheck(@NotNull PsiFile copyFile, @NotNull Editor realEditor, int currentOffset) {
return copyFile;
}
}

0 comments on commit 1c37c30

Please sign in to comment.