Skip to content

Commit

Permalink
wi
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Sep 28, 2024
1 parent f9e4020 commit b6f0374
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 12 deletions.
1 change: 1 addition & 0 deletions plugins/com.python.pydev.analysis/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Export-Package: com.python.pydev.analysis,
com.python.pydev.analysis.additionalinfo.dependencies,
com.python.pydev.analysis.external,
com.python.pydev.analysis.flake8,
com.python.pydev.analysis.marker_quick_fixes,
com.python.pydev.analysis.mypy,
com.python.pydev.analysis.pep8,
com.python.pydev.analysis.pylint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Please see the license.txt included with this distribution for details.
* Any modifications to this file must keep this entire header intact.
*/
package com.python.pydev.analysis.ctrl_1;
package com.python.pydev.analysis.marker_quick_fixes;

import java.io.File;
import java.util.ArrayList;
Expand All @@ -16,12 +16,12 @@
import org.python.pydev.core.IPythonNature;
import org.python.pydev.core.docutils.PySelection;
import org.python.pydev.core.proposals.CompletionProposalFactory;
import org.python.pydev.shared_core.SharedCorePlugin;
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;
import org.python.pydev.shared_core.image.IImageHandle;
import org.python.pydev.shared_core.image.UIConstants;
import org.python.pydev.shared_ui.SharedUiPlugin;

import com.python.pydev.analysis.additionalinfo.builders.AnalysisRunner;

Expand All @@ -30,7 +30,7 @@ public class DontAnalyzeFileMarkerParticipant implements IAssistProps {
private IImageHandle annotationImage;

public DontAnalyzeFileMarkerParticipant() {
IImageCache analysisImageCache = SharedUiPlugin.getImageCache();
IImageCache analysisImageCache = SharedCorePlugin.getImageCache();
annotationImage = analysisImageCache.get(UIConstants.ASSIST_ANNOTATION);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* @author Fabio Zadrozny
*/
package com.python.pydev.analysis.ctrl_1;
package com.python.pydev.analysis.marker_quick_fixes;

import java.util.HashSet;
import java.util.List;
Expand All @@ -26,11 +26,11 @@
import org.python.pydev.core.docutils.PySelection;
import org.python.pydev.core.formatter.FormatStd;
import org.python.pydev.core.proposals.CompletionProposalFactory;
import org.python.pydev.shared_core.SharedCorePlugin;
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;
import org.python.pydev.shared_core.image.UIConstants;
import org.python.pydev.shared_ui.SharedUiPlugin;

public class IgnoreErrorParticipant implements IAnalysisMarkersParticipant {

Expand All @@ -42,11 +42,15 @@ public IgnoreErrorParticipant() {
this(null);
}

private IgnoreErrorParticipant(FormatStd format) {
this.format = format;
}

/**
* Only for tests.
*/
/*default*/ IgnoreErrorParticipant(FormatStd format) {
this.format = format;
public static IgnoreErrorParticipant createForTests(FormatStd format) {
return new IgnoreErrorParticipant(format);
}

@Override
Expand All @@ -64,7 +68,7 @@ public void addProps(IMarkerInfoForAnalysis markerInfo, IAnalysisPreferences ana
return;
}

IImageCache imageCache = SharedUiPlugin.getImageCache();
IImageCache imageCache = SharedCorePlugin.getImageCache();
ICompletionProposalHandle proposal = CompletionProposalFactory.get().createIgnoreCompletionProposalInSameLine(
messageToIgnore, ps.getEndLineOffset(), 0, offset,
imageCache != null ? imageCache.get(UIConstants.ASSIST_ANNOTATION) : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/*
* Created on 24/09/2005
*/
package com.python.pydev.analysis.ctrl_1;
package com.python.pydev.analysis.marker_quick_fixes;

import java.util.List;

Expand Down
2 changes: 1 addition & 1 deletion plugins/org.python.pydev/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3115,7 +3115,7 @@ The related image showing the error is at: http://i.stack.imgur.com/IfNFY.png
</extension>

<extension point="org.python.pydev.pydev_ctrl_1">
<ctrl_1_participant class="com.python.pydev.analysis.ctrl_1.DontAnalyzeFileMarkerParticipant"/>
<ctrl_1_participant class="com.python.pydev.analysis.marker_quick_fixes.DontAnalyzeFileMarkerParticipant"/>
</extension>

<!-- Adds ctrl+2+ - - d -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.python.pydev.analysis.ctrl_1;

import com.python.pydev.analysis.additionalinfo.builders.AnalysisRunner;
import com.python.pydev.analysis.marker_quick_fixes.IgnoreErrorParticipant;
import com.python.pydev.analysis.marker_quick_fixes.UndefinedVariableFixParticipant;

/**
* Copyright (c) 2005-2012 by Appcelerator, Inc. All Rights Reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import com.python.pydev.analysis.AnalysisPreferences;
import com.python.pydev.analysis.AnalysisUiPlugin;
import com.python.pydev.analysis.additionalinfo.builders.AnalysisRunner;
import com.python.pydev.analysis.ctrl_1.UndefinedVariableFixParticipant;
import com.python.pydev.analysis.marker_quick_fixes.UndefinedVariableFixParticipant;

/**
* Used to present the user a way to add imports for the undefined variables.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import com.python.pydev.analysis.AnalysisPreferencesStub;
import com.python.pydev.analysis.additionalinfo.AdditionalInfoTestsBase;
import com.python.pydev.analysis.marker_quick_fixes.IgnoreErrorParticipant;

public class IgnoreErrorFixParticipantTest extends AdditionalInfoTestsBase {

Expand Down Expand Up @@ -59,7 +60,7 @@ public void setUp() throws Exception {
super.setUp();
format = new FormatStd();
format.spacesBeforeComment = 2;
participant = new IgnoreErrorParticipant(format);
participant = IgnoreErrorParticipant.createForTests(format);
prefs = new AnalysisPreferencesStub();
props = new ArrayList<ICompletionProposalHandle>();
CompletionProposalFactory.set(new DefaultCompletionProposalFactory());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.python.pydev.analysis.AnalysisPreferences;
import com.python.pydev.analysis.AnalysisPreferencesStub;
import com.python.pydev.analysis.additionalinfo.AdditionalInfoTestsBase;
import com.python.pydev.analysis.marker_quick_fixes.UndefinedVariableFixParticipant;

public class UndefinedVariableFixParticipantTest extends AdditionalInfoTestsBase {

Expand Down

0 comments on commit b6f0374

Please sign in to comment.