Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
263,200
void (@NotNull VcsDirectoryMapping mapping) { if (LOG.isDebugEnabled()) { LOG.debug("remove mapping: " + mapping.getDirectory(), new Throwable()); } List<VcsDirectoryMapping> newMappings = new ArrayList<>(myMappings); newMappings.remove(mapping); updateVcsMappings(newMappings); }
removeDirectoryMapping
263,201
void () { LocalFileSystem lfs = LocalFileSystem.getInstance(); List<VcsDirectoryMapping> oldMappings = new ArrayList<>(getDirectoryMappings()); List<VcsDirectoryMapping> filteredMappings = new ArrayList<>(); VcsDirectoryMapping defaultMapping = ContainerUtil.find(oldMappings, it -> it.isDefaultMapping()); if (defaultMa...
cleanupMappings
263,202
MyVcsActivator () { Set<AbstractVcs> newVcses = !myProject.isDisposed() && TrustedProjects.isTrusted(myProject) ? ContainerUtil.map2SetNotNull(myMappings, this::getMappingsVcs) : Collections.emptySet(); List<AbstractVcs> oldVcses = myActiveVcses; myActiveVcses = List.copyOf(newVcses); refreshMainMenu(); Collection<Abst...
createVcsActivator
263,203
boolean () { for (AbstractVcs vcs : myAddVcses) { try { vcs.doActivate(); } catch (VcsException e) { LOG.error(e); } } for (AbstractVcs vcs : myRemoveVcses) { try { vcs.doDeactivate(); } catch (VcsException e) { LOG.error(e); } } return !myAddVcses.isEmpty() || !myRemoveVcses.isEmpty(); }
activate
263,204
boolean (final String name) { return ContainerUtil.exists(myActiveVcses, vcs -> Objects.equals(vcs.getName(), name)); }
haveActiveVcs
263,205
void (final String name) { if (LOG.isDebugEnabled()) { LOG.debug("beingUnregistered " + name, new Throwable()); } List<VcsDirectoryMapping> newMappings = new ArrayList<>(myMappings); newMappings.removeIf(mapping -> Objects.equals(mapping.getVcs(), name)); updateVcsMappings(newMappings); }
beingUnregistered
263,206
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MappedRoot other = (MappedRoot)o; return Objects.equals(vcs, other.vcs) && mapping.equals(other.mapping) && root.equals(other.root); }
equals
263,207
int () { return Objects.hash(vcs, mapping, root); }
hashCode
263,208
void (final VcsConfiguration.StandardOption option) { myOptions.put(option.getId(), new PersistentVcsShowSettingOptionImpl(option, this)); }
createSettingFor
263,209
void (final VcsConfiguration.StandardConfirmation confirmation) { myConfirmations.put(confirmation.getId(), new PersistentVcsShowConfirmationOptionImpl(confirmation, this)); }
createConfirmationFor
263,210
PersistentVcsShowConfirmationOption (@NotNull VcsConfiguration.StandardConfirmation option) { return myConfirmations.get(option.getId()); }
getConfirmation
263,211
PersistentVcsShowSettingOption (@NotNull VcsConfiguration.StandardOption option) { return myOptions.get(option.getId()); }
getOption
263,212
List<PersistentVcsShowSettingOption> () { return new ArrayList<>(myOptions.values()); }
getAllOptions
263,213
List<PersistentVcsShowConfirmationOption> () { return new ArrayList<>(myConfirmations.values()); }
getAllConfirmations
263,214
PersistentVcsShowSettingOption (@NotNull String vcsActionName, @NotNull AbstractVcs vcs) { return myOptions.computeIfAbsent(vcsActionName, key -> new LegacyVcsShowOptionsSettingImpl(vcsActionName, this)); }
getOrCreateCustomOption
263,215
boolean (@NotNull VirtualFile file) { return file instanceof AbstractVcsVirtualFile; }
isApplicable
263,216
String (@NotNull VirtualFile file, @NotNull String baseUniqueName) { return ((AbstractVcsVirtualFile)file).getPresentableName(baseUniqueName); }
getEditorTabTitle
263,217
VirtualFile[] () { return new VirtualFile[]{myChild}; }
getChildren
263,218
boolean () { return true; }
isDirectory
263,219
VirtualFileSystem () { return myFileSystem; }
getFileSystem
263,220
String () { return myPath; }
getPath
263,221
String () { return myName; }
getName
263,222
String () { return getPresentableName(myName); }
getPresentableName
263,223
String (@NotNull @Nls String baseName) { if (myRevision == null) return baseName; return baseName + " (" + myRevision + ")"; }
getPresentableName
263,224
boolean () { return false; }
isWritable
263,225
boolean () { return true; }
isValid
263,226
VirtualFile () { return myParent; }
getParent
263,227
VirtualFile[] () { return null; }
getChildren
263,228
OutputStream (Object requestor, long newModificationStamp, long newTimeStamp) { throw new RuntimeException(VcsFileSystem.getCouldNotImplementMessage()); }
getOutputStream
263,229
long () { return myModificationStamp; }
getModificationStamp
263,230
long () { return myModificationStamp; }
getTimeStamp
263,231
long () { try { return contentsToByteArray().length; } catch (IOException e) { return 0; } }
getLength
263,232
void (boolean asynchronous, boolean recursive, Runnable postRunnable) { if (postRunnable != null) postRunnable.run(); }
refresh
263,233
void (String revision) { myRevision = revision; }
setRevision
263,234
void (@NotNull VcsException e) { ApplicationManager.getApplication().invokeLater(() -> Messages.showMessageDialog( VcsBundle.message("message.text.could.not.load.virtual.file.content", getPresentableUrl(), e.getLocalizedMessage()), VcsBundle.message("message.title.could.not.load.content"), Messages.getInformationIcon()...
showLoadingContentFailedMessage
263,235
VcsFileRevision () { return myFileRevision; }
getFileRevision
263,236
Charset () { if (myCharset != null) return myCharset; return super.getCharset(); }
getCharset
263,237
boolean () { return false; }
isDirectory
263,238
String () { if (myRevision == null) { try { loadContent(); } catch (IOException e) { LOG.info(e); } } return myRevision; }
getRevision
263,239
VcsFileSystem () { return (VcsFileSystem)VirtualFileManager.getInstance().getFileSystem(PROTOCOL); }
getInstance
263,240
String () { return PROTOCOL; }
getProtocol
263,241
VirtualFile (@NotNull String path) { return null; }
findFileByPath
263,242
void (boolean asynchronous) { }
refresh
263,243
VirtualFile (@NotNull String path) { return null; }
refreshAndFindFileByPath
263,244
void (Object requestor, @NotNull VirtualFile file, long oldModificationStamp) { super.fireContentsChanged(requestor, file, oldModificationStamp); }
fireContentsChanged
263,245
String () { return VcsBundle.message("exception.text.internal.errror.could.not.implement.method"); }
getCouldNotImplementMessage
263,246
ContentRevisionVirtualFile (@NotNull ContentRevision contentRevision) { synchronized (ourCache) { for (ContentRevisionVirtualFile file : ourCache) { if (contentRevision.equals(file.getContentRevision())) return file; } ContentRevisionVirtualFile file = new ContentRevisionVirtualFile(contentRevision); ourCache.add(file)...
create
263,247
boolean () { return false; }
isDirectory
263,248
void () { try { byte[] bytes = ChangesUtil.loadContentRevision(myContentRevision); synchronized (LOCK) { myContent = bytes; myContentLoadFailed = false; setRevision(myContentRevision.getRevisionNumber().asString()); } } catch (VcsException e) { synchronized (LOCK) { myContentLoadFailed = true; myContent = ArrayUtilRt.E...
loadContent
263,249
ContentRevision () { return myContentRevision; }
getContentRevision
263,250
String (@Nls @NotNull String baseName) { VcsRevisionNumber number = getContentRevision().getRevisionNumber(); if (number instanceof ShortVcsRevisionNumber) { return baseName + " (" + ((ShortVcsRevisionNumber) number).toShortString() + ")"; } return super.getPresentableName(baseName); }
getPresentableName
263,251
List<PatchHunk> (@NotNull String beforeContent, @NotNull String afterContent) { return buildPatchHunks(beforeContent, afterContent, CONTEXT_LINES); }
buildPatchHunks
263,252
List<PatchHunk> (@NotNull String beforeContent, @NotNull String afterContent, int contextLineCount) { if (beforeContent.equals(afterContent)) return Collections.emptyList(); if (beforeContent.isEmpty()) { return singletonList(createWholeFileHunk(afterContent, true, true)); } if (afterContent.isEmpty()) { return singlet...
buildPatchHunks
263,253
List<Range> (@NotNull List<Range> fragments, int hunkStart, int contextLineCount) { int hunkEnd = hunkStart + 1; while (hunkEnd < fragments.size()) { Range lastFragment = fragments.get(hunkEnd - 1); Range nextFragment = fragments.get(hunkEnd); if (lastFragment.end1 + contextLineCount < nextFragment.start1 - contextLine...
getAdjacentFragments
263,254
PatchHunk (@NotNull List<? extends Range> hunkFragments, @NotNull List<String> beforeLines, @NotNull List<String> afterLines, boolean beforeNoNewlineAtEOF, boolean afterNoNewlineAtEOF, int contextLineCount) { Range first = hunkFragments.get(0); Range last = hunkFragments.get(hunkFragments.size() - 1); int contextStart1...
createHunk
263,255
List<Range> (@NotNull List<String> beforeLines, @NotNull List<String> afterLines, boolean beforeNoNewlineAtEOF, boolean afterNoNewlineAtEOF) { // patch treats "X\n" vs "X" as modification of a single line, while we treat it as a deletion of an empty line // so we have to adjust output accordingly if (!beforeNoNewlineAt...
compareLines
263,256
List<Range> (@NotNull List<? extends Range> ranges, @NotNull Range change) { if (ranges.isEmpty()) return singletonList(change); Range lastRange = ranges.get(ranges.size() - 1); if (lastRange.end1 == change.start1 && lastRange.end2 == change.start2) { Range mergedChange = new Range(lastRange.start1, change.end1, lastRa...
appendRange
263,257
List<Range> (@NotNull List<String> beforeLines, @NotNull List<String> afterLines) { try { FairDiffIterable iterable = ByLine.compare(beforeLines, afterLines, ComparisonPolicy.DEFAULT, DumbProgressIndicator.INSTANCE); return ContainerUtil.newArrayList(iterable.iterateChanges()); } catch (DiffTooBigException e) { return ...
doCompareLines
263,258
void (@NotNull PatchHunk hunk, @NotNull List<String> lines, @NotNull PatchLine.Type type, int index, boolean noNewlineAtEOF) { String line = lines.get(index); boolean isLastLine = index == lines.size() - 1; PatchLine patchLine = new PatchLine(type, line); patchLine.setSuppressNewLine(noNewlineAtEOF && isLastLine); hunk...
addLineToHunk
263,259
PatchHunk (@NotNull String content, boolean isInsertion, boolean isWithEmptyFile) { PatchLine.Type type = isInsertion ? PatchLine.Type.ADD : PatchLine.Type.REMOVE; List<String> lines = tokenize(content); boolean noNewlineAtEOF = !content.endsWith("\n"); int contentStart = 0; int contentEnd = lines.size(); int emptyStar...
createWholeFileHunk
263,260
TextFilePatch (@NotNull AirContentRevision beforeRevision, @NotNull AirContentRevision afterRevision) { TextFilePatch result = new TextFilePatch(afterRevision.getCharset(), afterRevision.getLineSeparator()); setPatchHeading(result, beforeRevision, afterRevision); return result; }
buildPatchHeading
263,261
void (@NotNull FilePatch result, @NotNull AirContentRevision beforeRevision, @NotNull AirContentRevision afterRevision) { result.setBeforeName(getRelativePath(myBasePath, beforeRevision.getPath())); result.setBeforeVersionId(getRevisionName(beforeRevision)); result.setAfterName(getRelativePath(myBasePath, afterRevision...
setPatchHeading
263,262
String (@NotNull Path basePath, @NotNull FilePath filePath) { try { Path path = filePath.getIOFile().toPath(); if (!path.isAbsolute()) return filePath.getPath(); return basePath.relativize(path).toString().replace(File.separatorChar, '/'); } catch (IllegalArgumentException e) { return filePath.getPath(); } }
getRelativePath
263,263
List<String> (@NotNull String text) { return LineTokenizer.tokenizeIntoList(text, false, true); }
tokenize
263,264
VirtualFile () { return myBaseDir; }
getBaseDir
263,265
int () { return mySkipTopDirs; }
getSkipTopDirs
263,266
boolean () { return myAllowRename; }
isAllowRename
263,267
boolean () { return myCreateDirectories; }
isCreateDirectories
263,268
ApplyPatchContext () { return new ApplyPatchContext(myBaseDir, mySkipTopDirs, false, false); }
getPrepareContext
263,269
void (final VirtualFile file) { FilePath path = VcsUtil.getFilePath(file); myPathsBeforeRename.put(file, path); }
registerBeforeRename
263,270
FilePath (final VirtualFile file) { final FilePath path = myPathsBeforeRename.get(file); if (path != null) return path; return VcsUtil.getFilePath(file); }
getPathBeforeRename
263,271
List<BeforeAfter<AirContentRevision>> (@NotNull Project project, @NotNull List<? extends Change> changes, boolean honorExcludedFromCommit) { final List<BeforeAfter<AirContentRevision>> result = new ArrayList<>(changes.size()); addConvertChanges(project, changes, result, honorExcludedFromCommit); return result; }
revisionsConvertor
263,272
void (@NotNull Project project, @NotNull Collection<? extends Change> changes, @NotNull List<? super BeforeAfter<AirContentRevision>> result, boolean honorExcludedFromCommit) { Collection<Change> otherChanges = PartialChangesUtil.processPartialChanges(project, changes, false, (partialChanges, tracker) -> { if (!tracker...
addConvertChanges
263,273
AirContentRevision (@Nullable ContentRevision cr) { return convertRevision(cr, null); }
convertRevision
263,274
boolean (@Nullable ContentRevision cr) { if (cr == null) return false; if (cr instanceof BinaryContentRevision) return true; return cr.getFile().getFileType().isBinary(); }
isBinaryRevision
263,275
AirContentRevision (@Nullable ContentRevision cr, @Nullable String actualTextContent) { if (cr == null) { return null; } FilePath filePath = cr.getFile(); if (actualTextContent != null) { return new PartialTextAirContentRevision(actualTextContent, cr, filePath); } else if (cr instanceof ByteBackedContentRevision && isB...
convertRevision
263,276
Long (@NotNull ContentRevision revision) { if (revision instanceof CurrentContentRevision) { try { FilePath filePath = revision.getFile(); Path path = filePath.getIOFile().toPath(); return Files.getLastModifiedTime(path).toMillis(); } catch (IOException e) { return null; } } return null; }
getRevisionTimestamp
263,277
boolean () { return true; }
isBinary
263,278
String () { throw new IllegalStateException(); }
getContentAsString
263,279
String () { return myRevision.getRevisionNumber().asString(); }
getRevisionNumber
263,280
FilePath () { return myFilePath; }
getPath
263,281
boolean () { return false; }
isBinary
263,282
String () { return myRevision.getRevisionNumber().asString(); }
getRevisionNumber
263,283
FilePath () { return myFilePath; }
getPath
263,284
Charset () { return myRevision.getFile().getCharset(); }
getCharset
263,285
String () { VirtualFile virtualFile = myRevision.getFile().getVirtualFile(); return virtualFile != null ? virtualFile.getDetectedLineSeparator() : null; }
getLineSeparator
263,286
String () { return myContent; }
getContentAsString
263,287
byte[] () { return myContent.getBytes(getCharset()); }
getContentAsBytes
263,288
String () { return "com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP"; }
getName
263,289
CharSequence (@NotNull Project project, @NotNull String path, @Nullable CommitContext commitContext) { if (commitContext == null) { return null; } Map<FilePath, ContentRevision> baseRevisions = commitContext.getUserData(ourBaseRevisions); if (baseRevisions != null) { Path file = resolvePatchPath(project, path); FilePat...
provideContent
263,290
void (@NotNull Project project, @NotNull String path, @NotNull CharSequence content, @Nullable CommitContext commitContext) { if (commitContext == null) { return; } Map<String, String> map = commitContext.getUserData(ourStoredTexts); if (map == null) { map = new HashMap<>(); commitContext.putUserData(ourStoredTexts, ma...
consumeContentBeforePatchApplied
263,291
String (@NotNull Project project, @NotNull String path) { return resolvePatchPath(project, path).toString(); }
getStoredTextKey
263,292
Path (@NotNull Project project, @NotNull String path) { return ProjectKt.getStateStore(project).getProjectBasePath().resolve(path); }
resolvePatchPath
263,293
PatchFileHeaderInfo (Iterator<String> iterator) { String lineSeparator = "\n"; StringBuilder message = new StringBuilder(); VcsUser author = null; String revision = null; boolean treatAllAsMessageLine = false; while (iterator.hasNext()) { String curLine = iterator.next(); Matcher revisionMatcher = ourBaseRevisionPatter...
parseHeader
263,294
String (@Nullable Project project, @Nullable Path patchBasePath, @NotNull String filePath) { if (project == null || patchBasePath == null) return filePath; String newBaseDir = project.getBasePath(); if (newBaseDir == null) return filePath; String relativePath = FileUtil.getRelativePath(new File(newBaseDir), new File(pa...
getPathRelatedToProjectDir
263,295
String (@NotNull FilePatch patch, boolean beforePath) { if (beforePath) { return patch.isNewFile() ? DEV_NULL : A_PREFIX + patch.getBeforeName(); } else { return patch.isDeletedFile() ? DEV_NULL : B_PREFIX + patch.getAfterName(); } }
getRevisionHeadingPath
263,296
String () { return "com.intellij.openapi.diff.impl.patch.CharsetEP"; }
getName
263,297
CharSequence (@NotNull Project project, @NotNull String path, @Nullable CommitContext commitContext) { Path file = ProjectKt.getStateStore(project).getProjectBasePath().resolve(path); VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByNioFile(file); return vf == null ? null : vf.getCharset().name(); }
provideContent
263,298
void (@NotNull Project project, @NotNull String path, @NotNull CharSequence content, @Nullable CommitContext commitContext) { if (commitContext == null) { return; } Map<String, String> map = commitContext.getUserData(ourName); if (map == null) { map = new HashMap<>(); commitContext.putUserData(ourName, map); } Path fil...
consumeContentBeforePatchApplied
263,299
int () { return myLine; }
getLine