-
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change internal APIs to have a marker handler when doing code analysis.
- Loading branch information
Showing
9 changed files
with
111 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
....analysis/src/com/python/pydev/analysis/additionalinfo/builders/DefaultMarkerHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.python.pydev.analysis.additionalinfo.builders; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.core.resources.IResource; | ||
import org.eclipse.core.runtime.CoreException; | ||
import org.eclipse.core.runtime.IProgressMonitor; | ||
import org.python.pydev.core.log.Log; | ||
import org.python.pydev.shared_core.markers.PyMarkerUtils; | ||
import org.python.pydev.shared_core.markers.PyMarkerUtils.MarkerInfo; | ||
|
||
public class DefaultMarkerHandler implements IMarkerHandler { | ||
|
||
@Override | ||
public void replaceMarkers(final List<MarkerInfo> lst, final IResource resource, final String markerType, | ||
final boolean removeUserEditable, IProgressMonitor monitor) { | ||
PyMarkerUtils.replaceMarkers(lst, resource, markerType, removeUserEditable, monitor); | ||
} | ||
|
||
@Override | ||
public void deleteAnalysisMarkers(IResource r) { | ||
AnalysisRunner.deleteMarkers(r); | ||
|
||
} | ||
|
||
@Override | ||
public void deleteOnlyPydevAnalysisMarkers(IResource r) { | ||
boolean onlyPydevAnalysisMarkers = true; | ||
AnalysisRunner.deleteMarkers(r, onlyPydevAnalysisMarkers); | ||
} | ||
|
||
@Override | ||
public void deleteMarkers(IResource resource, String problemMarkerId) { | ||
try { | ||
resource.deleteMarkers(problemMarkerId, false, IResource.DEPTH_ZERO); | ||
} catch (CoreException e) { | ||
Log.log(e); | ||
} | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
....pydev.analysis/src/com/python/pydev/analysis/additionalinfo/builders/IMarkerHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.python.pydev.analysis.additionalinfo.builders; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.core.resources.IResource; | ||
import org.eclipse.core.runtime.IProgressMonitor; | ||
import org.python.pydev.shared_core.markers.PyMarkerUtils.MarkerInfo; | ||
|
||
public interface IMarkerHandler { | ||
|
||
void replaceMarkers(List<MarkerInfo> lst, IResource resource, String markerType, | ||
boolean removeUserEditable, IProgressMonitor monitor); | ||
|
||
void deleteAnalysisMarkers(IResource r); | ||
|
||
void deleteOnlyPydevAnalysisMarkers(IResource r); | ||
|
||
void deleteMarkers(IResource resource, String problemMarkerId); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters