public boolean checkClangFormat(String clangformat) { if (clangformat == null) { err.println("clang-format is not specified."); return false; } File file = new File(clangformat); if (!file.exists()) { err.println("clang-format (" + clangformat + ") does not exist."); return false; } if (!file.canExecute()) { err.println("clang-format (" + clangformat + ") is not executable."); return false; } return true; }
public void debugLog ( final String string ) { this.console.getLogStream ().println ( string ); }
public void debugLog ( final String string ) { this.console.getLogStream ().println ( string ); }
public boolean runClangFormatOnSave(IResource resource) { if (!enableClangFormatOnSave(resource)) { return false; } String clangFormat = getClangFormatPath(); if (clangFormat == null) { err.println("clang-format command must be specified in preferences."); return false; } File file = new File(clangFormat); if (!file.exists()) { err.println("clang-format (" + clangFormat + ") does not exist."); return false; } if (!file.canExecute()) { err.println("clang-format (" + clangFormat + ") is not executable."); return false; } return true; }
@Override public void handle(BuildOutputEvent event, IOperationMonitor monitor) throws IOException, CoreException { BufferedReader reader = event.getInput(); String line; while ((line = reader.readLine()) != null) { if (stream.isClosed()) { throw new OperationCanceledException(); } stream.println(line); } }
private void logToConsole(String string) { if (consoleStream == null || consoleStream.isClosed()) { consoleStream = findConsole().newMessageStream(); } consoleStream.println(string); }
MessageConsole console = new MessageConsole("My Console", null); console.activate(); ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{ console }); MessageConsoleStream consoleStream = console.newMessageStream(); consoleStream.println("Hello, world!");
err.println( "Cannot find .clang-format or _clang-format configuration file under any level " + "parent directories of path (" + path + ")."); err.println("Clang-format will default to Google style."); err.println("clang-format return error (" + code + ")."); err.println(errout.toString()); return null; err.println(errout.toString()); return null;
private void loadScript ( final String module ) throws Exception { this.console.getLogStream ().println ( String.format ( "Loading script module: %s", module ) ); // fire load event try { final String uri = this.symbolLoader.resolveUri ( module ); this.factoryContext.loadedResource ( URI.createURI ( uri ) ); } catch ( final Exception e ) { } // load final String moduleSource = this.symbolLoader.loadStringResource ( module ); final ScriptExecutor s = this.scriptManager.parse ( moduleSource, module ); if ( s != null ) { s.execute ( this.scriptContext ); } }
private void loadScript ( final String module ) throws Exception { this.console.getLogStream ().println ( String.format ( "Loading script module: %s", module ) ); // fire load event try { final String uri = this.symbolLoader.resolveUri ( module ); this.factoryContext.loadedResource ( URI.createURI ( uri ) ); } catch ( final Exception e ) { } // load final String moduleSource = this.symbolLoader.loadStringResource ( module ); final ScriptExecutor s = this.scriptManager.parse ( moduleSource, module ); if ( s != null ) { s.execute ( this.scriptContext ); } }