Skip to content

Big IDE enchavements : New Editor, AutoComplete, Doc Tooltips, New SyntaxColoring, etc... #2563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0063898
refactoring of Sketck class and creation of BaseSketck class allowing
ricardojlrufino Jan 21, 2015
11f6eb0
State of the buttons (UNDO / REDO) is now in
ricardojlrufino Jan 23, 2015
4c83280
Trying to fix (unsuccessfully) support for the Japanese Input
ricardojlrufino Jan 23, 2015
83891fd
Removed old Japanese support files (perhaps the new java already support
ricardojlrufino Jan 23, 2015
13269a9
[Linux] Installation Script that creates shortcuts on the menu and
ricardojlrufino Jan 23, 2015
b07d636
Syntax highlighting Styles
ricardojlrufino Jan 23, 2015
0c466b0
New Editor based on RSyntaxTextArea (for autocomplete and syntax errors)
ricardojlrufino Jan 23, 2015
5834681
Improved rendering of the name of the tabs
ricardojlrufino Jan 23, 2015
0a2839e
Arduino IDE Launcher class
ricardojlrufino Jan 23, 2015
a181828
arduino-autocomplete module project
ricardojlrufino Jan 23, 2015
12c6b14
Refactoring sketche to support listeners, integration with autocomplete
ricardojlrufino Jan 23, 2015
9b64e70
Listeners to monitor changes in sketches and in the active libraries
ricardojlrufino Jan 23, 2015
00fc88a
Classes for the Log control and some utility classes
ricardojlrufino Jan 23, 2015
3cc9157
Correction in REGEX doing parser of compilation errors (in LINUX)
ricardojlrufino Jan 23, 2015
403133e
small refactoring on PdePreprocessor
ricardojlrufino Jan 23, 2015
3b8007a
[Important] Added line in the beginning, to the autocomplete detect
ricardojlrufino Jan 23, 2015
3a67523
Base - logs configuration and fix the icon on Linux
ricardojlrufino Jan 23, 2015
a7f6c51
Linux - improvements in the script to display icons correctly and spash
ricardojlrufino Jan 23, 2015
9e196f1
Fixes in the build scripts for autocomplete module
ricardojlrufino Jan 23, 2015
0f0ba70
improvement when adding items in autocomplete
ricardojlrufino Mar 8, 2015
aaf4273
Rename class PdeTokenMarker to SketchTokenMaker
ricardojlrufino Mar 8, 2015
2bc6da2
update lib cplus-libparser
ricardojlrufino Mar 8, 2015
f5cc40f
update arduino.desktop link
ricardojlrufino Mar 8, 2015
4f72737
update build .classpath
ricardojlrufino Mar 9, 2015
d5aa45e
remove unused imports
ricardojlrufino Mar 9, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@
<classpathentry kind="lib" path="test-lib/fest-util-1.1.2.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/arduino-core"/>
<classpathentry kind="lib" path="test-lib/jcip-annotations-1.0.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/arduino-autocomplete"/>
<classpathentry kind="lib" path="lib/cplus-libparser-0.0.1.jar" sourcepath="/cplus-libparser"/>
<classpathentry kind="lib" path="lib/jsoup-htmlparser-1.8.1.jar"/>
<classpathentry kind="lib" path="lib/rsyntax-autocomplete-2.6.0-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="lib/rsyntaxtextarea-2.6.0-SNAPSHOT.jar" sourcepath="/RSyntaxTextArea"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions app/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</fileset>
<pathelement path="${env.JAVA_HOME}/lib/tools.jar"/>
<pathelement path="../arduino-core/arduino-core.jar"/>
<pathelement path="../arduino-autocomplete/arduino-autocomplete.jar"/>
</path>

<path id="class.path.test">
Expand Down
Binary file added app/lib/cplus-libparser-0.0.1.jar
Binary file not shown.
Binary file added app/lib/jsoup-htmlparser-1.8.1.jar
Binary file not shown.
Binary file added app/lib/rsyntax-autocomplete-2.6.0-SNAPSHOT.jar
Binary file not shown.
Binary file added app/lib/rsyntaxtextarea-2.6.0-SNAPSHOT.jar
Binary file not shown.
9 changes: 0 additions & 9 deletions app/run-linux.launch
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java-6-openjdk-amd64&quot; javaProject=&quot;processing&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/processing/lib/ecj.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/processing/lib/jna.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/processing/lib/jssc-2.6.0.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;processing-core&quot; type=&quot;1&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;processing&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="processing.app.Base"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="processing"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djava.library.path=lib/"/>
Expand Down
36 changes: 36 additions & 0 deletions app/src/ArduinoIDE.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */

/*
Part of the Processing project - http://processing.org

Copyright (c) 2004-10 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

import processing.app.Base;

/**
* Arduino IDE Launcher class
* @author Ricardo JL Rufino ([email protected])
* @date 23/01/2015
*/
public class ArduinoIDE {

public static void main(String[] args) throws Exception {
Base.main(args);
}

}
28 changes: 17 additions & 11 deletions app/src/cc/arduino/packages/formatter/AStyle.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package cc.arduino.packages.formatter;

import processing.app.Base;
import processing.app.Editor;
import processing.app.helpers.FileUtils;
import processing.app.syntax.JEditTextArea;
import processing.app.tools.Tool;
import static processing.app.I18n._;

import java.io.File;
import java.io.IOException;

import static processing.app.I18n._;
import javax.swing.text.BadLocationException;

import processing.app.Base;
import processing.app.Editor;
import processing.app.helpers.FileUtils;
import processing.app.syntax.SketchTextArea;
import processing.app.tools.Tool;

public class AStyle implements Tool {

Expand Down Expand Up @@ -55,13 +57,17 @@ public void run() {
return;
}

JEditTextArea textArea = editor.getTextArea();
int line = textArea.getLineOfOffset(textArea.getCaretPosition());
int lineOffset = textArea.getCaretPosition() - textArea.getLineStartOffset(line);

SketchTextArea textArea = editor.getTextArea();
editor.setText(formattedText);
editor.getSketch().setModified(true);
textArea.setCaretPosition(Math.min(textArea.getLineStartOffset(line) + lineOffset, textArea.getSafeLineStopOffset(line) - 1));

try {
int line = textArea.getLineOfOffset(textArea.getCaretPosition());
int lineOffset = textArea.getCaretPosition() - textArea.getLineStartOffset(line);
textArea.setCaretPosition(Math.min(textArea.getLineStartOffset(line) + lineOffset, textArea.getLineEndOffset(line) - 1));
} catch (BadLocationException e) {
e.printStackTrace();
}
// mark as finished
editor.statusNotice(_("Auto Format finished."));
}
Expand Down
49 changes: 44 additions & 5 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,20 @@
import java.io.*;
import java.util.*;
import java.util.List;
import java.util.logging.ConsoleHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.swing.*;

import br.com.criativasoft.cpluslibparser.LibraryIndex;
import cc.arduino.packages.DiscoveryManager;
import cc.arduino.packages.autocomplete.SketchCompletionProvider;
import processing.app.debug.TargetBoard;
import processing.app.debug.TargetPackage;
import processing.app.debug.TargetPlatform;
import processing.app.helpers.CommandlineParser;
import processing.app.helpers.FileUtils;
import processing.app.helpers.GUIUserNotifier;
import processing.app.helpers.OSUtils;
import processing.app.helpers.PreferencesMap;
import processing.app.helpers.*;
import processing.app.helpers.filefilters.OnlyDirs;
import processing.app.helpers.filefilters.OnlyFilesWithExtension;
import processing.app.javax.swing.filechooser.FileNameExtensionFilter;
Expand Down Expand Up @@ -89,6 +91,7 @@ public class Base {

static public void main(String args[]) throws Exception {
BaseNoGui.initLogger();
initLogger();

BaseNoGui.notifier = new GUIUserNotifier();

Expand Down Expand Up @@ -166,6 +169,34 @@ static public void main(String args[]) throws Exception {
new Base(args);
}


static public void initLogger() {
Handler consoleHandler = new ConsoleLogger();
consoleHandler.setLevel(Level.ALL);
consoleHandler.setFormatter(new LogFormatter("%1$tl:%1$tM:%1$tS [%4$7s] %2$s: %5$s%n"));

Logger globalLogger = Logger.getGlobal();
globalLogger.setLevel(consoleHandler.getLevel());

// Remove default
Handler[] handlers = globalLogger.getHandlers();
for(Handler handler : handlers) {
globalLogger.removeHandler(handler);
}
Logger root = Logger.getLogger("");
handlers = root.getHandlers();
for(Handler handler : handlers) {
root.removeHandler(handler);
}

globalLogger.addHandler(consoleHandler);

Logger.getLogger(SketchCompletionProvider.class.getPackage().getName()).setParent(globalLogger);
Logger.getLogger(LibraryIndex.class.getPackage().getName()).setParent(globalLogger);
Logger.getLogger(Base.class.getPackage().getName()).setParent(globalLogger);

}


static protected void setCommandLine() {
commandLine = true;
Expand Down Expand Up @@ -1855,6 +1886,14 @@ static public void setIcon(Frame frame) {
// don't use the low-res icon on Mac OS X; the window should
// already have the right icon from the .app file.
if (OSUtils.isMacOS()) return;

// don't use the low-res icon on Linux
if (OSUtils.isLinux()){
String current = System.getProperty("user.dir");
Image image = Toolkit.getDefaultToolkit().createImage(current + "/lib/arduino.png");
frame.setIconImage(image);
return;
}

Image image = Toolkit.getDefaultToolkit().createImage(PApplet.ICON_IMAGE);
frame.setIconImage(image);
Expand Down
6 changes: 3 additions & 3 deletions app/src/processing/app/CaretAwareUndoableEdit.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package processing.app;

import processing.app.syntax.JEditTextArea;

import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;

public class CaretAwareUndoableEdit implements UndoableEdit {

private final UndoableEdit undoableEdit;
private final int caretPosition;

public CaretAwareUndoableEdit(UndoableEdit undoableEdit, JEditTextArea textArea) {
public CaretAwareUndoableEdit(UndoableEdit undoableEdit, RSyntaxTextArea textArea) {
this.undoableEdit = undoableEdit;
this.caretPosition = textArea.getCaretPosition();
}
Expand Down
Loading