-
Notifications
You must be signed in to change notification settings - Fork 636
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
Improvement: Dockable Text Editor and Find/Replace #6513
Comments
@Racel A great image which demonstrates the need for a better code editing environment. |
@Racel - We should consider this for the webui. |
This covers my suggestion from earlier: |
Pardon the thread resurrection, but I would like to suggest a different avenue here. Instead of developing a code editor from scratch that lives inside Dynamo, would it not be better to provide an integration point with the various IDEs out there ? How would this workSo instead of writing code in an editor inside Dynamo, you would write it in your favourite IDE (Visual Studio Code, Visual Studio, JetBrains, etc) and have Dynamo read that source file. All of these support Python for example and a plugin for them that provides support for DesignScript would surely be quicker and easier to write than a watered-down IDE for Dynamo. All the IDEs above have support for code completion, linting, version control, etc - none of which are trivial to implement. Practical exampleAs a practical example, I recently needed to run an external python script from Dynamo (IronPython does not support numpy) and built a small CLI node for it. Similarly, I can imagine a new Core node that takes a Aspects to considerTwo potential issues come to mind :
n birds, 1 stoneAs in the issue referenced by @dimven above, people are looking for this IDE-like functionality in both the DS editor and the Python one. This would potentially solve those and also add support for C#, VB, etc. Curious to hear what you think @Racel @ikeough @dimven @ThomasMahon |
@radumg - Since I wrap every single Python node I create in a custom node, I'd much rather see this capability inside Dynamo. I absolutely see the benefits of what you're suggesting, though. Perhaps a compromise might be to have an "Edit in external app" button in code blocks and Python nodes (the editor could be specified in Dynamo's Settings menu). Dynamo would then create a temporary file and launch it in the external editor. If the file is saved in the external editor Dynamo will recognize those changes and ask the user whether to reload the modfied code much like what you're suggesting above. Great work on the DateTime.Format node, btw. |
Thanks @andydandy74 ! What you're describing above is exactly the type of functionality that could easily be built once the infrastructure teaching Dynamo to handle external script files & IDEs is in place. Great suggestion ! Might have a look at it this month if i get some time, would welcome assistance :) |
@radumg I think its a good idea - although is this not essentially the equivalent as, for example, Visual Studio's "Attach to Process" debug process? That said, this may be too complicated for most users, or too steeped in the realm of computer programming, which I've found is a hard sell to members of the design team. In my opinion, one big advantage of having a purpose-built debugger in Dynamo is the 'visual' aspect. What I mean by this is really in reference to GC (Bentley's Generative Components) debugger. Its purpose-built, and well designed, but here's the master stroke: as you debug your code, geometry is drawn as you step through (the 'visual' aspect). It makes debugging far more accessible and is more 'design' orientated since there is an onus on visualisation throughout - it basically removes a layer of abstraction and opens up the software to a far broader audience, not just coders or programmers. I think for this one reason alone (assuming it would also be possible to achieve in Dynamo), its a good enough reason to pursue a custom-built debugger for Dynamo as that's going to be one of the few ways to make such features possible. Its worth adding that in my early days/years of computational design, were it not for the ability to view geometry creation as I stepped through using the debugger, it would have stifled my development. The potential here then, in particular reference to new users, shouldn't be overlooked! Here's an example of GC's debugger drawing geometry via the debugger as the code is stepped-through: |
Thanks for the comment @ThomasMahon, I do agree that educational value is something important to keep in mind. Don't think suggestion above detracts from it, on the contrary - it would allow beginners to interact with Python code in a much more suited & forgiving environment : IDEs that have full-featured auto-completion, linting support, etc, see issue #3378. For example, this should help avoid the myriad of posts where a tab or space is misplaced in Python code, accelerating their learning. On the debugger side, thanks for posting the gif, really interesting to see GC in action. |
In favor of integration with IDEs - which one first? |
@ke-yu @aparajit-pratap - Any thoughts? Didn't we have a prototype for a debugger? What would it take to add search, debugging, and watching of variables in our current implementation? FYI- @mjkkirschner |
@Racel @jnealb, @junmendoza revived the old DesignScript IDE/debugger to work with Dynamo CBN's so yes, it's possible and it saved the effort of rewriting a debugger for DS. There are a couple of things to keep in mind though:
Pros are:
Cons:
|
@aparajit-pratap - Excellent! So, do you have the prototype working in some capacity? Can you send over images/gifs/video so we can assess how much UI/UX work may be needed? |
@aparajit-pratap I look forward to see the progress. It would help in my prototyping efforts. Get in touch anytime you need some collaboration |
@ThomasMahon Dynamo Team is working on an improved UI, which we will make available to our users. |
Dynamo version
0.9.2
Operating system
Win 10
Improvement Suggestion
I'm finding coding using DeisgnScript quite tedious when I have written lots of code (see image for an example). The code block cant be resized, and when I zoom in to see my code, the scroll bar is out of view...so I have to zoom out, move it, zoom back in. Its very disruptive when coding and problem solving. I end up simply selecting the text to nudge the view across to avoid this behaviour.
The other issue is simply finding the right block of code to do updates or troubleshoot definitions...where is it...more zooming in and out. No find tool. Its arduous to say the least.
My suggestion is to have a dockable text editor panel which is capable of 'collecting' all the DesignScript defs. Should then be easy to implement a find/replace tool. Anonymous code blocks can remain put to avoid 'muddying' the text editor.
The text was updated successfully, but these errors were encountered: