Package org.python.pydev.editor.codecompletion.revisited

Examples of org.python.pydev.editor.codecompletion.revisited.CompletionCache


                        PythonNature nature = PythonNature.getPythonNature(project);
                        String moduleName = nature.resolveModule(file);
                        if (moduleName != null) {
                            IModule mod = nature.getAstManager().getModule(moduleName, nature, true);
                            if (mod != null) {
                                ICompletionCache completionCache = new CompletionCache();
                                IDefinition[] definitions = mod.findDefinition(CompletionStateFactory
                                        .getEmptyCompletionState(testPath, nature, completionCache), -1, -1, nature);

                                if (definitions != null && definitions.length > 0) {
                                    List<ItemPointer> pointers = new ArrayList<ItemPointer>();
View Full Code Here


     * Fills the buffer with the text for docstrings of the selected element.
     */
    @SuppressWarnings("unchecked")
    private void getDocstringHover(IRegion hoverRegion, PySourceViewer s, PySelection ps) {
        //Now, aside from the marker, let's check if there's some definition we should show the user about.
        CompletionCache completionCache = new CompletionCache();
        ArrayList<IDefinition> selected = new ArrayList<IDefinition>();

        PyEdit edit = s.getEdit();
        RefactoringRequest request;
        IPythonNature nature = null;
View Full Code Here

                } else {
                    entry = (IInfo) obj;
                }
                List<ItemPointer> pointers = new ArrayList<ItemPointer>();

                CompletionCache completionCache = new CompletionCache();
                for (IPythonNature pythonNature : pythonNatures) {
                    //try to find in one of the natures...
                    ICodeCompletionASTManager astManager = pythonNature.getAstManager();
                    if (astManager == null) {
                        continue;
View Full Code Here

            PySelection ps = new PySelection(request.doc, request.offsetForKeywordParam);
            RefactoringRequest findRequest = new RefactoringRequest(request.editorFile, ps, new NullProgressMonitor(),
                    request.nature, null);
            ArrayList<IDefinition> selected = new ArrayList<IDefinition>();
            PyRefactoringFindDefinition.findActualDefinition(findRequest, new CompletionCache(), selected);

            //Changed: showing duplicated parameters (only removing self and cls).
            //Tuple<List<String>, Integer> insideParentesisToks = ps.getInsideParentesisToks(false, completionRequestForKeywordParam.documentOffset);
            HashSet<String> ignore = new HashSet<String>();
            ignore.add("self");
View Full Code Here

        fillWithEpydocFields(viewer, request, ret);

        if (ret.size() == 0) {
            //if the size is not 0, it means that this is a place for the '@' stuff, and not for the 'default' context for a string.
            ret.addAll(getStringGlobalsFromParticipants(request, CompletionStateFactory.getEmptyCompletionState(
                    request.activationToken, request.nature, new CompletionCache())));

            //the code-below does not work well because the module may not have an actual import for the activation token,
            //so, it is useless too many times
            //if(request.activationToken.length() != 0){
            //    PyCodeCompletion completion = new PyCodeCompletion();
View Full Code Here

                        tok.append(s);
                    }

                    try {
                        IDefinition[] definitions = mod.findDefinition(CompletionStateFactory.getEmptyCompletionState(
                                tok.toString(), nature, new CompletionCache()), -1, -1, nature);
                        List<ItemPointer> pointers = new ArrayList<ItemPointer>();
                        PyRefactoringFindDefinition.getAsPointers(pointers, (Definition[]) definitions);
                        if (pointers.size() > 0) {
                            new PyOpenAction().run(pointers.get(0));
                        }
View Full Code Here

     * Fills the buffer with the text for docstrings of the selected element.
     */
    @SuppressWarnings("unchecked")
    private void getDocstringHover(IRegion hoverRegion, PySourceViewer s, PySelection ps) {
        //Now, aside from the marker, let's check if there's some definition we should show the user about.
        CompletionCache completionCache = new CompletionCache();
        ArrayList<IDefinition> selected = new ArrayList<IDefinition>();

        PyEdit edit = s.getEdit();
        RefactoringRequest request;
        IPythonNature nature = null;
View Full Code Here

    }

    public boolean checkCreationBasedOnFoundPointers(PyEdit edit, PySelection callPs, List<ICompletionProposal> ret,
            TddPossibleMatches possibleMatch, ItemPointer[] pointers, String methodToCreate, PySelection newSelection,
            IPythonNature nature) throws MisconfigurationException, Exception {
        CompletionCache completionCache = new CompletionCache();
        for (ItemPointer pointer : pointers) {
            Definition definition = pointer.definition;

            try {
                definition = rebaseToClassDefDefinition(nature, completionCache, definition, null);
View Full Code Here

                                        foundFromImportStr = imported;
                                    }
                                    try {
                                        String currentModule = nature.resolveModule(edit.getEditorFile());
                                        ICompletionState state = CompletionStateFactory.getEmptyCompletionState(nature,
                                                new CompletionCache());

                                        found = nature.getAstManager().findModule(
                                                foundFromImportStr,
                                                currentModule,
                                                state,
View Full Code Here

                null, IPyCompletionProposal.PRIORITY_CREATE, edit, PyCreateClass.LOCATION_STRATEGY_BEFORE_CURRENT,
                parametersAfterCall, new PyCreateClass(), ps));
    }

    private ArrayList<IDefinition> findDefinitions(IPythonNature nature, PyEdit edit, int start, IDocument doc) {
        CompletionCache completionCache = new CompletionCache();
        ArrayList<IDefinition> selected = new ArrayList<IDefinition>();

        RefactoringRequest request = new RefactoringRequest(edit.getEditorFile(), new PySelection(doc,
                new TextSelection(doc, start, 0)), new NullProgressMonitor(), nature, edit);
View Full Code Here

TOP

Related Classes of org.python.pydev.editor.codecompletion.revisited.CompletionCache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.