kubapod / devtools Goto Github PK
View Code? Open in Web Editor NEWDevTools and styles for mathematica developers
DevTools and styles for mathematica developers
Incorporate:
<|"Label" -> "Localize variable",
"ShortKey" -> "l",
"Action" :> Catch @ Module[
{initialCaretPosition, symbol, selection, nb=InputNotebook[], modified = False, SymbolNameQ}
, SymbolNameQ = StringMatchQ[LetterCharacter~~(LetterCharacter|DigitCharacter|"$")...]
; symbol = CurrentValue@"SelectionData"
; If[ !MatchQ[symbol, _String?SymbolNameQ], Throw @ $Failed]
; initialCaretPosition = "CharacterRange" /. FrontEndExecute@FrontEnd`UndocumentedGetSelectionPacket@nb
; While[
True
, If[selection===$Failed, Break[]]
; If[
Not @ MatchQ[selection,RowBox[{"Module"|"With"|"Block"|"DynamicModule","[",___}]]
, FrontEndExecute @ FrontEndToken[nb,"ExpandSelection"]
; selection = CurrentValue@"SelectionData"
; Continue[]
]
; SelectionMove[nb,Before,Word] (*before head*)
; SelectionMove[nb,After,Word,3] (*after head[{ *)
; NotebookWrite[nb, symbol<>", "]
; modified=True
; Break[]
]
; SelectionMove[nb, Before, CellContents]
; SelectionMove[nb, Next, Character, First @ initialCaretPosition + StringLength[symbol<>", "]If[modified, 1 , 0] ]
; SelectionMove[nb, All, Character, #2-#& @@ initialCaretPosition]
]
|>
Hi Kuba - I'm trying to track down the source of a front end issue that causes MMA to be "not responding" for 5-10s at a time, and not being familiar with paclets and so on haven't been able to work out how to uninstall devtools and or MPM so I can eliminate them as causes. Can you advise? (I just dragged out the devtools package from the folder but Ctrl+1 still works, just doesn't find the devtools any more so I haven't achieved much yet) Thanks, Julian
PS I thought the front end issue might have been due to Eclipse, graphics drivers, ... but the issue persists even when not using Workbench in Eclipse and I've swapped around the graphics from internal CPU to external graphics card and back without resolving the issue...
Add basic package template for quick prototyping:
<|"Label" -> "Package",
"ShortKey" -> "p",
"Template" -> "
BeginPackage[\"`sel`<*FromCharacterCode[96]*>\"];
Unprotect[\"<*FromCharacterCode[96]*>*\", \"<*FromCharacterCode[96]*>*<*FromCharacterCode[96]*>*\"];
ClearAll[\"<*FromCharacterCode[96]*>*\", \"<*FromCharacterCode[96]*>*<*FromCharacterCode[96]*>*\"];
Begin[\"<*FromCharacterCode[96]*>Private<*FromCharacterCode[96]*>\"];
End[];
Protect[\"<*FromCharacterCode[96]*>*\"];
EndPackage[];"
|>
Ctrl+1... letter key: breaks if one takes it literally and enters e.g. Shift+N to get indicate capital letter; should handle upper & lower case letters the same?
More generally, I have used the New Function template a couple of times, but it's not to my specific personal prefs and I can't find where the template is - because I'm still ignorant about many internals; however, if an edit command could be added to the menu that would solve it. I did try CodeTemplatesEdit[] but without the example of new function to work from I couldn't do it - and I would be overloading rather than replacing the template if I used the same key, so again direct access to the default templates would be desirable.
Thanks for the opportunity to make a minor contribution - Julian
I really like the stylesheet, but I can't get those two rather obnoxious toolbars disabled. How can I do that?
It is quite annoying when an Input cell converted to Code looses all automatic indentation.
Allow selection to be one expansion from wrapping the symbol to consider it valid.
Currently it only works if the given symbol is selected.
A 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.