@Override public String toString() { return "NameResolveCacheKey{" + "name=" + fullName + // NOI18N ", origOffset=" + origOffset + // NOI18N ", startFile=" + startFile.getAbsolutePath() + // NOI18N ", file=" + file.getAbsolutePath() + // NOI18N ", interestedKind=" + interestedKind + // NOI18N ", hashCode=" + hashCode + '}';// NOI18N }
@Override public String toString() { if (file == null) { return "DocViewCaretAwareFactory runner"; //NOI18N } else { return "DocViewCaretAwareFactory runner for "+file.getAbsolutePath(); //NOI18N } } }
@Override public CharSequence id(CsmFile o) { return (o).getAbsolutePath(); } };
@Override public String toString() { return "OrigClassifierCacheKey{" + "origOffset=" + origOffset + ", file=" + file.getAbsolutePath() + ", startFile=" + startFile.getAbsolutePath() + ", orig=" + orig + '}'; // NOI18N } }
@Override public String toString() { if (file == null) { return "HighlightProviderTaskFactory runner"; //NOI18N } else { return "HighlightProviderTaskFactory runner for "+file.getAbsolutePath(); //NOI18N } }
@Override public String toString() { if (file == null) { return "OverrideTaskFactory runner"; //NOI18N } else { return "OverrideTaskFactory runner for "+file.getAbsolutePath(); //NOI18N } } }
@Override public void fileParsingFinished(CsmFile file) { if (TraceFlags.TRACE_PARSER_QUEUE) { System.err.println(" ProgressListenerImpl.fileParsingFinished " + file.getAbsolutePath()); } }
@Override public String getSourceName() { CsmFile currentFile = action.getCurrentFile(); if (currentFile != null) { return currentFile.getAbsolutePath().toString(); } return ""; // NOI18N }
private boolean isStandardHeader(List<FSPath> sysIncsPaths, CsmFile header) { final String path = header.getAbsolutePath().toString(); String bestSystemPath = getRelativePath(sysIncsPaths, path); return standardHeaders.contains(path.substring(bestSystemPath.length() + 1)); }
public ErrorFilesModel(List<CsmOffsetable> errors){ Map<String, CsmOffsetable> tree = new TreeMap<String,CsmOffsetable>(); for (Iterator<CsmOffsetable> it = errors.iterator(); it.hasNext(); ){ CsmOffsetable error = it.next(); String name = error.getContainingFile().getAbsolutePath().toString(); tree.put(name, error); } for (Iterator<Entry<String, CsmOffsetable>> it = tree.entrySet().iterator(); it.hasNext(); ){ Entry<String, CsmOffsetable> entry = it.next(); names.add(entry.getKey()); failedPreproDirectiveList.add(entry.getValue()); } } @Override
private static CsmNamespaceDefinition getContainingNamespaceDefinition(Collection<CsmNamespaceDefinition> collection, CsmFile file, int offset) { Iterator<CsmNamespaceDefinition> iter = collection.iterator(); while (iter.hasNext()) { CsmNamespaceDefinition ns = iter.next(); if (file.getAbsolutePath().equals(ns.getContainingFile().getAbsolutePath())) { if (ns.getStartOffset() <= offset && ns.getEndOffset() > offset) { return ns; } } } return null; }
@Override public String getShortDescription() { if (object.isValid()) { return object.getAbsolutePath().toString(); } return super.getShortDescription(); }
@Override protected void doGetErrors(CsmErrorProvider.Request request, CsmErrorProvider.Response response) { long start = System.currentTimeMillis(); Thread currentThread = Thread.currentThread(); CsmFile file = request.getFile(); currentThread.setName("Provider "+getName()+" prosess "+file.getAbsolutePath()); // NOI18N if (SHOW_TIMES) System.err.println("#@# Error Highlighting update() have started for file " + file.getAbsolutePath()); CsmFileReferences.getDefault().accept( request.getFile(), new ReferenceVisitor(request, response), CsmReferenceKind.ANY_REFERENCE_IN_ACTIVE_CODE); if (SHOW_TIMES) System.err.println("#@# Error Highlighting update() done in "+ (System.currentTimeMillis() - start) +"ms for file " + request.getFile().getAbsolutePath()); }
@Override public String getLanguage() { return Utils.getLanguage(file.getFileType(), file.getAbsolutePath().toString()); }
@Override public void run() { if (mainFile == null) { tree = new ASTFrame("AST", root); // NOI18N } else { tree = new ASTFrame(CndPathUtilities.getBaseName(mainFile.getAbsolutePath().toString()), root); // NOI18N } tree.setVisible(true); } });
private SourceFileInfo findFunction(CsmProject csmProject, String name, int lineNumber) { CsmFunction function = getFunction(csmProject, name); if (function == null) { return null; } String sourceFile = function.getContainingFile().getAbsolutePath().toString(); int startOffset = function.getStartOffset(); if (lineNumber > 0) { return new SourceFileInfo(sourceFile, lineNumber, 0); } return new SourceFileInfo(sourceFile, startOffset); //) + offset); }
private static void invalidateFileAndPreprocState(Set<CsmFile> coherenceLibrary) { for (CsmFile parent : coherenceLibrary) { CsmProject project = parent.getProject(); if (project instanceof ProjectBase) { FileImpl parentImpl = (FileImpl) parent; parentImpl.clearStateCache(); ((ProjectBase) project).invalidatePreprocState(parentImpl.getAbsolutePath()); parentImpl.markReparseNeeded(false); if (TraceFlags.USE_DEEP_REPARSING_TRACE) { System.out.println("Invalidate file to reparse " + parent.getAbsolutePath() + " from " + project); // NOI18N } } } }
public static void registerParserError(ParserErrorDelegate delegate, String message, CsmFile file, int offset) { if (file != null) { int[] lineColumn = ((FileImpl)file).getLineColumn(offset); String s = file.getAbsolutePath()+":"+lineColumn[0]+":"+lineColumn[1]+": error: "+message; //NOI18N delegate.onError(new ParserError(s, lineColumn[0], lineColumn[1], "", offset < 0)); //NOI18N } else { delegate.onError(new ParserError(message, -1, -1, "", offset < 0)); //NOI18N } }
protected OffsetableBase(CsmFile file, int start, int end) { // Parameters.notNull("file can not be null", file); // NOI18N this.fileUID = UIDCsmConverter.fileToUID(file); this.fileRef = null;// to prevent error with "final" if(end < start) { if(CndUtils.isDebugMode()) { CndUtils.assertTrueInConsole(false, "end < start for " + ((file != null)?file.getAbsolutePath():"null file") + ":[" + start + "-" + end + "]"); // NOI18N } end = start; } this.startPosition = PositionManager.createPositionID(fileUID, start, PositionManager.Position.Bias.FOWARD); this.endPosition = PositionManager.createPositionID(fileUID, end, PositionManager.Position.Bias.BACKWARD); }
private OutputTraceWriter(Object parser) { super(parser); final CsmFile mainFile; if (parser instanceof CppParserActionImpl) { mainFile = ((CppParserActionImpl) parser).getMainFile(); } else { mainFile = null; } if (mainFile == null) { io = IOProvider.getDefault().getIO("Trace actions", false); // NOI18N } else { io = IOProvider.getDefault().getIO("Trace actions "+ CndPathUtilities.getBaseName(mainFile.getAbsolutePath().toString()), false); // NOI18N } io.select(); out = io.getOut(); //out.close(); }