gavriyashar / matlab-editor-plugin Goto Github PK
View Code? Open in Web Editor NEWExtends features for the matlab editor, Bookmarks, FileStructure, Clipboard stack
License: MIT License
Extends features for the matlab editor, Bookmarks, FileStructure, Clipboard stack
License: MIT License
When deleting a line with bookmarks MEP enters an endless loop
add a feature to delete currentline in editor
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.
If there is no editor available on startup, matlab will freeze on 2017a_pre
When I set feature.enableClipboardStack
to false
in the preferences file,
the mentioned shortcuts don't work in editor.
(Clicking right and selecting copy/paste does work, however).
quick search for live templates via CTRL + SPACE
Hidden methods are not displayed correctly
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.
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 :).
Editing files containing bookmarks outside of Matlab (e.g. Notepad or any version control software like Git) may render bookmarks useless.
A possibility to pin down Editor Tabs to prevent them from accidental closing.
Changing colors may help to find desired tab faster
add a feature to duplicate current line in editor
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)
when bookmarksCount is not available
changing from prerelease version string to release string returns the version in wrong format
it should be possible to change Keyboard shortcuts of MEP via PrefsPanel or at least via the settings file
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.
See title
currently the custom properties are stored in a arbitrarily order. It's easier to read for humans if ordered.
http://stackoverflow.com/questions/17011108/how-can-i-write-java-properties-in-a-defined-order
Clipboardstack does not recognize when something is copied from command window
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);
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
.
much like chromes CTRL+SHIFT+T
winopen(prefdir)
MATLABDesktop.xml
MATLABDesktop.xml.prev
might help. idk
No the old search text is shown after reopening the FileStructure viewer. If I want to search for a different method (usually I do), now I have to delete the old search text before.
FileUtils.readBufferedReaderToString(BufferedReader br, boolean trim)
Add trim enumeration, leading, trailing or both
Matlab checks if the method "insert" was called by an EDT, if not matlab prints out the stacktrace
"Event in command window doc NOT on Event thread"
The commands which are submitted to the command window by pressing Shift+F9 aren't shown in the command history.
%%
paints the console in deep redWhen a file has been deleted with stored bookmarks, bookmarksviewer throws errors on reopening them
MEP is not working in undocked windows (except window was docked before MEP was started)
This would be the same behavior like in Eclipse.
java.lang.StringIndexOutOfBoundsException
Remove helpText[], helpText[] can be dynamically created at runtime "help." + key
Filestructure list not scrolling down if selection changed via UP or DOWN
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()
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.
keylistener is †evil†
im prinzip das clearvars shortcut welches keine SPs raus löscht.
checkboxes im workspace window um ein löschen von variablen zu verhindern.
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.
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);
}
Using KeyListeners
for EditorSyntaxTextPane
is not the smartest thing to do.
If parts of one or more lines are selected, they should be automatically extended to the first character of the first line and the last character of the last line after pressing Shift+F9.
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:
PropertyList.Name
to show all properties,PropertyList.GetMethod
to show all defined getter methodsPropertyList.SetMethod
to show all defined setter methodsA declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.