Coder Social home page Coder Social logo

gavriyashar / matlab-editor-plugin Goto Github PK

View Code? Open in Web Editor NEW
74.0 20.0 12.0 2.62 MB

Extends features for the matlab editor, Bookmarks, FileStructure, Clipboard stack

License: MIT License

Java 95.04% MATLAB 4.96%
matlab matlab-editor matlab-development plugin

matlab-editor-plugin's People

Contributors

gavriyashar avatar martinlechner-td avatar michaelkonecny avatar tcumby avatar tushev avatar wit00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

matlab-editor-plugin's Issues

MEP wont get started by startup.m

Loading MEP via the command line works fine.

However, if i try to put
at.justin.matlab.Start.start('<path>/CustomProps.properties', ... '<path>/DefaultProps.properties');
in startup.m, Matlab won't start, in fact it won't even get past the splash screen.

Any ideas on what to do?

I'm using Matlab R2016b and MEP 1.07.

FileStructure Viewer should also show inherited methods

It would be a very nice feature if a class inherits some methods from parent classes that like in Eclipse a second press of Strg+F12 will also show all inherited methods with the class name of the implementing class in braces left to the method name.
In Matlab is it very difficult to find the implementation class of a method, so this would be a great improvement object orientated programming in Matlab.

when multiple lines are selected, duplicate/delete line should duplicate/delete all of these lines

This is a feature request.

When text across multiple lines is selected, one should be able to easily duplicate/delete all of these lines at once, like one does in IntelliJ/pyCharm.

Stage two of this enhancement would be:
If some text is selected within just one line, the duplicate shortcut should only duplicate this text within the line, not the entire line. (This is also standard behaviour in pyCharm. This is much lower priority, though.)

I might actually try and help you with this, but I first need to install Eclipse this weekend and get a slightly better grip of Java :).

Pin open editor Tab

A possibility to pin down Editor Tabs to prevent them from accidental closing.
Changing colors may help to find desired tab faster

  • pin tabs to prevent from closing
  • change the color to find tabs faster (user may change it anytime)
  • sharing same pinned elements between multiple matlab sessions?
  • how will it look on the horizontal bar?
    plannedfeature_pins

Make Preferences foolproof

At the moment settings are not checked. Entering invalid or insane values will probably throw tons of errors or might crash the system as a whole (if this happens... Well done)

Version string

changing from prerelease version string to release string returns the version in wrong format

It should be possible to change the default keyboard shortcuts of MEP

it should be possible to change Keyboard shortcuts of MEP via PrefsPanel or at least via the settings file

  • File Structure
  • copy selected text (inserts in clipboard stack)
  • clipboard stack
  • duplicate lines
  • delete lines
  • live template viewer
  • execute current lines
  • bookmark viewer
  • recently closed
  • toggle bookmark

Can't open MEP-> Settings in Preferences

When I go Home->Preferences->MEP and click no Settings, nothing happens and I get this in the console:

PrefsDialog: java.lang.IllegalArgumentException invoking at.justin.matlab.prefs.PrefsPanel.createPrefsPanel: Key ExtendedCommand is not found or not boolean
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.mathworks.mlwidgets.prefs.PrefsPanelWrapper.createPanel(PrefsPanelWrapper.java:140)
	at com.mathworks.mlwidgets.prefs.PrefsPanelWrapper.getComponent(PrefsPanelWrapper.java:95)
	at com.mathworks.widgets.prefs.PrefsUtils$2.getComponent(PrefsUtils.java:91)
	at com.mathworks.widgets.prefs.DefaultPrefsContainer.display(DefaultPrefsContainer.java:180)
	at com.mathworks.widgets.prefs.GenericPrefsDialog$6.nodeDisplayed(GenericPrefsDialog.java:404)
	at com.mathworks.widgets.prefs.AbstractPrefsNavigator.fireNodeDisplayed(AbstractPrefsNavigator.java:47)
	at com.mathworks.widgets.prefs.PrefsNavigationTree.changeNode(PrefsNavigationTree.java:270)
	at com.mathworks.widgets.prefs.PrefsNavigationTree.access$400(PrefsNavigationTree.java:39)
	at com.mathworks.widgets.prefs.PrefsNavigationTree$4.valueChanged(PrefsNavigationTree.java:208)
	at javax.swing.JTree.fireValueChanged(Unknown Source)
	at javax.swing.JTree$TreeSelectionRedirector.valueChanged(Unknown Source)
	at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(Unknown Source)
	at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(Unknown Source)
	at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(Unknown Source)
	at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(Unknown Source)
	at javax.swing.JTree.setSelectionPath(Unknown Source)
	at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(Unknown Source)
	at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(Unknown Source)
	at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(Unknown Source)
	at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
	at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$200(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Key ExtendedCommand is not found or not boolean
	at at.justin.matlab.prefs.Settings.getPropertyBoolean(Settings.java:114)
	at at.justin.matlab.prefs.PrefsPanelUtil.getCheckBox(PrefsPanelUtil.java:148)
	at at.justin.matlab.prefs.PrefsPanelUtil.getComponentsForSetting(PrefsPanelUtil.java:22)
	at at.justin.matlab.prefs.PrefsPanel.addPropsToPanel(PrefsPanel.java:150)
	at at.justin.matlab.prefs.PrefsPanel.addOtherProps(PrefsPanel.java:199)
	at at.justin.matlab.prefs.PrefsPanel.setLayout(PrefsPanel.java:115)
	at at.justin.matlab.prefs.PrefsPanel.<init>(PrefsPanel.java:29)
	at at.justin.matlab.prefs.PrefsPanel.<init>(PrefsPanel.java:33)
	at at.justin.matlab.prefs.PrefsPanel.createPrefsPanel(PrefsPanel.java:37)
	... 56 more
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at java.awt.Container.addImpl(Unknown Source)
	at java.awt.Container.add(Unknown Source)
	at com.mathworks.widgets.prefs.DefaultPrefsContainer.display(DefaultPrefsContainer.java:197)
	at com.mathworks.widgets.prefs.GenericPrefsDialog$6.nodeDisplayed(GenericPrefsDialog.java:404)
	at com.mathworks.widgets.prefs.AbstractPrefsNavigator.fireNodeDisplayed(AbstractPrefsNavigator.java:47)
	at com.mathworks.widgets.prefs.PrefsNavigationTree.changeNode(PrefsNavigationTree.java:270)
	at com.mathworks.widgets.prefs.PrefsNavigationTree.access$400(PrefsNavigationTree.java:39)
	at com.mathworks.widgets.prefs.PrefsNavigationTree$4.valueChanged(PrefsNavigationTree.java:208)
	at javax.swing.JTree.fireValueChanged(Unknown Source)
	at javax.swing.JTree$TreeSelectionRedirector.valueChanged(Unknown Source)
	at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(Unknown Source)
	at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(Unknown Source)
	at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(Unknown Source)
	at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(Unknown Source)
	at javax.swing.JTree.setSelectionPath(Unknown Source)
	at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(Unknown Source)
	at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(Unknown Source)
	at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(Unknown Source)
	at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
	at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$200(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

On Matlab R2016b.

Clipboard Stack

Clipboardstack does not recognize when something is copied from command window

Problem With KeyReleasedHandler

There seems to be an issue with KeyReleasedHandler. From time to time Matlab can't initialize the class.
Setting KS_Bookmark and ShowBookmarks not in static might do the trick

private static KeyStroke KS_BOOKMARK = KeyStrokeUtil.getMatlabKeyStroke(MatlabKeyStrokesCommands.CTRL_PRESSED_F2);
private static KeyStroke KS_SHOWBOOKARKS = KeyStrokeUtil.getKeyStroke(
            KS_BOOKMARK.getKeyCode(),
            (KS_BOOKMARK.getModifiers() & KeyEvent.CTRL_DOWN_MASK) == KeyEvent.CTRL_DOWN_MASK,
            (KS_BOOKMARK.getModifiers() & KeyEvent.SHIFT_DOWN_MASK) != KeyEvent.SHIFT_DOWN_MASK,
            false,
            false);

Live Templates

les (.txt or .m) which have default strings inside e.g.:

This file is named MEPSRC_SC.

   %% MESRCBEGIN
   % fügt automatisch Datum und Autor ein
   %
   % V1.0 | 2014-06-11 | Andreas Justin    | Ersterstellung
   %% MESRCEND
   % ${DATE}, ${AUTHORLONG}, ${COMPANY}

then Typing %SC% in matlab's editor will insert % YYYY-MM-DD, FirstName LastName, COMPANY.

MEPR replaces indent

FileUtils.readBufferedReaderToString(BufferedReader br, boolean trim)

Add trim enumeration, leading, trailing or both

various bugs

  • typing %% paints the console in deep red
  • catching exceptions when trying to feval function handles with wrong otput

Bookmarks deleted file

When a file has been deleted with stored bookmarks, bookmarksviewer throws errors on reopening them

PrefsPanel.

Remove helpText[], helpText[] can be dynamically created at runtime "help." + key

automatically insert closing bracket

When typing (, [, {, " or ' an equivalent closing bracket, quotation mark or apostrophe will be inserted.

Matlab has a way to highlight matching brackets, maybe i can abuse this feature.

com.mathworks.widgets.text.matlab.MatlabSyntaxSupport:findMatchingBracket
org.netbeans.editor.ext.ExtSyntaxSupport.BracketFinder

It's likely that an opening bracket is the same level as an closing bracket in MTree -> node.getListOfNextNodes()

FileStructure Viewer: Behavior when pressing Enter

Pressing Enter in the search box should jump to the first marked hit of the search results.
In Eclipse opening the similar panel (Strg+o) marks the method of the actual cursor selection. The search narrows the possible hits and always the first element is selected, so it's always clear for the user to which method will be jumped after pressing Enter. Pressing Esc will always close the FileStructure Viewer without modifying the actual cursor position.

cleanup workspace shortcut

im prinzip das clearvars shortcut welches keine SPs raus löscht.

checkboxes im workspace window um ein löschen von variablen zu verhindern.

add a possibility to disable/enable features

since this is a plugin in development, it's very likely that some features may misbehave and throw tons of errors or might let the system freeze.

Adding a way to disable buggy features would allow the user to work w/o removing MEP as a whole.

Write Unit Tests

Seriously I should find a way.

The dependency issue makes it kind of hard to write Unit-Tests, so i should write pseudo tests to run from Matlab.
start Matlab before unit testing, wait until finished then and continue,

Process process = new ProcessBuilder(command).start();

e.g.:

public class MFileTest {
    File testLocation;
    File classExampleFIle;

    public static void runTest() throws Exception {
        MFileTest mFileTest = new MFileTest();
        mFileTest.setUp();
        mFileTest.constructForClassDef();
        mFileTest.tearDown();
    }

    private void setUp() throws Exception {
        String testLocationString = Install.getJarFile().getParent();
        testLocation = new File(testLocationString);
        classExampleFIle = new File(testLocationString + "/ClassExample.m");

        FileUtils.exportResource("/ClassExample.m", classExampleFIle);
    }

    private void tearDown() throws Exception {

    }

    private void constructForClassDef() throws FileNotFoundException {
        InputStream stream = new FileInputStream(classExampleFIle);
        String string = FileUtils.readInputStreamToString(stream);

        MTree mTree = MTree.parse(string);
    }

FileStructure Viewer (Classes) should show the properties and their Setter and Getter Methods

The file structure viewer shows only methods of a class. This view should be extended to show also the properties and their getter and setter methods.
The information is provided in the meta class of Matlab:

  • use PropertyList.Name to show all properties,
  • use PropertyList.GetMethod to show all defined getter methods
  • use PropertyList.SetMethod to show all defined setter methods

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.