use of com.intellij.openapi.extensions.PluginId in project google-cloud-intellij by GoogleCloudPlatform.
the class GoogleFeedbackErrorReporter method configureErrorFromEvent.
private static void configureErrorFromEvent(IdeaLoggingEvent event, ErrorBean error) {
Throwable throwable = event.getThrowable();
if (throwable != null) {
PluginId pluginId = IdeErrorsDialog.findPluginId(throwable);
if (pluginId != null) {
IdeaPluginDescriptor ideaPluginDescriptor = PluginManager.getPlugin(pluginId);
if (ideaPluginDescriptor != null && !ideaPluginDescriptor.isBundled()) {
error.setPluginName(ideaPluginDescriptor.getName());
error.setPluginVersion(ideaPluginDescriptor.getVersion());
}
}
}
Object data = event.getData();
if (data instanceof AbstractMessage) {
error.setAttachments(((AbstractMessage) data).getIncludedAttachments());
}
}
use of com.intellij.openapi.extensions.PluginId in project phpinspectionsea by kalessil.
the class UnknownInspectionInspector method collectKnownInspections.
private static Set<String> collectKnownInspections() {
final Set<String> names = new HashSet<>();
final PluginId phpSupport = PluginId.getId("com.jetbrains.php");
for (IdeaPluginDescriptor plugin : PluginManager.getPlugins()) {
/* check plugins' dependencies and extensions */
/* we have to rely on impl-class, see */
final MultiMap<String, Element> extensions = ((IdeaPluginDescriptorImpl) plugin).getExtensions();
final boolean isPhpPlugin = plugin.getPluginId().equals(phpSupport);
if (null == extensions || (!ArrayUtils.contains(plugin.getDependentPluginIds(), phpSupport)) && !isPhpPlugin) {
continue;
}
/* extract inspections; short names */
for (Element node : extensions.values()) {
final String nodeName = node.getName();
if (null == nodeName || !nodeName.equals("localInspection")) {
continue;
}
final Attribute name = node.getAttribute("shortName");
final String shortName = null == name ? null : name.getValue();
if (null != shortName && shortName.length() > 0) {
names.add(shortName);
}
}
}
return names;
}
use of com.intellij.openapi.extensions.PluginId in project psiviewer by cmf.
the class YouTrackBugReporter method submit.
private SubmittedReportInfo submit(IdeaLoggingEvent[] ideaLoggingEvents, String description, String user, Component component) {
this.description = ideaLoggingEvents[0].getThrowableText().substring(0, Math.min(Math.max(80, ideaLoggingEvents[0].getThrowableText().length()), 80));
this.email = user;
@NonNls StringBuilder descBuilder = new StringBuilder();
String platformBuild = ApplicationInfo.getInstance().getBuild().asString();
descBuilder.append("Platform Version: ").append(platformBuild).append('\n');
Throwable t = ideaLoggingEvents[0].getThrowable();
if (t != null) {
final PluginId pluginId = IdeErrorsDialog.findPluginId(t);
if (pluginId != null) {
final IdeaPluginDescriptor ideaPluginDescriptor = PluginManager.getPlugin(pluginId);
if (ideaPluginDescriptor != null && !ideaPluginDescriptor.isBundled()) {
descBuilder.append("Plugin ").append(ideaPluginDescriptor.getName()).append(" version: ").append(ideaPluginDescriptor.getVersion()).append("\n");
this.affectedVersion = ideaPluginDescriptor.getVersion();
}
}
}
if (user == null)
user = "<none>";
if (description == null)
description = "<none>";
descBuilder.append("\n\nDescription: ").append(description).append("\n\nUser: ").append(user);
for (IdeaLoggingEvent e : ideaLoggingEvents) descBuilder.append("\n\n").append(e.toString());
this.extraInformation = descBuilder.toString();
String result = submit();
log.info("Error submitted, response: " + result);
if (result == null)
return new SubmittedReportInfo(SERVER_ISSUE_URL, "", FAILED);
String ResultString = null;
try {
Pattern regex = Pattern.compile("id=\"([^\"]+)\"", Pattern.DOTALL | Pattern.MULTILINE);
Matcher regexMatcher = regex.matcher(result);
if (regexMatcher.find()) {
ResultString = regexMatcher.group(1);
}
} catch (PatternSyntaxException ex) {
// Syntax error in the regular expression
}
SubmittedReportInfo.SubmissionStatus status = NEW_ISSUE;
if (ResultString == null)
return new SubmittedReportInfo(SERVER_ISSUE_URL, "", FAILED);
return new SubmittedReportInfo(SERVER_URL + "issue/" + ResultString, ResultString, status);
}
use of com.intellij.openapi.extensions.PluginId in project intellij-plugins by StepicOrg.
the class PluginUtils method getVersion.
@NotNull
public static String getVersion() {
PluginId pluginId = PluginId.getId(PLUGIN_ID);
IdeaPluginDescriptor plugin = PluginManager.getPlugin(pluginId);
return plugin != null ? plugin.getVersion() : DEFAULT_PLUGIN_VERSION;
}
Aggregations