Skip to content

Commit b6999cb

Browse files
committed
change method name
Signed-off-by: Shi Chen <chenshi@microsoft.com>
1 parent b0f3b5b commit b6999cb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/GenerateConstructorsHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public static TextEdit generateConstructors(IType type, LspMethodBinding[] const
165165
ASTNode declarationNode = null;
166166
if (cursor != null) {
167167
ASTNode node = NodeFinder.perform(astRoot, DiagnosticsHelper.getStartOffset(type.getCompilationUnit(), cursor), DiagnosticsHelper.getLength(type.getCompilationUnit(), cursor));
168-
declarationNode = SourceAssistProcessor.getDeclarationNode(node);
168+
declarationNode = SourceAssistProcessor.getBodyDeclarationNode(node);
169169
}
170170
// If cursor position is not specified, then insert to the last by default.
171171
IJavaElement insertPosition = (declarationNode instanceof TypeDeclaration) ? CodeGenerationUtils.findInsertElementAfterLastField(type) : CodeGenerationUtils.findInsertElement(type, cursor);

org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/OverrideMethodsHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static WorkspaceEdit addOverridableMethods(AddOverridableMethodParams par
5151
CompilationUnit astRoot = CoreASTProvider.getInstance().getAST(type.getCompilationUnit(), CoreASTProvider.WAIT_YES, monitor);
5252
if (astRoot != null && range != null) {
5353
ASTNode node = NodeFinder.perform(astRoot, DiagnosticsHelper.getStartOffset(type.getCompilationUnit(), range), DiagnosticsHelper.getLength(type.getCompilationUnit(), range));
54-
declarationNode = SourceAssistProcessor.getDeclarationNode(node);
54+
declarationNode = SourceAssistProcessor.getBodyDeclarationNode(node);
5555
}
5656
// If cursor position is not specified, then insert to the last by default.
5757
IJavaElement insertPosition = (declarationNode instanceof TypeDeclaration) ? CodeGenerationUtils.findInsertElement(type, null) : CodeGenerationUtils.findInsertElement(type, range);

0 commit comments

Comments
 (0)