Search in sources :

Example 1 with IInvocationContext

use of org.eclipse.jdt.ls.core.internal.corrections.IInvocationContext in project eclipse.jdt.ls by eclipse.

the class SourceAssistProcessor method supportsHashCodeEquals.

private boolean supportsHashCodeEquals(IInvocationContext context, IType type, IProgressMonitor monitor) {
    try {
        if (type == null || type.isAnnotation() || type.isInterface() || type.isEnum() || type.getCompilationUnit() == null) {
            return false;
        }
        CompilationUnit astRoot = context.getASTRoot();
        if (astRoot == null) {
            return false;
        }
        ITypeBinding typeBinding = ASTNodes.getTypeBinding(astRoot, type);
        return (typeBinding == null) ? false : Arrays.stream(typeBinding.getDeclaredFields()).filter(f -> !Modifier.isStatic(f.getModifiers())).findAny().isPresent();
    } catch (JavaModelException e) {
        return false;
    }
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) Arrays(java.util.Arrays) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) AbstractTypeDeclaration(org.eclipse.jdt.core.dom.AbstractTypeDeclaration) CoreException(org.eclipse.core.runtime.CoreException) AnonymousClassDeclaration(org.eclipse.jdt.core.dom.AnonymousClassDeclaration) GenerateToStringHandler(org.eclipse.jdt.ls.core.internal.handlers.GenerateToStringHandler) OperationCanceledException(org.eclipse.core.runtime.OperationCanceledException) Statement(org.eclipse.jdt.core.dom.Statement) CodeActionHandler(org.eclipse.jdt.ls.core.internal.handlers.CodeActionHandler) DiagnosticsHelper(org.eclipse.jdt.ls.core.internal.corrections.DiagnosticsHelper) Either(org.eclipse.lsp4j.jsonrpc.messages.Either) VariableDeclarationFixCore(org.eclipse.jdt.internal.corext.fix.VariableDeclarationFixCore) CodeActionProposal(org.eclipse.jdt.ls.core.internal.handlers.CodeActionProposal) OrganizeImportsHandler(org.eclipse.jdt.ls.core.internal.handlers.OrganizeImportsHandler) ASTNodes(org.eclipse.jdt.internal.corext.dom.ASTNodes) CodeAction(org.eclipse.lsp4j.CodeAction) ASTNode(org.eclipse.jdt.core.dom.ASTNode) JDTUtils(org.eclipse.jdt.ls.core.internal.JDTUtils) IProposalRelevance(org.eclipse.jdt.ls.core.internal.corrections.proposals.IProposalRelevance) FixCorrectionProposal(org.eclipse.jdt.ls.core.internal.corrections.proposals.FixCorrectionProposal) Set(java.util.Set) BodyDeclaration(org.eclipse.jdt.core.dom.BodyDeclaration) TextEditConverter(org.eclipse.jdt.ls.core.internal.TextEditConverter) Sets(com.google.common.collect.Sets) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) GenerateDelegateMethodsHandler(org.eclipse.jdt.ls.core.internal.handlers.GenerateDelegateMethodsHandler) IType(org.eclipse.jdt.core.IType) IProposableFix(org.eclipse.jdt.internal.corext.fix.IProposableFix) IInvocationContext(org.eclipse.jdt.ls.core.internal.corrections.IInvocationContext) IProblemLocationCore(org.eclipse.jdt.internal.ui.text.correction.IProblemLocationCore) List(java.util.List) Stream(java.util.stream.Stream) Command(org.eclipse.lsp4j.Command) Modifier(java.lang.reflect.Modifier) InnovationContext(org.eclipse.jdt.ls.core.internal.corrections.InnovationContext) Optional(java.util.Optional) ChangeUtil(org.eclipse.jdt.ls.core.internal.ChangeUtil) GenerateGetterSetterOperation(org.eclipse.jdt.ls.core.internal.codemanipulation.GenerateGetterSetterOperation) IField(org.eclipse.jdt.core.IField) JavaModelException(org.eclipse.jdt.core.JavaModelException) JavaCodeActionKind(org.eclipse.jdt.ls.core.internal.JavaCodeActionKind) CodeGenerationUtils(org.eclipse.jdt.ls.core.internal.handlers.CodeGenerationUtils) CorrectionMessages(org.eclipse.jdt.ls.core.internal.corrections.CorrectionMessages) CodeActionContext(org.eclipse.lsp4j.CodeActionContext) ArrayList(java.util.ArrayList) CodeActionParams(org.eclipse.lsp4j.CodeActionParams) OrganizeImportsOperation(org.eclipse.jdt.core.manipulation.OrganizeImportsOperation) GenerateConstructorsHandler(org.eclipse.jdt.ls.core.internal.handlers.GenerateConstructorsHandler) ImportDeclaration(org.eclipse.jdt.core.dom.ImportDeclaration) CheckConstructorsResponse(org.eclipse.jdt.ls.core.internal.handlers.GenerateConstructorsHandler.CheckConstructorsResponse) AccessorField(org.eclipse.jdt.ls.core.internal.codemanipulation.GenerateGetterSetterOperation.AccessorField) JdtFlags(org.eclipse.jdt.internal.corext.util.JdtFlags) TypeDeclaration(org.eclipse.jdt.core.dom.TypeDeclaration) LspVariableBinding(org.eclipse.jdt.ls.core.internal.handlers.JdtDomModels.LspVariableBinding) JavaLanguageServerPlugin(org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin) TextEdit(org.eclipse.text.edits.TextEdit) ITypeBinding(org.eclipse.jdt.core.dom.ITypeBinding) PreferenceManager(org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager) CoreASTProvider(org.eclipse.jdt.core.manipulation.CoreASTProvider) IJavaElement(org.eclipse.jdt.core.IJavaElement) WorkspaceEdit(org.eclipse.lsp4j.WorkspaceEdit) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) CodeActionKind(org.eclipse.lsp4j.CodeActionKind) Collections(java.util.Collections) JavaModelException(org.eclipse.jdt.core.JavaModelException) ITypeBinding(org.eclipse.jdt.core.dom.ITypeBinding)

Example 2 with IInvocationContext

use of org.eclipse.jdt.ls.core.internal.corrections.IInvocationContext in project eclipse.jdt.ls by eclipse.

the class SourceAssistProcessor method getSourceActionCommands.

public List<Either<Command, CodeAction>> getSourceActionCommands(CodeActionParams params, IInvocationContext context, IProblemLocationCore[] locations, IProgressMonitor monitor) {
    List<Either<Command, CodeAction>> $ = new ArrayList<>();
    ICompilationUnit cu = context.getCompilationUnit();
    IType type = getSelectionType(context);
    boolean isInTypeDeclaration = isInTypeDeclaration(context);
    boolean isInImportDeclaration = isInImportDeclaration(context);
    try {
        // Generate Constructor QuickAssist
        IJavaElement element = JDTUtils.findElementAtSelection(cu, params.getRange().getEnd().getLine(), params.getRange().getEnd().getCharacter(), this.preferenceManager, new NullProgressMonitor());
        if (element instanceof IField || isInTypeDeclaration) {
            Optional<Either<Command, CodeAction>> quickAssistGenerateConstructors = getGenerateConstructorsAction(params, context, type, JavaCodeActionKind.QUICK_ASSIST, monitor);
            addSourceActionCommand($, params.getContext(), quickAssistGenerateConstructors);
        }
    } catch (JavaModelException e) {
        JavaLanguageServerPlugin.logException(e);
    }
    // Generate Constructor Source Action
    Optional<Either<Command, CodeAction>> sourceGenerateConstructors = getGenerateConstructorsAction(params, context, type, JavaCodeActionKind.SOURCE_GENERATE_CONSTRUCTORS, monitor);
    addSourceActionCommand($, params.getContext(), sourceGenerateConstructors);
    // Organize Imports
    if (preferenceManager.getClientPreferences().isAdvancedOrganizeImportsSupported()) {
        // Generate QuickAssist
        if (isInImportDeclaration) {
            Optional<Either<Command, CodeAction>> quickAssistOrganizeImports = getOrganizeImportsAction(params, JavaCodeActionKind.QUICK_ASSIST);
            addSourceActionCommand($, params.getContext(), quickAssistOrganizeImports);
        }
        // Generate Source Action
        Optional<Either<Command, CodeAction>> sourceOrganizeImports = getOrganizeImportsAction(params, CodeActionKind.SourceOrganizeImports);
        addSourceActionCommand($, params.getContext(), sourceOrganizeImports);
    } else {
        CodeActionProposal organizeImportsProposal = (pm) -> {
            TextEdit edit = getOrganizeImportsProposal(context, pm);
            return convertToWorkspaceEdit(cu, edit);
        };
        // Generate QuickAssist
        if (isInImportDeclaration) {
            Optional<Either<Command, CodeAction>> sourceOrganizeImports = getCodeActionFromProposal(params.getContext(), context.getCompilationUnit(), CorrectionMessages.ReorgCorrectionsSubProcessor_organizeimports_description, JavaCodeActionKind.QUICK_ASSIST, organizeImportsProposal);
            addSourceActionCommand($, params.getContext(), sourceOrganizeImports);
        }
        // Generate Source Action
        Optional<Either<Command, CodeAction>> sourceOrganizeImports = getCodeActionFromProposal(params.getContext(), context.getCompilationUnit(), CorrectionMessages.ReorgCorrectionsSubProcessor_organizeimports_description, CodeActionKind.SourceOrganizeImports, organizeImportsProposal);
        addSourceActionCommand($, params.getContext(), sourceOrganizeImports);
    }
    if (!UNSUPPORTED_RESOURCES.contains(cu.getResource().getName())) {
        // Override/Implement Methods QuickAssist
        if (isInTypeDeclaration) {
            Optional<Either<Command, CodeAction>> quickAssistOverrideMethods = getOverrideMethodsAction(params, JavaCodeActionKind.QUICK_ASSIST);
            addSourceActionCommand($, params.getContext(), quickAssistOverrideMethods);
        }
        // Override/Implement Methods Source Action
        Optional<Either<Command, CodeAction>> sourceOverrideMethods = getOverrideMethodsAction(params, JavaCodeActionKind.SOURCE_OVERRIDE_METHODS);
        addSourceActionCommand($, params.getContext(), sourceOverrideMethods);
    }
    // Generate Getter and Setter QuickAssist
    if (isInTypeDeclaration) {
        Optional<Either<Command, CodeAction>> quickAssistGetterSetter = getGetterSetterAction(params, context, type, JavaCodeActionKind.QUICK_ASSIST, isInTypeDeclaration);
        addSourceActionCommand($, params.getContext(), quickAssistGetterSetter);
    }
    // Generate Getter and Setter Source Action
    Optional<Either<Command, CodeAction>> sourceGetterSetter = getGetterSetterAction(params, context, type, JavaCodeActionKind.SOURCE_GENERATE_ACCESSORS, isInTypeDeclaration);
    addSourceActionCommand($, params.getContext(), sourceGetterSetter);
    // Generate hashCode() and equals()
    if (supportsHashCodeEquals(context, type, monitor)) {
        // Generate QuickAssist
        if (isInTypeDeclaration) {
            Optional<Either<Command, CodeAction>> quickAssistHashCodeEquals = getHashCodeEqualsAction(params, JavaCodeActionKind.QUICK_ASSIST);
            addSourceActionCommand($, params.getContext(), quickAssistHashCodeEquals);
        }
        // Generate Source Action
        Optional<Either<Command, CodeAction>> sourceActionHashCodeEquals = getHashCodeEqualsAction(params, JavaCodeActionKind.SOURCE_GENERATE_HASHCODE_EQUALS);
        addSourceActionCommand($, params.getContext(), sourceActionHashCodeEquals);
    }
    // Generate toString()
    if (supportsGenerateToString(type)) {
        boolean nonStaticFields = true;
        try {
            nonStaticFields = hasFields(type, false);
        } catch (JavaModelException e) {
        // do nothing.
        }
        if (nonStaticFields) {
            // Generate QuickAssist
            if (isInTypeDeclaration) {
                Optional<Either<Command, CodeAction>> generateToStringQuickAssist = getGenerateToStringAction(params, JavaCodeActionKind.QUICK_ASSIST);
                addSourceActionCommand($, params.getContext(), generateToStringQuickAssist);
            }
            // Generate Source Action
            Optional<Either<Command, CodeAction>> generateToStringCommand = getGenerateToStringAction(params, JavaCodeActionKind.SOURCE_GENERATE_TO_STRING);
            addSourceActionCommand($, params.getContext(), generateToStringCommand);
        } else {
            CodeActionProposal generateToStringProposal = (pm) -> {
                IJavaElement insertPosition = isInTypeDeclaration ? CodeGenerationUtils.findInsertElement(type, null) : CodeGenerationUtils.findInsertElement(type, context.getSelectionOffset());
                TextEdit edit = GenerateToStringHandler.generateToString(type, new LspVariableBinding[0], insertPosition, pm);
                return convertToWorkspaceEdit(cu, edit);
            };
            // Generate QuickAssist
            if (isInTypeDeclaration) {
                Optional<Either<Command, CodeAction>> generateToStringQuickAssist = getCodeActionFromProposal(params.getContext(), context.getCompilationUnit(), ActionMessages.GenerateToStringAction_label, JavaCodeActionKind.QUICK_ASSIST, generateToStringProposal);
                addSourceActionCommand($, params.getContext(), generateToStringQuickAssist);
            }
            // Generate Source Action
            Optional<Either<Command, CodeAction>> generateToStringCommand = getCodeActionFromProposal(params.getContext(), context.getCompilationUnit(), ActionMessages.GenerateToStringAction_label, JavaCodeActionKind.SOURCE_GENERATE_TO_STRING, generateToStringProposal);
            addSourceActionCommand($, params.getContext(), generateToStringCommand);
        }
    }
    // Generate Delegate Methods
    Optional<Either<Command, CodeAction>> generateDelegateMethods = getGenerateDelegateMethodsAction(params, context, type);
    addSourceActionCommand($, params.getContext(), generateDelegateMethods);
    // Add final modifiers where possible
    Optional<Either<Command, CodeAction>> generateFinalModifiers = addFinalModifierWherePossibleAction(context);
    addSourceActionCommand($, params.getContext(), generateFinalModifiers);
    return $;
}
Also used : CodeActionProposal(org.eclipse.jdt.ls.core.internal.handlers.CodeActionProposal) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) Arrays(java.util.Arrays) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) AbstractTypeDeclaration(org.eclipse.jdt.core.dom.AbstractTypeDeclaration) CoreException(org.eclipse.core.runtime.CoreException) AnonymousClassDeclaration(org.eclipse.jdt.core.dom.AnonymousClassDeclaration) GenerateToStringHandler(org.eclipse.jdt.ls.core.internal.handlers.GenerateToStringHandler) OperationCanceledException(org.eclipse.core.runtime.OperationCanceledException) Statement(org.eclipse.jdt.core.dom.Statement) CodeActionHandler(org.eclipse.jdt.ls.core.internal.handlers.CodeActionHandler) DiagnosticsHelper(org.eclipse.jdt.ls.core.internal.corrections.DiagnosticsHelper) Either(org.eclipse.lsp4j.jsonrpc.messages.Either) VariableDeclarationFixCore(org.eclipse.jdt.internal.corext.fix.VariableDeclarationFixCore) CodeActionProposal(org.eclipse.jdt.ls.core.internal.handlers.CodeActionProposal) OrganizeImportsHandler(org.eclipse.jdt.ls.core.internal.handlers.OrganizeImportsHandler) ASTNodes(org.eclipse.jdt.internal.corext.dom.ASTNodes) CodeAction(org.eclipse.lsp4j.CodeAction) ASTNode(org.eclipse.jdt.core.dom.ASTNode) JDTUtils(org.eclipse.jdt.ls.core.internal.JDTUtils) IProposalRelevance(org.eclipse.jdt.ls.core.internal.corrections.proposals.IProposalRelevance) FixCorrectionProposal(org.eclipse.jdt.ls.core.internal.corrections.proposals.FixCorrectionProposal) Set(java.util.Set) BodyDeclaration(org.eclipse.jdt.core.dom.BodyDeclaration) TextEditConverter(org.eclipse.jdt.ls.core.internal.TextEditConverter) Sets(com.google.common.collect.Sets) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) GenerateDelegateMethodsHandler(org.eclipse.jdt.ls.core.internal.handlers.GenerateDelegateMethodsHandler) IType(org.eclipse.jdt.core.IType) IProposableFix(org.eclipse.jdt.internal.corext.fix.IProposableFix) IInvocationContext(org.eclipse.jdt.ls.core.internal.corrections.IInvocationContext) IProblemLocationCore(org.eclipse.jdt.internal.ui.text.correction.IProblemLocationCore) List(java.util.List) Stream(java.util.stream.Stream) Command(org.eclipse.lsp4j.Command) Modifier(java.lang.reflect.Modifier) InnovationContext(org.eclipse.jdt.ls.core.internal.corrections.InnovationContext) Optional(java.util.Optional) ChangeUtil(org.eclipse.jdt.ls.core.internal.ChangeUtil) GenerateGetterSetterOperation(org.eclipse.jdt.ls.core.internal.codemanipulation.GenerateGetterSetterOperation) IField(org.eclipse.jdt.core.IField) JavaModelException(org.eclipse.jdt.core.JavaModelException) JavaCodeActionKind(org.eclipse.jdt.ls.core.internal.JavaCodeActionKind) CodeGenerationUtils(org.eclipse.jdt.ls.core.internal.handlers.CodeGenerationUtils) CorrectionMessages(org.eclipse.jdt.ls.core.internal.corrections.CorrectionMessages) CodeActionContext(org.eclipse.lsp4j.CodeActionContext) ArrayList(java.util.ArrayList) CodeActionParams(org.eclipse.lsp4j.CodeActionParams) OrganizeImportsOperation(org.eclipse.jdt.core.manipulation.OrganizeImportsOperation) GenerateConstructorsHandler(org.eclipse.jdt.ls.core.internal.handlers.GenerateConstructorsHandler) ImportDeclaration(org.eclipse.jdt.core.dom.ImportDeclaration) CheckConstructorsResponse(org.eclipse.jdt.ls.core.internal.handlers.GenerateConstructorsHandler.CheckConstructorsResponse) AccessorField(org.eclipse.jdt.ls.core.internal.codemanipulation.GenerateGetterSetterOperation.AccessorField) JdtFlags(org.eclipse.jdt.internal.corext.util.JdtFlags) TypeDeclaration(org.eclipse.jdt.core.dom.TypeDeclaration) LspVariableBinding(org.eclipse.jdt.ls.core.internal.handlers.JdtDomModels.LspVariableBinding) JavaLanguageServerPlugin(org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin) TextEdit(org.eclipse.text.edits.TextEdit) ITypeBinding(org.eclipse.jdt.core.dom.ITypeBinding) PreferenceManager(org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager) CoreASTProvider(org.eclipse.jdt.core.manipulation.CoreASTProvider) IJavaElement(org.eclipse.jdt.core.IJavaElement) WorkspaceEdit(org.eclipse.lsp4j.WorkspaceEdit) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) CodeActionKind(org.eclipse.lsp4j.CodeActionKind) Collections(java.util.Collections) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) IJavaElement(org.eclipse.jdt.core.IJavaElement) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) JavaModelException(org.eclipse.jdt.core.JavaModelException) LspVariableBinding(org.eclipse.jdt.ls.core.internal.handlers.JdtDomModels.LspVariableBinding) ArrayList(java.util.ArrayList) IField(org.eclipse.jdt.core.IField) IType(org.eclipse.jdt.core.IType) TextEdit(org.eclipse.text.edits.TextEdit) Either(org.eclipse.lsp4j.jsonrpc.messages.Either)

Example 3 with IInvocationContext

use of org.eclipse.jdt.ls.core.internal.corrections.IInvocationContext in project eclipse.jdt.ls by eclipse.

the class SourceAssistProcessor method getGenerateConstructorsAction.

private Optional<Either<Command, CodeAction>> getGenerateConstructorsAction(CodeActionParams params, IInvocationContext context, IType type, String kind, IProgressMonitor monitor) {
    try {
        if (type == null || type.isAnnotation() || type.isInterface() || type.isAnonymous() || type.getCompilationUnit() == null) {
            return Optional.empty();
        }
    } catch (JavaModelException e) {
        return Optional.empty();
    }
    if (preferenceManager.getClientPreferences().isGenerateConstructorsPromptSupported()) {
        CheckConstructorsResponse status = GenerateConstructorsHandler.checkConstructorStatus(type, monitor);
        if (status.constructors.length == 0) {
            return Optional.empty();
        }
        if (status.constructors.length == 1 && status.fields.length == 0) {
            CodeActionProposal generateConstructorsProposal = (pm) -> {
                TextEdit edit = GenerateConstructorsHandler.generateConstructors(type, status.constructors, status.fields, params.getRange(), pm);
                return convertToWorkspaceEdit(type.getCompilationUnit(), edit);
            };
            return getCodeActionFromProposal(params.getContext(), type.getCompilationUnit(), ActionMessages.GenerateConstructorsAction_label, kind, generateConstructorsProposal);
        }
        Command command = new Command(ActionMessages.GenerateConstructorsAction_ellipsisLabel, COMMAND_ID_ACTION_GENERATECONSTRUCTORSPROMPT, Collections.singletonList(params));
        if (preferenceManager.getClientPreferences().isSupportedCodeActionKind(JavaCodeActionKind.SOURCE_GENERATE_CONSTRUCTORS)) {
            CodeAction codeAction = new CodeAction(ActionMessages.GenerateConstructorsAction_ellipsisLabel);
            codeAction.setKind(kind);
            codeAction.setCommand(command);
            codeAction.setDiagnostics(Collections.emptyList());
            return Optional.of(Either.forRight(codeAction));
        } else {
            return Optional.of(Either.forLeft(command));
        }
    }
    return Optional.empty();
}
Also used : CodeActionProposal(org.eclipse.jdt.ls.core.internal.handlers.CodeActionProposal) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) Arrays(java.util.Arrays) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) AbstractTypeDeclaration(org.eclipse.jdt.core.dom.AbstractTypeDeclaration) CoreException(org.eclipse.core.runtime.CoreException) AnonymousClassDeclaration(org.eclipse.jdt.core.dom.AnonymousClassDeclaration) GenerateToStringHandler(org.eclipse.jdt.ls.core.internal.handlers.GenerateToStringHandler) OperationCanceledException(org.eclipse.core.runtime.OperationCanceledException) Statement(org.eclipse.jdt.core.dom.Statement) CodeActionHandler(org.eclipse.jdt.ls.core.internal.handlers.CodeActionHandler) DiagnosticsHelper(org.eclipse.jdt.ls.core.internal.corrections.DiagnosticsHelper) Either(org.eclipse.lsp4j.jsonrpc.messages.Either) VariableDeclarationFixCore(org.eclipse.jdt.internal.corext.fix.VariableDeclarationFixCore) CodeActionProposal(org.eclipse.jdt.ls.core.internal.handlers.CodeActionProposal) OrganizeImportsHandler(org.eclipse.jdt.ls.core.internal.handlers.OrganizeImportsHandler) ASTNodes(org.eclipse.jdt.internal.corext.dom.ASTNodes) CodeAction(org.eclipse.lsp4j.CodeAction) ASTNode(org.eclipse.jdt.core.dom.ASTNode) JDTUtils(org.eclipse.jdt.ls.core.internal.JDTUtils) IProposalRelevance(org.eclipse.jdt.ls.core.internal.corrections.proposals.IProposalRelevance) FixCorrectionProposal(org.eclipse.jdt.ls.core.internal.corrections.proposals.FixCorrectionProposal) Set(java.util.Set) BodyDeclaration(org.eclipse.jdt.core.dom.BodyDeclaration) TextEditConverter(org.eclipse.jdt.ls.core.internal.TextEditConverter) Sets(com.google.common.collect.Sets) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) GenerateDelegateMethodsHandler(org.eclipse.jdt.ls.core.internal.handlers.GenerateDelegateMethodsHandler) IType(org.eclipse.jdt.core.IType) IProposableFix(org.eclipse.jdt.internal.corext.fix.IProposableFix) IInvocationContext(org.eclipse.jdt.ls.core.internal.corrections.IInvocationContext) IProblemLocationCore(org.eclipse.jdt.internal.ui.text.correction.IProblemLocationCore) List(java.util.List) Stream(java.util.stream.Stream) Command(org.eclipse.lsp4j.Command) Modifier(java.lang.reflect.Modifier) InnovationContext(org.eclipse.jdt.ls.core.internal.corrections.InnovationContext) Optional(java.util.Optional) ChangeUtil(org.eclipse.jdt.ls.core.internal.ChangeUtil) GenerateGetterSetterOperation(org.eclipse.jdt.ls.core.internal.codemanipulation.GenerateGetterSetterOperation) IField(org.eclipse.jdt.core.IField) JavaModelException(org.eclipse.jdt.core.JavaModelException) JavaCodeActionKind(org.eclipse.jdt.ls.core.internal.JavaCodeActionKind) CodeGenerationUtils(org.eclipse.jdt.ls.core.internal.handlers.CodeGenerationUtils) CorrectionMessages(org.eclipse.jdt.ls.core.internal.corrections.CorrectionMessages) CodeActionContext(org.eclipse.lsp4j.CodeActionContext) ArrayList(java.util.ArrayList) CodeActionParams(org.eclipse.lsp4j.CodeActionParams) OrganizeImportsOperation(org.eclipse.jdt.core.manipulation.OrganizeImportsOperation) GenerateConstructorsHandler(org.eclipse.jdt.ls.core.internal.handlers.GenerateConstructorsHandler) ImportDeclaration(org.eclipse.jdt.core.dom.ImportDeclaration) CheckConstructorsResponse(org.eclipse.jdt.ls.core.internal.handlers.GenerateConstructorsHandler.CheckConstructorsResponse) AccessorField(org.eclipse.jdt.ls.core.internal.codemanipulation.GenerateGetterSetterOperation.AccessorField) JdtFlags(org.eclipse.jdt.internal.corext.util.JdtFlags) TypeDeclaration(org.eclipse.jdt.core.dom.TypeDeclaration) LspVariableBinding(org.eclipse.jdt.ls.core.internal.handlers.JdtDomModels.LspVariableBinding) JavaLanguageServerPlugin(org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin) TextEdit(org.eclipse.text.edits.TextEdit) ITypeBinding(org.eclipse.jdt.core.dom.ITypeBinding) PreferenceManager(org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager) CoreASTProvider(org.eclipse.jdt.core.manipulation.CoreASTProvider) IJavaElement(org.eclipse.jdt.core.IJavaElement) WorkspaceEdit(org.eclipse.lsp4j.WorkspaceEdit) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) CodeActionKind(org.eclipse.lsp4j.CodeActionKind) Collections(java.util.Collections) JavaModelException(org.eclipse.jdt.core.JavaModelException) Command(org.eclipse.lsp4j.Command) TextEdit(org.eclipse.text.edits.TextEdit) CodeAction(org.eclipse.lsp4j.CodeAction) CheckConstructorsResponse(org.eclipse.jdt.ls.core.internal.handlers.GenerateConstructorsHandler.CheckConstructorsResponse)

Aggregations

Sets (com.google.common.collect.Sets)3 Modifier (java.lang.reflect.Modifier)3 ArrayList (java.util.ArrayList)3 Arrays (java.util.Arrays)3 Collections (java.util.Collections)3 List (java.util.List)3 Optional (java.util.Optional)3 Set (java.util.Set)3 Stream (java.util.stream.Stream)3 CoreException (org.eclipse.core.runtime.CoreException)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)3 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)3 ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)3 IField (org.eclipse.jdt.core.IField)3 IJavaElement (org.eclipse.jdt.core.IJavaElement)3 IType (org.eclipse.jdt.core.IType)3 JavaModelException (org.eclipse.jdt.core.JavaModelException)3 ASTNode (org.eclipse.jdt.core.dom.ASTNode)3 AbstractTypeDeclaration (org.eclipse.jdt.core.dom.AbstractTypeDeclaration)3