Skip to content

Commit

Permalink
Move IAssistProps to core
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Sep 1, 2024
1 parent 03225df commit 361a15c
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@
*
* @author Fabio Zadrozny
*/
package org.python.pydev.editor.correctionassist;
package org.python.pydev.core;

import java.io.File;
import java.util.List;

import org.eclipse.jface.text.BadLocationException;
import org.python.pydev.core.IPyEdit;
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.MisconfigurationException;
import org.python.pydev.core.docutils.PySelection;
import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle;
import org.python.pydev.shared_core.image.IImageCache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import java.util.List;

import org.eclipse.jface.text.BadLocationException;
import org.python.pydev.core.IAssistProps;
import org.python.pydev.core.IPyEdit;
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.MisconfigurationException;
import org.python.pydev.core.docutils.PySelection;
import org.python.pydev.core.proposals.CompletionProposalFactory;
import org.python.pydev.debug.ui.DebugPrefsPage;
import org.python.pydev.editor.correctionassist.IAssistProps;
import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle;
import org.python.pydev.shared_core.code_completion.IPyCompletionProposal;
import org.python.pydev.shared_core.image.IImageCache;
Expand Down
6 changes: 3 additions & 3 deletions plugins/org.python.pydev/schema/pydev_ctrl_1.exsd
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<attribute name="class" type="string" use="required">
<annotation>
<documentation>
must implement the interface org.python.pydev.editor.correctionassist.IAssistProps
must implement the interface org.python.pydev.core.IAssistProps
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
Expand Down Expand Up @@ -78,7 +78,7 @@
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;builder_participant class=&quot;my.AssistAddition&quot;/&amp;gt;&lt;br&gt;
&amp;lt;/extension&amp;gt;&lt;br&gt;
&lt;br&gt;
and my.AssistAddition must implement org.python.pydev.editor.correctionassist.IAssistProps.
and my.AssistAddition must implement org.python.pydev.core.IAssistProps.

To get the problem markers at some line, the code below can be used:&lt;br&gt;
&lt;br&gt;
Expand All @@ -105,7 +105,7 @@ To get the problem markers at some line, the code below can be used:&lt;br&gt;
<meta.section type="apiInfo"/>
</appInfo>
<documentation>
See org.python.pydev.editor.correctionassist.IAssistProps for more details.&lt;br&gt;
See org.python.pydev.core.IAssistProps for more details.&lt;br&gt;
&lt;br&gt;
It gives an option to see if the completions in a given line are valid (with IAssistProps.isValid) and asks for the completions to apply (IAssistProps.getProps).
</documentation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

import org.eclipse.jface.text.BadLocationException;
import org.python.pydev.ast.analysis.IAnalysisPreferences;
import org.python.pydev.core.IAssistProps;
import org.python.pydev.core.IPyEdit;
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.docutils.PySelection;
import org.python.pydev.core.log.Log;
import org.python.pydev.editor.PyEdit;
import org.python.pydev.editor.codefolding.MarkerAnnotationAndPosition;
import org.python.pydev.editor.codefolding.PySourceViewer;
import org.python.pydev.editor.correctionassist.IAssistProps;
import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle;
import org.python.pydev.shared_core.image.IImageCache;
import org.python.pydev.shared_core.structure.OrderedSet;
Expand Down Expand Up @@ -81,7 +81,7 @@ public List<ICompletionProposalHandle> getProps(PySelection ps, IImageCache imag
/**
* It is valid if any marker generated from the analysis is found
*
* @see org.python.pydev.editor.correctionassist.IAssistProps#isValid(org.python.pydev.core.docutils.PySelection, java.lang.String, org.python.pydev.editor.PyEdit, int)
* @see org.python.pydev.core.IAssistProps#isValid(org.python.pydev.core.docutils.PySelection, java.lang.String, org.python.pydev.editor.PyEdit, int)
*/
@Override
public boolean isValid(PySelection ps, String sel, IPyEdit edit, int offset) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
import java.util.List;

import org.eclipse.jface.text.BadLocationException;
import org.python.pydev.core.IAssistProps;
import org.python.pydev.core.IPyEdit;
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.docutils.PySelection;
import org.python.pydev.core.proposals.CompletionProposalFactory;
import org.python.pydev.editor.correctionassist.IAssistProps;
import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle;
import org.python.pydev.shared_core.code_completion.IPyCompletionProposal;
import org.python.pydev.shared_core.image.IImageCache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.eclipse.ui.texteditor.spelling.SpellingProblem;
import org.python.pydev.ast.codecompletion.ProposalsComparator;
import org.python.pydev.core.ExtensionHelper;
import org.python.pydev.core.IAssistProps;
import org.python.pydev.core.IPySyntaxHighlightingAndCodeCompletionEditor;
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.MisconfigurationException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
import java.util.regex.Pattern;

import org.eclipse.jface.text.BadLocationException;
import org.python.pydev.core.IAssistProps;
import org.python.pydev.core.IPyEdit;
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.autoedit.DefaultIndentPrefs;
import org.python.pydev.core.docstrings.DocstringPreferences;
import org.python.pydev.core.docutils.PySelection;
import org.python.pydev.core.docutils.PySelection.DocstringInfo;
import org.python.pydev.core.proposals.CompletionProposalFactory;
import org.python.pydev.editor.correctionassist.IAssistProps;
import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle;
import org.python.pydev.shared_core.code_completion.IPyCompletionProposal;
import org.python.pydev.shared_core.image.IImageCache;
Expand All @@ -57,7 +57,7 @@ public AssistDocString(String docStringStyle) {
}

/**
* @see org.python.pydev.editor.correctionassist.IAssistProps#getProps(org.python.pydev.core.docutils.PySelection,
* @see org.python.pydev.core.IAssistProps#getProps(org.python.pydev.core.docutils.PySelection,
* org.python.pydev.shared_ui.ImageCache)
*/
@Override
Expand Down Expand Up @@ -135,7 +135,7 @@ public ParamInfo() {
}

/**
* @see org.python.pydev.editor.correctionassist.IAssistProps#isValid(org.python.pydev.core.docutils.PySelection,
* @see org.python.pydev.core.IAssistProps#isValid(org.python.pydev.core.docutils.PySelection,
* java.lang.String)
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.source.ISourceViewer;
import org.python.pydev.codingstd.ICodingStd;
import org.python.pydev.core.IAssistProps;
import org.python.pydev.core.IPyEdit;
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.docutils.ParsingUtils;
Expand All @@ -28,7 +29,6 @@
import org.python.pydev.core.proposals.CompletionProposalFactory;
import org.python.pydev.editor.PyEdit;
import org.python.pydev.editor.codefolding.PySourceViewer;
import org.python.pydev.editor.correctionassist.IAssistProps;
import org.python.pydev.plugin.preferences.PyCodeStylePreferencesPage;
import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle;
import org.python.pydev.shared_core.code_completion.IPyCompletionProposal;
Expand Down Expand Up @@ -69,7 +69,7 @@ private IImageHandle getImage(IImageCache imageCache, String c) {
}

/**
* @see org.python.pydev.editor.correctionassist.IAssistProps#getProps
* @see org.python.pydev.core.IAssistProps#getProps
*/
@Override
public List<ICompletionProposalHandle> getProps(PySelection ps, IImageCache imageCache, File f,
Expand All @@ -87,7 +87,7 @@ public List<ICompletionProposalHandle> getProps(PySelection ps, IImageCache imag
/**
* Actual implementation (receiving a source viewer and only the actually used parameters).
*
* @see org.python.pydev.editor.correctionassist.IAssistProps#getProps
* @see org.python.pydev.core.IAssistProps#getProps
*
* @param lineWithoutComments the line that should be checked (without any comments)
*/
Expand Down Expand Up @@ -167,7 +167,7 @@ private String changeToCodingStd(String callName) {
}

/**
* @see org.python.pydev.editor.correctionassist.IAssistProps#isValid
* @see org.python.pydev.core.IAssistProps#isValid
*/
@Override
public boolean isValid(PySelection ps, String sel, IPyEdit edit, int offset) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITypedRegion;
import org.python.pydev.core.IAssistProps;
import org.python.pydev.core.IPyEdit;
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.MisconfigurationException;
Expand All @@ -15,7 +16,6 @@
import org.python.pydev.core.docutils.SyntaxErrorException;
import org.python.pydev.core.partition.PyPartitionScanner;
import org.python.pydev.core.proposals.CompletionProposalFactory;
import org.python.pydev.editor.correctionassist.IAssistProps;
import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle;
import org.python.pydev.shared_core.code_completion.IPyCompletionProposal;
import org.python.pydev.shared_core.image.IImageCache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
import java.util.List;

import org.eclipse.jface.text.BadLocationException;
import org.python.pydev.core.IAssistProps;
import org.python.pydev.core.IPyEdit;
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.docutils.PySelection;
import org.python.pydev.core.imports.ImportPreferences;
import org.python.pydev.core.proposals.CompletionProposalFactory;
import org.python.pydev.editor.correctionassist.IAssistProps;
import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle;
import org.python.pydev.shared_core.code_completion.IPyCompletionProposal;
import org.python.pydev.shared_core.image.IImageCache;
Expand All @@ -34,7 +34,7 @@
public class AssistImport implements IAssistProps {

/**
* @see org.python.pydev.editor.correctionassist.IAssistProps#getProps(org.python.pydev.core.docutils.PySelection, org.python.pydev.shared_ui.ImageCache)
* @see org.python.pydev.core.IAssistProps#getProps(org.python.pydev.core.docutils.PySelection, org.python.pydev.shared_ui.ImageCache)
*/
@Override
public List<ICompletionProposalHandle> getProps(PySelection ps, IImageCache imageCache, File f,
Expand Down Expand Up @@ -90,7 +90,7 @@ public List<ICompletionProposalHandle> getProps(PySelection ps, IImageCache imag
}

/**
* @see org.python.pydev.editor.correctionassist.IAssistProps#isValid(org.python.pydev.core.docutils.PySelection)
* @see org.python.pydev.core.IAssistProps#isValid(org.python.pydev.core.docutils.PySelection)
*/
@Override
public boolean isValid(PySelection ps, String sel, IPyEdit edit, int offset) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.text.BadLocationException;
import org.python.pydev.ast.refactoring.RefactoringRequest;
import org.python.pydev.core.IAssistProps;
import org.python.pydev.core.IPyEdit;
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.MisconfigurationException;
Expand All @@ -18,7 +19,6 @@
import org.python.pydev.core.proposals.CompletionProposalFactory;
import org.python.pydev.editor.PyEdit;
import org.python.pydev.editor.actions.refactoring.PyRefactorAction;
import org.python.pydev.editor.correctionassist.IAssistProps;
import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle;
import org.python.pydev.shared_core.image.IImageCache;
import org.python.pydev.shared_core.image.UIConstants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
import org.eclipse.jface.text.templates.TemplateContext;
import org.python.pydev.ast.codecompletion.AbstractTemplateCodeCompletion;
import org.python.pydev.ast.codecompletion.CompletionRequest;
import org.python.pydev.core.IAssistProps;
import org.python.pydev.core.IPyEdit;
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.TokensOrProposalsList;
import org.python.pydev.core.docutils.PySelection;
import org.python.pydev.core.proposals.CompletionProposalFactory;
import org.python.pydev.editor.correctionassist.IAssistProps;
import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle;
import org.python.pydev.shared_core.image.IImageCache;
import org.python.pydev.shared_core.image.UIConstants;
Expand All @@ -43,7 +43,7 @@ public class AssistPercentToFormat extends AbstractTemplateCodeCompletion implem
private static final boolean DEBUG = false;

/**
* @see org.python.pydev.editor.correctionassist.IAssistProps#getProps(org.python.pydev.core.docutils.PySelection,
* @see org.python.pydev.core.IAssistProps#getProps(org.python.pydev.core.docutils.PySelection,
* org.python.pydev.shared_ui.ImageCache)
*/
@Override
Expand Down Expand Up @@ -102,7 +102,7 @@ public List<ICompletionProposalHandle> getProps(PySelection ps, IImageCache imag
}

/**
* @see org.python.pydev.editor.correctionassist.IAssistProps#isValid(org.python.pydev.core.docutils.PySelection,
* @see org.python.pydev.core.IAssistProps#isValid(org.python.pydev.core.docutils.PySelection,
* java.lang.String)
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
import org.eclipse.jface.text.templates.TemplateContext;
import org.python.pydev.ast.codecompletion.AbstractTemplateCodeCompletion;
import org.python.pydev.ast.codecompletion.CompletionRequest;
import org.python.pydev.core.IAssistProps;
import org.python.pydev.core.IPyEdit;
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.TokensOrProposalsList;
import org.python.pydev.core.autoedit.DefaultIndentPrefs;
import org.python.pydev.core.docutils.PySelection;
import org.python.pydev.core.proposals.CompletionProposalFactory;
import org.python.pydev.editor.codecompletion.PyTemplateProposal;
import org.python.pydev.editor.correctionassist.IAssistProps;
import org.python.pydev.shared_core.code_completion.ICompletionProposalHandle;
import org.python.pydev.shared_core.image.IImageCache;
import org.python.pydev.shared_core.image.UIConstants;
Expand All @@ -44,7 +44,7 @@ public class AssistSurroundWith extends AbstractTemplateCodeCompletion implement

/**
* @throws BadLocationException
* @see org.python.pydev.editor.correctionassist.IAssistProps#getProps(org.python.pydev.core.docutils.PySelection, org.python.pydev.shared_ui.ImageCache)
* @see org.python.pydev.core.IAssistProps#getProps(org.python.pydev.core.docutils.PySelection, org.python.pydev.shared_ui.ImageCache)
*/
@Override
public List<ICompletionProposalHandle> getProps(PySelection ps, IImageCache imageCache, File f,
Expand Down Expand Up @@ -171,7 +171,7 @@ public String getAdditionalProposalInfo() {
"%sif ${True}:%s%s%s%s%s${cursor}", "if", "%swith ${var}:%s%s%s%s%s${cursor}", "with", };

/**
* @see org.python.pydev.editor.correctionassist.IAssistProps#isValid(org.python.pydev.core.docutils.PySelection)
* @see org.python.pydev.core.IAssistProps#isValid(org.python.pydev.core.docutils.PySelection)
*/
@Override
public boolean isValid(PySelection ps, String sel, IPyEdit edit, int offset) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
package org.python.pydev.editor.correctionassist.heuristics;

import org.python.pydev.ast.codecompletion.revisited.CodeCompletionTestsBase;
import org.python.pydev.editor.correctionassist.IAssistProps;
import org.python.pydev.core.IAssistProps;

/**
* Might be useful when a decent implementation is given
Expand Down

0 comments on commit 361a15c

Please sign in to comment.