@Override public String toString() { return "restore " + include + " from line " + line + " in file " + include.getContainingFile(); // NOI18N } }
@Override public List<CsmInclude> getIncludeStack(CsmInclude inc) { return getIncludeStack(inc.getContainingFile()); }
for (Iterator<CsmInclude> it = includes.iterator(); it.hasNext(); ){ CsmInclude incl = it.next(); files.add(incl.getContainingFile()); String name; if (incl.isSystem()){
private void appendInclStack(StringBuilder buf, List<CsmInclude> includeStack) { if (!includeStack.isEmpty()) { buf.append("<i>").append(i18n("PathToCurFile")).append("</i>\n"); // NOI18N for (CsmInclude inc : includeStack) { if (inc != null) { final CsmFile file = inc.getContainingFile(); CharSequence path = null; if (file != null) { path = file.getAbsolutePath(); } if (path == null) { path = "?"; //NOI18N } final CsmOffsetable.Position startPosition = inc.getStartPosition(); int line = -1; if (startPosition != null) { line = startPosition.getLine(); } if (file != null && startPosition != null){ String msg = i18n("PathToHeaderOnLine", path.toString(), line); // NOI18N buf.append(msg).append('\n'); } } } } }
private void gatherFileMaps() { final HashSet<CsmFile> visitedFiles = new HashSet<>(); // gather all visible by this file's include stack List<CsmInclude> includeStack = CsmFileInfoQuery.getDefault().getIncludeStack(destFile); for (CsmInclude inc : includeStack) { CsmFile includedFrom = inc.getContainingFile(); int incOffset = inc.getStartOffset(); gatherFileMaps(visitedFiles, includedFrom, MIN_FILE_OFFSET, incOffset); } // gather all visible by this file upto destination offset gatherFileMaps(visitedFiles, this.destFile, this.startOffset, this.destOffset); }
public boolean goToInclude(Document doc, JTextComponent target, int offset, HyperlinkType type) { if (!preJump(doc, target, offset, "opening-include-element", type)) { //NOI18N return false; } IncludeTarget item = findTargetObject(doc, offset); if (type == HyperlinkType.ALT_HYPERLINK && ((item != null))) { CsmInclude incl = item.getInclude(); CsmFile toShow = incl.getIncludeFile(); if (toShow == null) { toShow = incl.getContainingFile(); } else { CsmInclude brokenInclude = getFirstBrokenIncludeInsideIncludedFiles(toShow, new HashSet<CsmFile>()); if (brokenInclude != null) { toShow = brokenInclude.getContainingFile(); // jump into problem file return postJump(brokenInclude, "goto_source_source_not_found", "cannot-open-include-element");//NOI18N } } CsmIncludeHierarchyResolver.showIncludeHierachyView(toShow); return true; } else { return postJump(item, "goto_source_source_not_found", "cannot-open-include-element");//NOI18N } }
if (list.size() > 0) { buf.append(i18n("PathToHeader")); // NOI18N file = list.get(0).getContainingFile(); for (CsmInclude inc : list) { buf.append("\n<br> "); // NOI18N buf.append(inc.getContainingFile().getAbsolutePath()); buf.append(i18n("PathToHeaderLine", inc.getStartPosition().getLine())); // NOI18N
CsmFile srcFile = include.getContainingFile(); int endOffset = include.getStartOffset(); Iterator<CsmVariable> it = CsmSelect.getStaticVariables(srcFile, filter);
CsmFile includedFrom = inc.getContainingFile(); int incOffset = inc.getStartOffset(); gatherMaps(includedFrom, incOffset, out);
buf.append(i18n(key, CsmDisplayUtilities.htmlize(inclString), brokenInclude.getContainingFile().getAbsolutePath())); tooltip = buf.toString(); out.println("path to file " + csmFile.getAbsolutePath(), new RefLink(csmFile)); // NOI18N for (CsmInclude incl : includeStack) { out.println(incl.getText() + " from file " + incl.getContainingFile().getAbsolutePath(), new RefLink(incl)); // NOI18N