Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
27,900
void (@Nullable TextMateLexer.Token token, int fallbackOffset) { if (token != null) { myTokenType = token.scope == TextMateScope.WHITESPACE ? TokenType.WHITE_SPACE : new TextMateElementType(token.scope); myTokenStart = token.startOffset; myTokenEnd = Math.min(token.endOffset, myEndOffset); myCurrentOffset = token.endOf...
updateState
27,901
int (@NotNull IElementType tokenType, int state, boolean isRestartableState) { if (tokenType instanceof TextMateElementType) { synchronized (tokenTypeMap) { if (tokenTypeMap.containsKey(tokenType)) { return tokenTypeMap.getInt(tokenType) * (isRestartableState ? 1 : -1); } int data = tokenTypes.size() + 1; tokenTypes.ad...
packData
27,902
IElementType (int data) { return data != 0 ? tokenTypes.get(Math.abs(data) - 1) : new TextMateElementType(TextMateScope.EMPTY); }
unpackTokenFromData
27,903
DataStorage () { return new TextMateLexerDataStorage(myData, tokenTypeMap, tokenTypes); }
copy
27,904
DataStorage () { return new TextMateLexerDataStorage(tokenTypeMap, tokenTypes); }
createStorage
27,905
TextMateScope () { return myScope; }
getScope
27,906
int () { return getScope().hashCode(); }
hashCode
27,907
String () { return myScope.toString(); }
toString
27,908
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; return ((TextMateElementType)o).getScope().equals(getScope()); }
equals
27,909
Tokenizer (PsiElement element) { return TEXT_TOKENIZER; }
getTokenizer
27,910
Lexer (Project project) { return new EmptyLexer(); }
createLexer
27,911
PsiParser (Project project) { return new TextMateParser(); }
createParser
27,912
IFileElementType () { return FILE_ELEMENT_TYPE; }
getFileNodeType
27,913
TokenSet () { return TokenSet.EMPTY; }
getCommentTokens
27,914
TokenSet () { return TokenSet.EMPTY; }
getStringLiteralElements
27,915
PsiElement (ASTNode node) { return new TextMatePsiElement(node.getElementType()); }
createElement
27,916
PsiFile (@NotNull FileViewProvider viewProvider) { return new TextMateFile(viewProvider); }
createFile
27,917
SpaceRequirements (ASTNode left, ASTNode right) { return SpaceRequirements.MAY; }
spaceExistenceTypeBetweenTokens
27,918
FileType () { return TextMateFileType.INSTANCE; }
getFileType
27,919
ASTNode (@NotNull IElementType root, PsiBuilder builder) { PsiBuilder.Marker mark = builder.mark(); while (!builder.eof()) { builder.advanceLexer(); } mark.done(root); return builder.getTreeBuilt(); }
parse
27,920
Result (char c, @NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file, @NotNull FileType fileType) { if (fileType == TextMateFileType.INSTANCE) { if (c == '\'' || c == '"' || c == '`') { if (!CodeInsightSettings.getInstance().AUTOINSERT_PAIR_QUOTE) { return Result.CONTINUE; } } else if (!CodeInsightSe...
beforeCharTyped
27,921
Result (char c, @NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { if (file.getFileType() == TextMateFileType.INSTANCE) { if (c == '\'' || c == '"' || c == '`') { if (!CodeInsightSettings.getInstance().AUTOINSERT_PAIR_QUOTE) { return Result.CONTINUE; } } else if (!CodeInsightSettings.getInstance...
charTyped
27,922
TextMateAutoClosingPair (char closingChar, @Nullable TextMateScope currentSelector) { if (!TextMateService.getInstance().getPreferenceRegistry().isPossibleRightSmartTypingBrace(closingChar)) { return null; } Set<TextMateAutoClosingPair> pairs = getSmartTypingPairs(currentSelector); for (TextMateAutoClosingPair pair : p...
findSingleCharSmartTypingPair
27,923
TextMateAutoClosingPair (int offset, @NotNull CharSequence fileText, @Nullable TextMateScope currentScope) { if (offset == 0 || !TextMateService.getInstance().getPreferenceRegistry().isPossibleLeftSmartTypingBrace(fileText.charAt(offset - 1))) { return null; } Set<TextMateAutoClosingPair> pairs = getSmartTypingPairs(cu...
findAutoInsertingPair
27,924
int (@NotNull IElementType tokenType) { return BraceMatchingUtil.UNDEFINED_TOKEN_GROUP; }
getBraceTokenGroupId
27,925
boolean (@NotNull HighlighterIterator iterator, @NotNull CharSequence fileText, @NotNull FileType fileType) { if (iterator.getStart() == iterator.getEnd()) return false; IElementType tokenType = iterator.getTokenType(); TextMateScope currentSelector = tokenType instanceof TextMateElementType ? ((TextMateElementType)tok...
isLBraceToken
27,926
boolean (@NotNull HighlighterIterator iterator, @NotNull CharSequence fileText, @NotNull FileType fileType) { if (iterator.getEnd() == iterator.getStart()) return false; IElementType tokenType = iterator.getTokenType(); TextMateScope currentSelector = tokenType instanceof TextMateElementType ? ((TextMateElementType)tok...
isRBraceToken
27,927
boolean (@NotNull IElementType tokenType, @NotNull IElementType tokenType2) { return true; }
isPairBraces
27,928
boolean (@NotNull HighlighterIterator iterator, @NotNull CharSequence text, @NotNull FileType fileType) { return false; }
isStructuralBrace
27,929
IElementType (@NotNull IElementType type) { return null; }
getOppositeBraceTokenType
27,930
boolean (@NotNull IElementType lbraceType, @Nullable IElementType contextType) { return true; }
isPairedBracesAllowedBeforeType
27,931
int (@NotNull PsiFile file, int openingBraceOffset) { return openingBraceOffset; }
getCodeConstructStart
27,932
void (@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet result) { String prefix = CompletionUtil.findJavaIdentifierPrefix(parameters); CompletionResultSet resultSetWithPrefix = result.withPrefixMatcher(prefix); WordCompletionContributor.addWordCompletionVariants(...
addCompletions
27,933
Commenter (@NotNull PsiFile file, @NotNull Editor editor, @NotNull Language lineStartLanguage, @NotNull Language lineEndLanguage) { final TextMateScope actualScope = TextMateEditorUtils.getCurrentScopeSelector((EditorEx)editor); if (actualScope == null) { return null; } ShellVariablesRegistry registry = TextMateService...
getLineCommenter
27,934
boolean (@NotNull PsiFile file, @NotNull FileViewProvider viewProvider) { return file.getFileType() == TextMateFileType.INSTANCE; }
canProcess
27,935
String () { return null; }
getLineCommentPrefix
27,936
String () { return ""; }
getBlockCommentPrefix
27,937
String () { return ""; }
getBlockCommentSuffix
27,938
String () { return null; }
getCommentedBlockCommentPrefix
27,939
String () { return null; }
getCommentedBlockCommentSuffix
27,940
String () { return myLinePrefix; }
getLineCommentPrefix
27,941
String () { return myBlockPrefixes != null ? myBlockPrefixes.getPrefix() : null; }
getBlockCommentPrefix
27,942
String () { return myBlockPrefixes != null ? myBlockPrefixes.getSuffix() : null; }
getBlockCommentSuffix
27,943
String () { return null; }
getCommentedBlockCommentPrefix
27,944
String () { return null; }
getCommentedBlockCommentSuffix
27,945
TextMateScope (@NotNull EditorEx editor) { TextMateScope result = getCurrentScopeFromEditor(editor); //retrieve root scope of file if (result == null) { final VirtualFile file = editor.getVirtualFile(); if (file != null) { final TextMateLanguageDescriptor languageDescriptor = TextMateService.getInstance().getLanguageDe...
getCurrentScopeSelector
27,946
TextMateScope (@NotNull EditorEx editor) { final EditorHighlighter highlighter = editor.getHighlighter(); SelectionModel selection = editor.getSelectionModel(); final int offset = selection.hasSelection() ? selection.getSelectionStart() : editor.getCaretModel().getOffset(); final HighlighterIterator iterator = highligh...
getCurrentScopeFromEditor
27,947
TextMateBracePair (int leftBraceStartOffset, @NotNull CharSequence fileText, @Nullable TextMateScope currentScope) { if (!TextMateService.getInstance().getPreferenceRegistry().isPossibleLeftHighlightingBrace(fileText.charAt(leftBraceStartOffset))) { return null; } Set<TextMateBracePair> pairs = getAllPairsForMatcher(cu...
findRightHighlightingPair
27,948
TextMateBracePair (int rightBraceEndOffset, @NotNull CharSequence fileText, @Nullable TextMateScope currentSelector) { if (!TextMateService.getInstance().getPreferenceRegistry().isPossibleRightHighlightingBrace(fileText.charAt(rightBraceEndOffset - 1))) { return null; } Set<TextMateBracePair> pairs = getAllPairsForMatc...
findLeftHighlightingPair
27,949
Set<TextMateBracePair> (@Nullable TextMateScope selector) { if (selector == null) { return Constants.DEFAULT_HIGHLIGHTING_BRACE_PAIRS; } Set<TextMateBracePair> result = new HashSet<>(); List<Preferences> preferencesForSelector = TextMateService.getInstance().getPreferenceRegistry().getPreferences(selector); for (Prefer...
getAllPairsForMatcher
27,950
Set<TextMateAutoClosingPair> (@Nullable TextMateScope currentScope) { if (currentScope == null) { return Constants.DEFAULT_SMART_TYPING_BRACE_PAIRS; } List<Preferences> preferencesForSelector = TextMateService.getInstance().getPreferenceRegistry().getPreferences(currentScope); final HashSet<TextMateAutoClosingPair> res...
getSmartTypingPairs
27,951
void (@NotNull CharSequence fileName, @NotNull Processor<? super CharSequence> processor) { if (!processor.process(fileName)) { return; } int index = StringUtil.indexOf(fileName, '.'); while (index >= 0) { CharSequence extension = fileName.subSequence(index + 1, fileName.length()); if (extension.isEmpty()) break; if (!...
processExtensions
27,952
String (@NotNull CustomTemplateCallback callback) { CharSequence result = ""; Editor editor = callback.getEditor(); CharSequence sequence = editor.getDocument().getImmutableCharSequence(); Collection<TextMateSnippet> availableSnippets = getAvailableSnippets(editor); for (TextMateSnippet snippet : availableSnippets) { C...
computeTemplateKeyWithoutContextChecking
27,953
String (@NotNull CustomTemplateCallback callback) { int offset = callback.getEditor().getCaretModel().getOffset(); CharSequence charsSequence = callback.getEditor().getDocument().getImmutableCharSequence(); for (TextMateSnippet snippet : getAvailableSnippets(callback.getEditor())) { String key = snippet.getKey(); if (k...
computeTemplateKey
27,954
void (@NotNull String key, @NotNull CustomTemplateCallback callback) { //todo parse content and build template/templates TextMateService service = TextMateService.getInstance(); if (service != null) { SnippetsRegistry snippetsRegistry = service.getSnippetRegistry(); Editor editor = callback.getEditor(); TextMateScope s...
expand
27,955
void (@NotNull String selection, @NotNull CustomTemplateCallback callback) { // todo }
wrap
27,956
void (CompletionParameters parameters, CompletionResultSet result) { int endOffset = parameters.getOffset(); Editor editor = parameters.getEditor(); CharSequence sequence = editor.getDocument().getImmutableCharSequence(); for (TextMateSnippet snippet : getAvailableSnippets(editor)) { CharSequence prefix = getPrefixForS...
addCompletions
27,957
boolean (@NotNull CustomTemplateCallback callback, int offset, boolean wrapping) { PsiFile file = callback.getFile(); return file instanceof TextMateFile && ApplicationManager.getApplication().isInternal(); }
isApplicable
27,958
boolean (@NotNull CustomTemplateCallback callback, int offset) { return isApplicable(callback, offset, false); }
hasCompletionItem
27,959
char () { // todo settings return '\t'; }
getShortcut
27,960
boolean () { return true; }
supportsWrapping
27,961
String () { return TextMateBundle.message("textmate.live.template.name"); }
getTitle
27,962
Collection<TextMateSnippet> (@NotNull Editor editor) { TextMateService service = TextMateService.getInstance(); if (service != null) { SnippetsRegistry snippetsRegistry = service.getSnippetRegistry(); TextMateScope scope = TextMateEditorUtils.getCurrentScopeSelector(((EditorEx)editor)); return snippetsRegistry.getAvail...
getAvailableSnippets
27,963
CharSequence (@NotNull CharSequence sequence, int offset, @NotNull TextMateSnippet snippet) { int startOffset = Math.max(offset - snippet.getKey().length(), 0); for (int i = startOffset; i <= offset; i++) { if (i == 0 || StringUtil.isWhiteSpace(sequence.charAt(i - 1))) { CharSequence prefix = sequence.subSequence(i, of...
getPrefixForSnippet
27,964
void (@NotNull Editor editor, @NotNull TextMateSnippet snippet) { String key = snippet.getKey(); int offset = editor.getCaretModel().getOffset(); int newOffset = Math.max(offset - key.length(), 0); editor.getDocument().deleteString(newOffset, offset); editor.getCaretModel().moveToOffset(newOffset); EditorModificationUt...
expand
27,965
void (@NotNull final LookupEvent event) { final LookupElement item = event.getItem(); assert item instanceof CustomLiveTemplateLookupElement; if (myFile != null) { WriteCommandAction.runWriteCommandAction(myProject, TextMateBundle.message("textmate.expand.live.template.command.name"), null, () -> ((CustomLiveTemplateLo...
itemSelected
27,966
void (@NotNull Editor editor, @NotNull PsiFile file) { expand(editor, mySnippet); }
expandTemplate
27,967
void (@NotNull LookupElementPresentation presentation) { super.renderElement(presentation); presentation.setTypeText(mySnippet.getName()); presentation.setTypeGrayed(true); }
renderElement
27,968
void (char c, @NotNull PsiFile file, @NotNull Editor editor) { }
beforeCharDeleted
27,969
boolean (char c, PsiFile file, @NotNull Editor editor) { if (file.getFileType() == TextMateFileType.INSTANCE) { final int offset = editor.getCaretModel().getOffset(); EditorHighlighter highlighter = editor.getHighlighter(); HighlighterIterator iterator = highlighter.createIterator(offset); if (offset == 0 && iterator.a...
charDeleted
27,970
TextMateAutoClosingPair (char openingChar, @Nullable TextMateScope currentSelector) { if (!TextMateService.getInstance().getPreferenceRegistry().isPossibleLeftSmartTypingBrace(openingChar)) { return null; } Set<TextMateAutoClosingPair> pairs = getSmartTypingPairs(currentSelector); for (TextMateAutoClosingPair pair : pa...
findSingleCharSmartTypingPair
27,971
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
27,972
void (@NotNull final AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); if (project == null || project.isDefault()) { e.getPresentation().setEnabledAndVisible(false); return; } if (project.getService(GHHostedRepositoriesManager.class).getKnownRepositoriesState().getValue().isEmpty()) { e.getPresent...
update
27,973
void (@NotNull final AnActionEvent e) { final Project project = e.getData(CommonDataKeys.PROJECT); if (project == null || project.isDefault()) { return; } final Editor editor = e.getData(CommonDataKeys.EDITOR); final VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE); final VirtualFile[] files = e.getData(Common...
actionPerformed
27,974
void (@NotNull final Project project, @Nullable final Editor editor, @Nullable final VirtualFile file, final VirtualFile @Nullable [] files) { GithubSettings settings = GithubSettings.getInstance(); // Ask for description and other params GithubCreateGistDialog dialog = new GithubCreateGistDialog(project, getFileName(e...
createGistAction
27,975
void (@NotNull ProgressIndicator indicator) { String token = GHCompatibilityUtil.getOrRequestToken(account, project); if (token == null) return; GithubApiRequestExecutor requestExecutor = GithubApiRequestExecutor.Factory.getInstance().create(token); List<FileContent> contents = collectContents(project, editor, file, fi...
run
27,976
void () { if (url.isNull()) { return; } if (dialog.isCopyURL()) { StringSelection stringSelection = new StringSelection(url.get()); CopyPasteManager.getInstance().setContents(stringSelection); } if (dialog.isOpenInBrowser()) { BrowserUtil.browse(url.get()); } else { GithubNotifications .showInfoURL(project, GithubNotif...
onSuccess
27,977
String (@Nullable Editor editor, VirtualFile @Nullable [] files) { if (files != null && files.length == 1 && !files[0].isDirectory()) { return files[0].getName(); } if (editor != null) { return ""; } return null; }
getFileName
27,978
List<FileContent> (@NotNull Project project, @Nullable Editor editor, @Nullable VirtualFile file, VirtualFile @Nullable [] files) { if (editor != null) { String content = getContentFromEditor(editor); if (content == null) { return Collections.emptyList(); } if (file != null) { return Collections.singletonList(new FileC...
collectContents
27,979
String (@NotNull Project project, @NotNull GithubApiRequestExecutor executor, @NotNull ProgressIndicator indicator, @NotNull GithubServerPath server, @NotNull List<? extends FileContent> contents, final boolean isSecret, @NotNull final String description, @Nullable String filename) { if (contents.isEmpty()) { GithubNot...
createGist
27,980
String (@NotNull final Editor editor) { String text = ReadAction.compute(() -> editor.getSelectionModel().getSelectedText()); if (text == null) { text = editor.getDocument().getText(); } if (StringUtil.isEmptyOrSpaces(text)) { return null; } return text; }
getContentFromEditor
27,981
List<FileContent> (@NotNull final VirtualFile file, @NotNull Project project, @Nullable String prefix) { if (file.isDirectory()) { return getContentFromDirectory(file, project, prefix); } if (file.getFileType().isBinary()) { GithubNotifications .showWarning(project, GithubNotificationIdsHolder.GIST_CANNOT_CREATE, Githu...
getContentFromFile
27,982
List<FileContent> (@NotNull VirtualFile dir, @NotNull Project project, @Nullable String prefix) { List<FileContent> contents = new ArrayList<>(); for (VirtualFile file : dir.getChildren()) { if (!isFileIgnored(file, project)) { String pref = addPrefix(dir.getName(), prefix, true); contents.addAll(getContentFromFile(fil...
getContentFromDirectory
27,983
String (@NotNull String name, @Nullable String prefix, boolean addTrailingSlash) { String pref = prefix == null ? "" : prefix; pref += name; if (addTrailingSlash) { pref += "_"; } return pref; }
addPrefix
27,984
boolean (@NotNull VirtualFile file, @NotNull Project project) { ChangeListManager manager = ChangeListManager.getInstance(project); return manager.isIgnoredFile(file) || FileTypeManager.getInstance().isFileIgnored(file); }
isFileIgnored
27,985
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
27,986
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(isEnabledAndVisible(e)); }
update
27,987
void (@NotNull AnActionEvent e) { FileDocumentManager.getInstance().saveAllDocuments(); Project project = Objects.requireNonNull(e.getData(CommonDataKeys.PROJECT)); GitRepositoryManager gitRepositoryManager = project.getServiceIfCreated(GitRepositoryManager.class); if (gitRepositoryManager == null) { LOG.warn("Unable t...
actionPerformed
27,988
boolean (@NotNull AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); if (project == null || project.isDefault()) return false; GHHostedRepositoriesManager repositoriesManager = project.getServiceIfCreated(GHHostedRepositoriesManager.class); if (repositoriesManager == null) return false; Set<GHGitRe...
isEnabledAndVisible
27,989
void (@NotNull ProgressIndicator indicator) { String token = GHCompatibilityUtil.getOrRequestToken(myAccount, myProject); if (token == null) return; GithubApiRequestExecutor executor = GithubApiRequestExecutor.Factory.getInstance().create(token); myRepository.update(); GithubRepo parentRepo = validateRepoAndLoadParent(...
run
27,990
GithubRepo (@NotNull GithubApiRequestExecutor executor, @NotNull ProgressIndicator indicator) { try { GithubRepoDetailed repositoryInfo = executor.execute(indicator, GithubApiRequests.Repos.get(myAccount.getServer(), myRepoPath.getOwner(), myRepoPath.getRepository())); if (repositoryInfo == null) { GithubNotifications....
validateRepoAndLoadParent
27,991
GitRemote (@NotNull ProgressIndicator indicator, @NotNull GHRepositoryPath parentRepoPath) { LOG.info("Configuring upstream remote"); indicator.setText(GithubBundle.message("rebase.process.configuring.upstream.remote")); GitRemote upstreamRemote = findRemote(parentRepoPath); if (upstreamRemote != null) { LOG.info("Corr...
configureParentRemote
27,992
GitRemote (@NotNull GHRepositoryPath repoPath) { return ContainerUtil.find(myRepository.getRemotes(), remote -> { String url = remote.getFirstUrl(); if (url == null || !GitHostingUrlUtil.match(myAccount.getServer().toURI(), url)) return false; GHRepositoryPath remotePath = GithubUrlUtil.getUserAndRepositoryFromRemoteUr...
findRemote
27,993
boolean (@NotNull ProgressIndicator indicator, @NotNull GitRemote remote) { LOG.info("Fetching upstream"); indicator.setText(GithubBundle.message("rebase.process.fetching.upstream")); return fetchSupport(myProject).fetch(myRepository, remote).showNotificationIfFailed(); }
fetchParent
27,994
void (@NotNull ProgressIndicator indicator, @NotNull GitRemote parentRemote, @NotNull @NlsSafe String branch) { String onto = parentRemote.getName() + "/" + branch; LOG.info("Rebasing current branch"); indicator.setText(GithubBundle.message("rebase.process.rebasing.branch.onto", onto)); try (AccessToken ignore = DvcsUt...
rebaseCurrentBranch
27,995
void (@NotNull ProgressIndicator indicator, @NotNull String onto) { GitRepositoryManager repositoryManager = GitUtil.getRepositoryManager(myProject); GitRebaser rebaser = new GitRebaser(myProject, myGit, indicator); VirtualFile root = myRepository.getRoot(); GitLineHandler handler = new GitLineHandler(myProject, root, ...
doRebaseCurrentBranch
27,996
boolean (@NotNull Throwable e) { return e instanceof GithubOperationCanceledException || e instanceof ProcessCanceledException; }
isOperationCanceled
27,997
void (@NotNull Project project, @NonNls @Nullable String displayId, @NotificationTitle @NotNull String title, @NotificationContent @NotNull String message) { LOG.info(title + "; " + message); VcsNotifier.getInstance(project).notifyImportantInfo(displayId, title, message); }
showInfo
27,998
void (@NotNull Project project, @NonNls @Nullable String displayId, @NotificationTitle @NotNull String title, @NotificationContent @NotNull String message) { LOG.info(title + "; " + message); VcsNotifier.getInstance(project).notifyImportantWarning(displayId, title, message); }
showWarning
27,999
void (@NotNull Project project, @NonNls @Nullable String displayId, @NotificationTitle @NotNull String title, @NotificationContent @NotNull String message) { LOG.info(title + "; " + message); VcsNotifier.getInstance(project).notifyError(displayId, title, message); }
showError