Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
251,000
void (Lexer lexer) { while (lexer.getTokenType() == MacroTokenType.WHITE_SPACE) { lexer.advance(); } }
skipWhitespaces
251,001
String (Lexer lexer, String expression) { return expression.substring(lexer.getTokenStart(), lexer.getTokenEnd()); }
getString
251,002
Expression (Lexer lexer, String expression) { IElementType tokenType = lexer.getTokenType(); String token = getString(lexer, expression); if (tokenType == MacroTokenType.STRING_LITERAL) { advance(lexer); return new ConstantNode(parseStringLiteral(token)); } if (tokenType != MacroTokenType.IDENTIFIER) { LOG.info("Bad ma...
parseMacro
251,003
String (String token) { if (token.length() < 2) { return ""; } StringBuilder sb = new StringBuilder(token.length() - 2); int i = 1; while (i < token.length() - 1) { char c = token.charAt(i); if (c == '\\') { c = token.charAt(++i); if (c == 'n') sb.append('\n'); else if (c == 't') sb.append('\t'); else if (c == 'f') sb....
parseStringLiteral
251,004
void (MacroCallNode macroCallNode, Lexer lexer, String expression) { if (lexer.getTokenType() != MacroTokenType.RPAREN) { while (lexer.getTokenType() != null) { Expression node = parseMacro(lexer, expression); macroCallNode.addParameter(node); if (lexer.getTokenType() == MacroTokenType.COMMA) { advance(lexer); } else {...
parseParameters
251,005
Expression (Lexer lexer, String expression) { String variableName = getString(lexer, expression); advance(lexer); if (lexer.getTokenType() == null) { if (Template.END.equals(variableName)) { return new EmptyNode(); } return new VariableNode(variableName, null); } if (lexer.getTokenType() != MacroTokenType.EQ) { return ...
parseVariable
251,006
TemplateStateBase (@NotNull Editor editor) { UserDataHolder stateHolder = InjectedLanguageEditorUtil.getTopLevelEditor(editor); TemplateStateBase templateState = stateHolder.getUserData(TEMPLATE_STATE_KEY); if (templateState != null && templateState.isDisposed()) { setTemplateState(stateHolder, null); return null; } re...
getTemplateState
251,007
void (UserDataHolder stateHolder, @Nullable TemplateStateBase value) { stateHolder.putUserData(TEMPLATE_STATE_KEY, value); }
setTemplateState
251,008
TemplateStateBase (@NotNull Editor editor) { TemplateStateBase prevState = getTemplateState(editor); if (prevState != null) { Editor stateEditor = prevState.getEditor(); if (stateEditor != null) { setTemplateState(stateEditor, null); } } return prevState; }
clearTemplateState
251,009
Result (ExpressionContext context) { return null; }
calculateResult
251,010
boolean () { return false; }
requiresCommittedPSI
251,011
LookupElement[] (ExpressionContext context) { return null; }
calculateLookupItems
251,012
VirtualFile () { return virtualFile; }
getVirtualFile
251,013
boolean () { return isSyntax; }
isSyntaxOnly
251,014
boolean (final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final ProblemImpl problem = (ProblemImpl)o; if (isSyntax != problem.isSyntax) return false; if (!highlightInfo.equals(problem.highlightInfo)) return false; if (!virtualFile.equals(problem.virtualFile)) retu...
equals
251,015
int () { int result; result = virtualFile.hashCode(); result = 31 * result + highlightInfo.hashCode(); result = 31 * result + (isSyntax ? 1 : 0); return result; }
hashCode
251,016
UnresolvedReferenceQuickFixUpdater (Project project) { return project.getService(UnresolvedReferenceQuickFixUpdater.class); }
getInstance
251,017
boolean (List<E> info, Instruction currentInstruction) { ProgressManager.checkCanceled(); final int currentNumber = currentInstruction.num(); final E oldE = info.get(currentNumber); final E joinedE = join(currentInstruction, info); final E newE = myDfa.fun(joinedE, currentInstruction); if (!mySemilattice.eq(newE, oldE)...
applyTransferFunction
251,018
int () { int allPred = myFlow.length; for (Instruction instruction : myFlow) { allPred += instruction.allPred().size(); } return allPred * 2; }
getIterationLimit
251,019
E (final Instruction instruction, final List<? extends E> info) { final Iterable<? extends Instruction> prev = instruction.allPred(); final ArrayList<E> prevInfos = new ArrayList<>(); for (Instruction i : prev) { prevInfos.add(info.get(i.num())); } return mySemilattice.join(prevInfos); }
join
251,020
void (String key, Object value) { throw new UnsupportedOperationException(); }
put
251,021
void (String name) { throw new UnsupportedOperationException(); }
remove
251,022
DFAMap () { return new DFAMap(); }
asWritable
251,023
void (HashSet<? super String> allNames) { if (myAll != null) { allNames.addAll(myAll.keySet()); } else if (myK != null) { allNames.add(myK); } }
addKeys
251,024
void (String key, V value) { if ((myK == null || myK.equals(key)) && myAll == null) { myK = key; myV = value; } else { if (myAll == null) { myAll = new HashMap<>(); myAll.put(myK, myV); } myAll.put(key, value); } }
put
251,025
void (String name) { if (myAll != null) { myAll.remove(name); if (myAll.size() == 1) { final Map.Entry<String, V> e = myAll.entrySet().iterator().next(); myK = e.getKey(); myV = e.getValue(); myAll = null; } } else if (name.equals(myK)) { myK = null; myV = null; } }
remove
251,026
boolean (String name) { if (myAll != null) { return myAll.containsKey(name); } return name.equals(myK); }
containsKey
251,027
Set<String> (@Nullable Set<String> names2Include) { if (myAll != null) { if (names2Include == null) return myAll.keySet(); return SetUtil.intersect(names2Include, myAll.keySet()); } if (myK != null && (names2Include == null || names2Include.contains(myK))) { if (names2Include != null && names2Include.size() == 1) retur...
intersectKeys
251,028
boolean (Object obj) { if (!(obj instanceof DFAMap)) return false; @SuppressWarnings({"unchecked"}) DFAMap<V> rhs = (DFAMap<V>) obj; if (myAll == null) { if (rhs.myAll != null) return false; if (myK == null) return rhs.myK == null; return myK.equals(rhs.myK) && myV.equals(rhs.myV); } else { if (rhs.myAll == null) retur...
equals
251,029
Collection<V> () { if (myAll != null) { return myAll.values(); } if (myV != null) { return Collections.singletonList(myV); } return Collections.emptyList(); }
values
251,030
String () { return myK; }
getKey
251,031
V () { return myV; }
getValue
251,032
V (V value) { throw new UnsupportedOperationException(); }
setValue
251,033
DFAMap<V> () { return new DFAMap<>(this); }
asWritable
251,034
Set<String> () { if (myAll != null){ return myAll.keySet(); } return myK != null ? Collections.singleton(myK) : Collections.emptySet(); }
keySet
251,035
void (@NotNull LookupElement element, @NotNull ProcessingContext context) { synchronized (this) { myWeights.remove(element); } super.removeElement(element, context); }
removeElement
251,036
Iterable<LookupElement> (@NotNull Iterable<? extends LookupElement> source, @NotNull ProcessingContext context) { if (!myWeigher.isPrefixDependent() && myPrimitive) { return myNext.classify(source, context); } checkPrefixChanged(context); return super.classify(source, context); }
classify
251,037
void (@NotNull LookupElement t, @NotNull ProcessingContext context) { Comparable<?> weight = myWeigher.weigh(t, context.get(CompletionLookupArranger.WEIGHING_CONTEXT)); if (weight instanceof ForceableComparable) { ((ForceableComparable)weight).force(); } synchronized (this) { if (!myWeigher.isPrefixDependent() && myPri...
addElement
251,038
String () { return myId; }
getId
251,039
boolean (Object o) { if (this == o) return true; if (!(o instanceof ClassifierFactory that)) return false; if (!myId.equals(that.myId)) return false; return true; }
equals
251,040
int () { return myId.hashCode(); }
hashCode
251,041
void (LookupElement item, LookupElementPresentation presentation) { myItems.add(item); updateCache(item); }
addElement
251,042
void (LookupElement item) { if (!prefixMatches(item)) { return; } myMatchingItems.add(item); if (isPrefixItem(item, true)) { myExactPrefixItems.add(item); } else if (isPrefixItem(item, false)) { myInexactPrefixItems.add(item); } }
updateCache
251,043
void (@NotNull LookupElement item, @NotNull PrefixMatcher matcher) { item.putUserData(myMatcherKey, matcher); }
registerMatcher
251,044
String (@NotNull LookupElement element) { // This method is not synchronized in BaseCompletionLookupArranger. // The only shared state accessed here is myAdditionalPrefix, // which is declared as volatile and accessed atomically. String prefix = itemMatcher(element).getPrefix(); String additionalPrefix = myAdditionalPr...
itemPattern
251,045
PrefixMatcher (@NotNull LookupElement item) { PrefixMatcher matcher = item.getUserData(myMatcherKey); if (matcher == null) { throw new AssertionError("Item not in lookup: item=" + item + "; lookup items=" + myItems); } return matcher; }
itemMatcher
251,046
boolean (LookupElement item) { PrefixMatcher matcher = itemMatcher(item); if (!myAdditionalPrefix.isEmpty()) { matcher = matcher.cloneWithPrefix(matcher.getPrefix() + myAdditionalPrefix); } return matcher.prefixMatches(item); }
prefixMatches
251,047
void (@Nullable LookupElement lookupItem, char completionChar) { }
itemSelected
251,048
void (@NotNull Lookup lookup, @NotNull String newPrefix) { ArrayList<LookupElement> itemCopy = new ArrayList<>(myItems); myItems.clear(); for (LookupElement item : itemCopy) { if (item.isValid()) { PrefixMatcher matcher = itemMatcher(item).cloneWithPrefix(newPrefix); if (matcher.prefixMatches(item)) { item.putUserData(...
prefixReplaced
251,049
void (Lookup lookup) { myAdditionalPrefix = ((LookupElementListPresenter)lookup).getAdditionalPrefix(); rebuildItemCache(); }
prefixChanged
251,050
void () { myMatchingItems.clear(); myExactPrefixItems.clear(); myInexactPrefixItems.clear(); for (LookupElement item : myItems) { updateCache(item); } }
rebuildItemCache
251,051
List<LookupElement> (final Set<LookupElement> retained) { List<LookupElement> filtered = new ArrayList<>(); List<LookupElement> removed = new ArrayList<>(); for (LookupElement item : myItems) { (retained.contains(item) ? filtered : removed).add(item); } myItems.clear(); myItems.addAll(filtered); rebuildItemCache(); ret...
retainItems
251,052
List<LookupElement> (boolean exactly) { return Collections.unmodifiableList(exactly ? myExactPrefixItems : myInexactPrefixItems); }
getPrefixItems
251,053
boolean (LookupElement item, final boolean exactly) { final String pattern = itemPattern(item); for (String s : item.getAllLookupStrings()) { if (!s.equalsIgnoreCase(pattern)) continue; if (!item.isCaseSensitive() || !exactly || s.equals(pattern)) { return true; } } return false; }
isPrefixItem
251,054
List<LookupElement> () { return myMatchingItems; }
getMatchingItems
251,055
void (@NotNull LookupEx lookup, int hideOffset) { lookup.hideLookup(false); }
prefixTruncated
251,056
boolean () { return false; }
isCompletion
251,057
LookupArranger () { return new DefaultArranger(); }
createEmptyCopy
251,058
void (LookupItem<?> item, LookupElementPresentation presentation) { presentation.setIcon(getRawIcon(item)); presentation.setItemText(getName(item)); presentation.setItemTextBold(item.getAttribute(LookupItem.HIGHLIGHTED_ATTR) != null); presentation.setTailText(getText2(item), item.getAttribute(LookupItem.TAIL_TEXT_SMALL...
renderElement
251,059
String (LookupItem<?> item) { return (String)item.getAttribute(LookupItem.TAIL_TEXT_ATTR); }
getText2
251,060
String (LookupItem<?> item) { final String presentableText = item.getPresentableText(); if (presentableText != null) return presentableText; final Object o = item.getObject(); String name = null; if (o instanceof PsiElement element) { if (element.isValid()) { name = PsiUtilCore.getName(element); } } else if (o instance...
getName
251,061
void (@NotNull T t, @NotNull ProcessingContext context) { if (myNext != null) { myNext.addElement(t, context); } }
addElement
251,062
void (@NotNull T element, @NotNull ProcessingContext context) { if (myNext != null) { myNext.removeElement(element, context); } }
removeElement
251,063
String () { return myName; }
getPresentableName
251,064
boolean (Editor editor, int tailOffset) { PsiFile psiFile = PsiEditorUtil.getPsiFile(editor); Language language = PsiUtilCore.getLanguageAtOffset(psiFile, tailOffset); CodeStyleSettingsFacade codeStyleFacade = CodeStyle.getFacade(psiFile).withLanguage(language); return codeStyleFacade.isSpaceAroundAssignmentOperators()...
isSpaceAroundAssignmentOperators
251,065
int (final Editor editor, int tailOffset) { Document document = editor.getDocument(); int textLength = document.getTextLength(); CharSequence chars = document.getCharsSequence(); if (tailOffset < textLength - 1 && chars.charAt(tailOffset) == ' ' && chars.charAt(tailOffset + 1) == '=') { return moveCaret(editor, tailOff...
processTail
251,066
Iterable<T> (final @NotNull Iterable<? extends T> source, final @NotNull ProcessingContext context) { List<T> nulls = null; TreeMap<Comparable, List<T>> map = new TreeMap<>(); for (T t : source) { final Comparable weight = getWeight(t, context); if (weight == null) { if (nulls == null) nulls = new SmartList<>(); nulls....
classify
251,067
Iterator<T> () { return new FlatteningIterator<>(values.iterator()) { @Override protected Iterator<T> createValueIterator(List<T> group) { return myNext.classify(group, context).iterator(); } }; }
iterator
251,068
Iterator<T> (List<T> group) { return myNext.classify(group, context).iterator(); }
createValueIterator
251,069
LookupManager (@NotNull Project project) { return project.getService(LookupManager.class); }
getInstance
251,070
void (@NotNull Project project) { LookupManager lookupManager = project.getServiceIfCreated(LookupManager.class); if (lookupManager != null) { lookupManager.hideActiveLookup(); } }
hideActiveLookup
251,071
void (@NotNull T o) { myObject = o; }
setObject
251,072
boolean (Object o) { if (o == this) return true; if (o instanceof LookupItem item){ return Comparing.equal(myObject, item.myObject) && Objects.equals(myLookupString, item.myLookupString) && Comparing.equal(myAllLookupStrings, item.myAllLookupStrings) && Comparing.equal(myAttributes, item.myAttributes); } return false; ...
equals
251,073
int () { final Object object = getObject(); assert object != this: getClass().getName(); return myAllLookupStrings.hashCode() * 239 + object.hashCode(); }
hashCode
251,074
String () { return getLookupString(); }
toString
251,075
T () { return (T)myObject; }
getObject
251,076
String () { return myLookupString; }
getLookupString
251,077
void (@NotNull String lookupString) { myAllLookupStrings.remove(""); myLookupString = lookupString; myAllLookupStrings.add(lookupString); }
setLookupString
251,078
Object (Object key) { if (myAttributes != null){ return myAttributes.get(key); } else{ return null; } }
getAttribute
251,079
void (Object key, Object value) { if (value == null && myAttributes != null) { myAttributes.remove(key); return; } if (myAttributes == null){ myAttributes = new HashMap<>(5); } myAttributes.put(key, value); }
setAttribute
251,080
void (final @NotNull InsertionContext context) { final InsertHandler<? extends LookupElement> handler = getInsertHandler(); if (handler != null) { //noinspection unchecked ((InsertHandler)handler).handleInsert(context, this); } if (getTailType() != TailTypes.unknownType() && myInsertHandler == null) { context.setAddCom...
handleInsert
251,081
TailType (final @NotNull Editor editor, final @NotNull LookupElement lookupElement, final char completionChar) { final TailType type = getDefaultTailType(completionChar); if (type != null) { return type; } if (lookupElement instanceof LookupItem) { final LookupItem<?> item = (LookupItem)lookupElement; final TailType at...
handleCompletionChar
251,082
TailType () { final TailType tailType = getAttribute(TAIL_TYPE_ATTR); return tailType != null ? tailType : TailTypes.unknownType(); }
getTailType
251,083
LookupItem<T> (@NotNull TailType type) { setAttribute(TAIL_TYPE_ATTR, type); return this; }
setTailType
251,084
int (@NotNull LookupItem<?> o) { return getLookupString().compareTo(o.getLookupString()); }
compareTo
251,085
LookupItem<T> (final @NotNull InsertHandler<? extends LookupElement> handler) { myInsertHandler = handler; return this; }
setInsertHandler
251,086
void (@NotNull LookupElementPresentation presentation) { for (ElementLookupRenderer renderer : ElementLookupRenderer.EP_NAME.getExtensionList()) { T object = getObject(); if (renderer.handlesItem(object)) { renderer.renderElement(this, object, presentation); return; } } DefaultLookupItemRenderer.INSTANCE.renderElement(...
renderElement
251,087
LookupItem<T> () { setAttribute(HIGHLIGHTED_ATTR, ""); return this; }
setBold
251,088
LookupItem<T> () { setAttribute(FORCE_QUALIFY, ""); return this; }
forceQualify
251,089
LookupItem<T> (final AutoCompletionPolicy policy) { myAutoCompletionPolicy = policy; return this; }
setAutoCompletionPolicy
251,090
AutoCompletionPolicy () { return myAutoCompletionPolicy; }
getAutoCompletionPolicy
251,091
LookupItem<T> (Icon icon) { setAttribute(ICON_ATTR, icon); return this; }
setIcon
251,092
LookupItem<T> (double priority) { myPriority = priority; return this; }
setPriority
251,093
double () { return myPriority; }
getPriority
251,094
LookupItem<T> (final @NotNull String displayText) { myPresentable = displayText; return this; }
setPresentableText
251,095
LookupItem<T> (final String text, final boolean grayed) { setAttribute(TAIL_TEXT_ATTR, text); setAttribute(TAIL_TEXT_SMALL_ATTR, Boolean.TRUE); return this; }
setTailText
251,096
LookupItem<T> (final @NonNls String... additionalLookupStrings) { ContainerUtil.addAll(myAllLookupStrings, additionalLookupStrings); return this; }
addLookupStrings
251,097
Set<String> () { return myAllLookupStrings; }
getAllLookupStrings
251,098
boolean () { return !Boolean.TRUE.equals(getAttribute(CASE_INSENSITIVE)); }
isCaseSensitive
251,099
int (final Editor editor, int tailOffset) { PsiFile psiFile = PsiEditorUtil.getPsiFile(editor); Language language = PsiUtilCore.getLanguageAtOffset(PsiEditorUtil.getPsiFile(editor), tailOffset); CodeStyleSettingsFacade codeStyleFacade = CodeStyle.getFacade(psiFile).withLanguage(language); if (codeStyleFacade.isSpaceBef...
processTail