Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
247,400
List<ClientHintManager> () { return ApplicationManager.getApplication().getServices(ClientHintManager.class, ClientKind.ALL); }
getAllInstances
247,401
void (@NotNull Editor editor, Caret caret, DataContext dataContext) { if (HintManagerImpl.getInstanceImpl().hideHints(HintManager.HIDE_BY_ESCAPE | HintManager.HIDE_BY_ANY_KEY, true, false)) { return; } myOriginalHandler.execute(editor, caret, dataContext); }
doExecute
247,402
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { HintManagerImpl hintManager = HintManagerImpl.getInstanceImpl(); return hintManager.isEscapeHandlerEnabled() || myOriginalHandler.isEnabled(editor, caret, dataContext); }
isEnabledForCaret
247,403
int () { int size = myText.length(); if (myRawText != null && !Strings.areSameInstance(myRawText.rawText, myText)) { size += StringUtil.length(myRawText.rawText); } return size; }
getSize
247,404
String (@NotNull String text) { // Clipboard on Windows and Linux works with null-terminated strings, on Mac nulls are not treated in a special way. return SystemInfo.isMac ? text : text.replace('\000', ' '); }
cleanFromNullsIfNeeded
247,405
DataFlavor[] () { return myTransferDataFlavors; }
getTransferDataFlavors
247,406
boolean (DataFlavor flavor) { DataFlavor[] flavors = getTransferDataFlavors(); return ArrayUtil.contains(flavor, flavors); }
isDataFlavorSupported
247,407
String (@NotNull Editor editor, @NotNull String input) { return convertLineSeparators(editor, input, Collections.emptyList()); }
convertLineSeparators
247,408
String (@NotNull Editor editor, @NotNull String input, @NotNull Collection<? extends TextBlockTransferableData> itemsToUpdate) { // converting line separators to spaces matches the behavior of Swing text components on paste return convertLineSeparators(input, editor.isOneLineMode() ? " " : "\n", itemsToUpdate); }
convertLineSeparators
247,409
String (String text, String newSeparator, Collection<? extends TextBlockTransferableData> itemsToUpdate) { if (itemsToUpdate.size() > 0){ int size = 0; for(TextBlockTransferableData data: itemsToUpdate) { size += data.getOffsetCount(); } int[] offsets = new int[size]; int index = 0; for(TextBlockTransferableData data: ...
convertLineSeparators
247,410
record (DataFlavor flavor, int priority) { }
DataFlavorWithPriority
247,411
int (@NotNull String key1, @NotNull String key2) { final Deque<String> list = myDataMap.get(key1); if (list == null) return 0; int result = 0; for (final String s : list) { if (s.equals(key2)) result++; } return result; }
getData
247,412
void (String key1, String key2) { Deque<String> list = myDataMap.get(key1); if (list == null) { myDataMap.put(key1, list = new ArrayDeque<>()); } list.addFirst(key2); if (list.size() > StatisticsManager.OBLIVION_THRESHOLD) { list.removeLast(); } advanceRecencyStamps(key1, key2); }
incData
247,413
void (String context, String value) { int stamp = myContextMaxStamps.getInt(context) + 1; myContextMaxStamps.put(context, stamp); getValueStamps(context).put(value, stamp); if (stamp > StatisticsManager.RECENCY_OBLIVION_THRESHOLD * 2) { trimAncientRecencyEntries(context, StatisticsManager.RECENCY_OBLIVION_THRESHOLD); }...
advanceRecencyStamps
247,414
Object2IntMap<String> (String context) { return myValueStamps.computeIfAbsent(context, __ -> { Object2IntMap<String> result = new Object2IntOpenHashMap<>(); result.defaultReturnValue(-1); return result; }); }
getValueStamps
247,415
void (String context, int limit) { Object2IntMap<String> newStamps = new Object2IntOpenHashMap<>(); newStamps.defaultReturnValue(-1); for (String o : getValueStamps(context).keySet()) { int recency = getRecency(context, o); if (recency != Integer.MAX_VALUE) { newStamps.put(o, limit - recency); } } myValueStamps.put(con...
trimAncientRecencyEntries
247,416
ValidationResult (@NotNull String baseDirPath) { return ValidationResult.OK; }
validate
247,417
boolean () { return true; }
isPrimaryGenerator
247,418
JComponent () { return myComponent; }
getComponent
247,419
void (@NotNull SettingsStep settingsStep) {}
buildUI
247,420
T () { return mySettings; }
getSettings
247,421
boolean () { return false; }
isBackgroundJobRunning
247,422
void (@NotNull WebProjectGenerator.SettingsStateListener listener) {}
addSettingsStateListener
247,423
ValidationResult (@NotNull String baseDirPath) { return ValidationResult.OK; }
validate
247,424
void (boolean validSettings) { listener.stateChanged(validSettings); }
stateChanged
247,425
void (@NotNull VirtualFile chosenFile) { myBaseDir = chosenFile.getPath(); if (isProjectNameChanged(nameField.getText()) && !nameField.getText().equals(chosenFile.getName())) { myExternalModify = true; locationField.setText(new File(chosenFile.getPath(), nameField.getText()).getPath()); myExternalModify = false; } else...
onFileChosen
247,426
void (@NotNull DocumentEvent e) { if (myExternalModify) { return; } myModifyingLocation = true; String path = locationField.getText().trim(); path = StringUtil.trimEnd(path, File.separator); int ind = path.lastIndexOf(File.separator); if (ind != -1) { String projectName = path.substring(ind + 1); if (!nameField.getText...
textChanged
247,427
boolean (@NotNull String currentName) { return !currentName.equals(mySuggestedProjectName); }
isProjectNameChanged
247,428
void (final @NotNull DocumentEvent e) { if (!myModifyingLocation && !myExternalModify) { myModifyingProjectName = true; File f = new File(myBaseDir); locationField.setText(new File(f, projectNameTextField.getText()).getPath()); } }
textChanged
247,429
Icon (String group) { return null; }
getGroupIcon
247,430
int (String group) { return 0; }
getGroupWeight
247,431
String (String group) { return null; }
getParentGroup
247,432
void (int b) { myOriginalStream.write(b); processByte(b); }
write
247,433
void (byte @NotNull [] b, int off, int len) { myOriginalStream.write(b, off, len); for (int i = 0; i < len; i++) { processByte(b[off + i]); } }
write
247,434
void () { if (myStackOverflowProtection.get()) { if (myStackOverflowProtectionTriggered.compareAndSet(false, true)) { myLogger.error("Stack overflow protection triggered in logger. A standard stream overridden to write to logs?"); } return; } myStackOverflowProtection.set(true); try { myLogger.info(new String(myBuffer,...
writeBuffer
247,435
AWTError (Throwable t) { while (t != null) { if (t instanceof AWTError) { return (AWTError)t; } t = t.getCause(); } return null; }
findGraphicsError
247,436
void (@NotNull Throwable t) { if (LoadingState.COMPONENTS_LOADED.isOccurred() && !(t instanceof StartupAbortedException)) { if (!(t instanceof ControlFlowException)) { PluginManagerCore.getLogger().error(t); } return; } logAndExit(t, null); }
processException
247,437
void (@NotNull Throwable t, @Nullable Logger log) { EssentialPluginMissingException essentialPluginMissingException = findCause(t, EssentialPluginMissingException.class); if (essentialPluginMissingException != null) { showMessage(BootstrapBundle.message("bootstrap.error.title.corrupted.installation"), BootstrapBundle.m...
logAndExit
247,438
String () { try { return ApplicationNamesInfo.getInstance().getFullProductName(); } catch (Throwable ignore) { return "the IDE"; } }
getProductNameSafe
247,439
Logger () { Logger logger = Logger.getInstance(DirectoryLock.class); if (Boolean.getBoolean("ij.dir.lock.debug")) logger.setLevel(LogLevel.DEBUG); return logger; }
getLogger
247,440
boolean (@NotNull Path file) { var fs = file.getFileSystem(); if (fs.getClass().getModule() != Object.class.getModule()) { if (!System.getProperty("java.vm.vendor", "").contains("JetBrains") || JavaVersion.current().compareTo(JavaVersion.compose(17, 0, 6, 894, false)) < 0) { return false; } try { fs.provider().getClass...
areUdsSupported
247,441
void (boolean deleteLockFile) { var serverChannel = myServerChannel; myServerChannel = null; if (serverChannel != null) { if (LOG.isDebugEnabled()) LOG.debug("Cleaning up"); Suppressions.runSuppressing( () -> serverChannel.close(), () -> { if (myRedirectedPortFile != null) { Files.deleteIfExists(myRedirectedPortFile); ...
dispose
247,442
void () { if (SystemInfoRt.isWindows && JnaLoader.isLoaded()) { try { var remotePID = Long.parseLong(Files.readString(myLockFile)); User32Ex.INSTANCE.AllowSetForegroundWindow(new WinDef.DWORD(remotePID)); } catch (Throwable t) { LOG.debug(t); } } }
allowActivation
247,443
void () { var serverChannel = myServerChannel; if (serverChannel == null) return; while (true) { try { var socketChannel = serverChannel.accept(); ProcessIOExecutorService.INSTANCE.execute(() -> handleConnection(socketChannel)); } catch (ClosedChannelException e) { break; } catch (IOException e) { LOG.warn(e); break; }...
acceptConnections
247,444
void (SocketChannel socketChannel) { try (socketChannel) { var request = readLines(socketChannel); CliResult result; try { result = myProcessor.apply(request); } catch (Throwable t) { LOG.error(t); var error = requireNonNullElse(t.getMessage(), "Unknown error"); var message = BootstrapBundle.message("bootstrap.error.re...
handleConnection
247,445
void (ComponentEvent e) { frame.removeComponentListener(this); GlobalMenuLinux.this.xid.set(_getX11WindowXid(frame)); }
componentShown
247,446
void () { // exec at EDT if (myIsDisposed) { return; } myIsDisposed = true; if (windowHandle != null) { _trace("scheduled destroying of GlobalMenuLinux for frame %s | xid=0x%X", frame, xid); ourLib.releaseWindowOnMainLoop(windowHandle, onWindowReleased); } else { _trace("scheduled destroying of unused GlobalMenuLinux f...
dispose
247,447
void (@NotNull Window frame) { // exec at EDT if (ourLib == null) { return; } final long xid = _getX11WindowXid(frame); if (xid == 0) { LOG.debug("can't obtain XID of window: " + frame + ", skip global menu binding"); return; } if (windowHandle != null) { _trace("bind new window 0x%X", xid); ourLib.bindNewWindow(window...
bindNewWindow
247,448
void (@NotNull Window frame) { // exec at EDT if (ourLib == null) { return; } final long xid = _getX11WindowXid(frame); if (xid == 0) { LOG.debug("can't obtain XID of window: " + frame + ", skip global menu unbinding"); return; } if (windowHandle != null) { _trace("unbind window 0x%X", xid); ourLib.unbindWindow(windowH...
unbindWindow
247,449
void (List<ActionMenu> roots) { // exec at EDT if (ourLib == null) { return; } ThreadingAssertions.assertEventDispatchThread(); int[] stats = new int[]{0, 0, 0}; final int size = roots == null ? 0 : roots.size(); final List<MenuItemInternal> newRoots = new ArrayList<>(size); if (roots != null) { for (ActionMenu am : ro...
setRoots
247,450
void () { // exec at glib-thread if (isRootsUpdated || !isEnabled || myIsDisposed) { return; } if (xid.get() == 0) { LOG.debug("can´t update roots of frame " + frame + " because xid == 0"); return; } isRootsUpdated = true; if (windowHandle == null) { windowHandle = ourLib.registerWindow(xid.get(), this); if (windowHand...
_updateRoots
247,451
void (boolean enabled) { if (ourLib == null || myIsDisposed) { return; } if (xid.get() == 0) { LOG.debug("can´t toggle global-menu of frame " + frame + " because xid == 0"); return; } if (isEnabled == enabled) { return; } isEnabled = enabled; if (enabled) { _trace("enable global-menu"); isRootsUpdated = false; ourLib.e...
toggle
247,452
MenuItemInternal (int uid) { return _findMenuItem(roots, uid); }
_findMenuItem
247,453
void (int uid, int eventType) { _handleEvent(uid, eventType, true); }
handleEvent
247,454
void (int uid, int eventType, boolean doFiltering) { // glib main-loop thread if (windowHandle == null || myIsDisposed) { if (TRACE_ENABLED) _trace("window was closed when received event '%s', just skip it", _evtype2str(eventType)); return; } final MenuItemInternal mi = _findMenuItem(uid); if (mi == null) { LOG.debug("...
_handleEvent
247,455
String () { StringBuilder out = new StringBuilder(); _dumpSwingHierarchy(out); return out.toString(); }
_dumpSwingHierarchy
247,456
void (StringBuilder out) { for (MenuItemInternal root : roots) { final ActionMenu am = (ActionMenu)root.jitem; out.append(am.getText()); out.append('\n'); _dumpActionMenuKids(am, out, 1); } }
_dumpSwingHierarchy
247,457
GlobalMenuLinux (@NotNull JFrame frame) { return new GlobalMenuLinux(frame); }
create
247,458
MenuItemInternal (List<MenuItemInternal> kids, int uid) { if (kids == null || kids.isEmpty()) { return null; } for (MenuItemInternal mi : kids) { if (mi.uid == uid) { return mi; } final MenuItemInternal child2 = _findMenuItem(mi.children, uid); if (child2 != null) { return child2; } } return null; }
_findMenuItem
247,459
String (int eventType) { return switch (eventType) { case GlobalMenuLib.EVENT_OPENED -> "event-opened"; case GlobalMenuLib.EVENT_CLOSED -> "event-closed"; case GlobalMenuLib.EVENT_CLICKED -> "event-clicked"; case GlobalMenuLib.SIGNAL_ABOUT_TO_SHOW -> "signal-about-to-show"; case GlobalMenuLib.SIGNAL_ACTIVATED -> "signa...
_evtype2str
247,460
byte[] (Icon icon) { if (icon == null || icon.getIconWidth() <= 0 || icon.getIconHeight() <= 0) { return null; } final BufferedImage img = ImageUtil.createImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB); final Graphics2D g2d = img.createGraphics(); icon.paintIcon(null, g2d, 0, 0); g2d.disp...
_icon2png
247,461
MenuItemInternal (MenuItemInternal parent, Component each) { if (each == null) { return null; } MenuItemInternal result = null; if (each instanceof ActionMenuItem ami) { result = new MenuItemInternal(parent, -1, System.identityHashCode(ami), ami.isToggleable() ? GlobalMenuLib.ITEM_CHECK : GlobalMenuLib.ITEM_SIMPLE, ami...
_createInternalFromSwing
247,462
String (int[] stats) { if (stats == null) { return "empty"; } return String.format("created=%d, deleted=%d, updated=%d", stats[STAT_CREATED], stats[STAT_DELETED], stats[STAT_UPDATED]); }
_stats2str
247,463
void (@NotNull MenuItemInternal mi, @NotNull ActionMenu am, int deepness, int[] stats) { // exec at EDT // 1. mark all kids to delete mi.clearChildrenSwingRefs(); for (MenuItemInternal cmi : mi.children) { cmi.position = -1; // mark item to be deleted } if (stats != null) stats[STAT_DELETED] += mi.children.size(); // 2...
_syncChildren
247,464
void (@NotNull MenuItemInternal mi) { // exec at glib main-loop thread if (mi.nativePeer == null) { return; } // sort mi.children.sort(Comparator.comparingInt(MenuItemInternal::getPosition)); // remove marked items Iterator<MenuItemInternal> i = mi.children.iterator(); while (i.hasNext()) { final MenuItemInternal child...
_processChildren
247,465
boolean (int eventType) { return eventType == GlobalMenuLib.SIGNAL_ABOUT_TO_SHOW || (!SKIP_OPEN_MENU_COMMAND && eventType == GlobalMenuLib.EVENT_OPENED); }
_isFillEvent
247,466
boolean () { return ourLib != null; }
isAvailable
247,467
boolean () { return ourLib != null && isServiceAvailable; }
isPresented
247,468
GlobalMenuLib () { Application app; if (!SystemInfoRt.isLinux || !(CpuArch.isIntel64() || CpuArch.isArm64()) || (app = ApplicationManager.getApplication()) == null || app.isUnitTestMode() || app.isHeadlessEnvironment() || Boolean.getBoolean("linux.native.menu.force.disable") || (LoadingState.COMPONENTS_REGISTERED.isOcc...
_loadLibrary
247,469
boolean () { // Workaround OC-18001 OC-18634 CLion crashes after opening Swift project on Linux if (PluginManagerCore.isPluginInstalled(PluginId.getId("com.intellij.clion-swift"))) { try { String stdout = StringUtil.toLowerCase( ExecUtil.execAndGetOutput(new GeneralCommandLine("lspci")).getStdout()); return stdout.cont...
isUnderVMWithSwiftPluginInstalled
247,470
long (@NotNull Window frame) { try { // getPeer method was removed in jdk9, but 'peer' field still exists MethodHandles.Lookup lookup = MethodHandles.lookup(); ComponentPeer componentPeer = (ComponentPeer)MethodHandles.privateLookupIn(Component.class, lookup) .findVarHandle(Component.class, "peer", ComponentPeer.class)...
_getX11WindowXid
247,471
void (@NotNull ActionMenu am, StringBuilder out, int indent) { // exec at EDT for (Component each : am.getPopupMenu().getComponents()) { if (each == null) { continue; } if (!(each instanceof JMenuItem)) { continue; } out.append("\t".repeat(Math.max(0, indent))); String txt = ((JMenuItem)each).getText(); if (txt == null...
_dumpActionMenuKids
247,472
void (@NonNls String fmt, Object... args) { if (!TRACE_ENABLED) { return; } final String msg = String.format(fmt, args); _trace(msg); }
_trace
247,473
void (@NonNls String msg) { if (!TRACE_ENABLED) { return; } if (TRACE_SYSOUT) { //noinspection UseOfSystemOutOrSystemErr System.out.println(ourDtf.format(new Date()) + ": " + msg); } else { LOG.info(msg); } }
_trace
247,474
void (@NotNull ActionManager actionManager) { if (!SystemInfoRt.isLinux || ApplicationManager.getApplication().isUnitTestMode() || !isPresented()) { return; } // register toggle-swing-menu action (to be able to enable swing menu when system applet is died) actionManager .registerAction(TOGGLE_SWING_MENU_ACTION_ID, new ...
customize
247,475
void (@NotNull AnActionEvent e) { for (GlobalMenuLinux gml : instances) { gml.toggle(enabled); } enabled = !enabled; }
actionPerformed
247,476
String () { String res = String.format("'%s' (uid=%d, act=%s)", txt, uid, action); if (position == -1) { res += " [toDelele]"; } return res; }
toString
247,477
void () { // exec at ETD if (timerClearSwing == null) { return; } if (jitem == null) { if (TRACE_CLEARING) _trace("corresponding (closing) swing item is null - nothing to clear, event source: ", this); return; } if (!(jitem instanceof ActionMenu am)) { LOG.debug("corresponding (closing) swing item isn't instance of Act...
_clearSwing
247,478
void (long timeMs) { lastClearedMs = timeMs; if (timerClearSwing != null) { timerClearSwing.stop(); timerClearSwing = null; } for (MenuItemInternal kid : children) { kid._onSwingCleared(timeMs); } }
_onSwingCleared
247,479
record (int uid, int eventType, int rootId, long timeMs) { }
QueuedEvent
247,480
boolean () { return closedMs > 0; }
_isClosed
247,481
void () { // exec at glib-main-thread if (myTimer != null) { myTimer.stop(); } myTimer = null; }
_stopTimer
247,482
void () { // exec at glib-main-thread for (QueuedEvent q : queued) { _handleEvent(q.uid, q.eventType, false); } queued.clear(); }
_processQueue
247,483
void () { // exec at glib-main-thread _stopTimer(); final Timer timer = new Timer(50, null); timer.addActionListener((e) -> { if (TRACE_EVENT_FILTER) _trace("EventFilter: start execution of timer callback"); // exec at EDT if (myTimer != timer) {// check that timer wasn't reset if (TRACE_EVENT_FILTER) _trace("EventFilt...
_startTimer
247,484
int (int keycode) { return switch (keycode) { case KeyEvent.VK_ENTER -> XK_Return; case KeyEvent.VK_BACK_SPACE -> XK_BackSpace; case KeyEvent.VK_TAB -> XK_Tab; case KeyEvent.VK_CANCEL -> XK_Cancel; case KeyEvent.VK_CLEAR -> XK_Clear; case KeyEvent.VK_PAUSE -> XK_Pause; case KeyEvent.VK_CAPS_LOCK -> XK_Caps_Lock; case K...
_jkeycode2x11keycode
247,485
int (int jcode, int location) { if (jcode >= KeyEvent.VK_A && jcode <= KeyEvent.VK_Z) return XK_a + (jcode - KeyEvent.VK_A); if (jcode >= KeyEvent.VK_0 && jcode <= KeyEvent.VK_9) return XK_0 + (jcode - KeyEvent.VK_0); if (jcode >= KeyEvent.VK_NUMPAD0 && jcode <= KeyEvent.VK_NUMPAD9) return XK_KP_0 + (jcode - KeyEvent.V...
jkeycode2X11code
247,486
boolean (@NotNull MouseEvent event, int clickCount) { openErrorsDialog(null); return true; }
onClick
247,487
String () { return FATAL_ERROR; }
ID
247,488
WidgetPresentation () { return null; }
getPresentation
247,489
void () { messagePool.removeListener(this); }
dispose
247,490
JComponent () { return component.get(); }
getComponent
247,491
AnAction () { return action; }
getAction
247,492
void (@Nullable LogMessage message) { if (dialog != null || isOpeningInProgress) { return; } isOpeningInProgress = true; new Runnable() { @Override public void run() { if (!isOtherModalWindowActive()) { try (AccessToken ignored = ClientId.withClientId(ClientId.getLocalId())) { // always show IDE errors to the host doOp...
openErrorsDialog
247,493
void () { if (!isOtherModalWindowActive()) { try (AccessToken ignored = ClientId.withClientId(ClientId.getLocalId())) { // always show IDE errors to the host doOpenErrorsDialog(message); } finally { isOpeningInProgress = false; } } else if (dialog == null) { EdtExecutorService.getScheduledExecutorInstance().schedule(th...
run
247,494
void (@Nullable LogMessage message) { Project project = frame == null ? null : frame.getProject(); dialog = new IdeErrorsDialog(messagePool, project, message) { @Override protected void dispose() { super.dispose(); dialog = null; updateIconAndNotify(); } @Override protected void updateOnSubmit() { super.updateOnSubmit(...
doOpenErrorsDialog
247,495
void () { super.dispose(); dialog = null; updateIconAndNotify(); }
dispose
247,496
void () { super.updateOnSubmit(); updateIcon(messagePool.getState()); }
updateOnSubmit
247,497
void (MessagePool.State state) { UIUtil.invokeLaterIfNeeded(() -> { IdeErrorsIcon icon = this.icon; if (icon == null) { icon = new IdeErrorsIcon(frame != null); icon.setVerticalAlignment(SwingConstants.CENTER); onClick.installOn(icon); this.icon = icon; component.get().add(icon, BorderLayout.CENTER); } icon.setState(st...
updateIcon
247,498
void () { updateIconAndNotify(); }
newEntryAdded
247,499
void () { updateIconAndNotify(); }
poolCleared