Page 1 of 1

Editing modules outside of the VMD editor?

Posted: Tue Dec 06, 2022 6:12 am
by TheGarnet
Can we edit our java source outside of the VMD editor?

I am really missing having multi-window edit. Paging back and forth in a single window is driving me a little crazy.

Would really love to edit my VM modules with Joe's editor.....

Re: Editing modules outside of the VMD editor?

Posted: Tue Dec 06, 2022 7:01 am
by Aarnville
There is a setting in preferences that will allow VMD to recognise edits made outside the IDE but there are a couple of limitations, the main one being that any edits you make in the auto-generated sections are ignored and overwritten when you pull the file back into VMD. This is particularly annoying if you want to refactor anything that is included in InitilaizedControls().

I ran like this for a while but it quickly got frustrating. So now I run with Notepad++ on a second monitor and manually cut and paste chunks of stuff between the two for more complex edits. NP++ does all the usual stuff with colour coding, brace matching, formatting and comprehensive search/replace and also has a superb column edit mode. It's still not ideal but definitely better for me and it's an editor I know inside out.

For a couple of my more complex modules I developed and tested much of the code in a separate NetBeans environment but that's only really useful on particular cases. Netbeans is also a good way to play with code snippets you find on places like StackOverflow where someone has asked "How do I do X?" and got half a dozen completely different replies, all of which work, leaving you wondering which is best or most efficient or, in some cases, the most understandable.

Re: Editing modules outside of the VMD editor?

Posted: Tue Dec 06, 2022 12:34 pm
by poetix
I am using IntelliJ to work on a Java project that builds a jar file, which my VMD project imports. Unfortunately there's no way to get the VM types into Intellij - no API jar I can import - so everything on the IntelliJ side has to be "pure" DSP / state management etc code that then gets wired up to the VM system in the VMD project. But it turns out that leads to better-organised code anyway - a separation of concerns between stuff that responds to knobs being twiddled and triggers being received, and the underlying sound engine that turns inputs into outputs.

Re: Editing modules outside of the VMD editor?

Posted: Wed Dec 07, 2022 5:53 am
by UrbanCyborg
Compiler Explorer is also worth a check:

https://godbolt.org/

I always edit in an external editor, in my case Multi-Edit. Yeah, I know it's dead and gone, but it still works gangbusters for me, especially since I have a very large library of macros for it. And, I was DoSD there for a couple of years back around '05. For me, the only downside to it is that it never supported UniCode, save to translate out of it.

Reid

Re: Editing modules outside of the VMD editor?

Posted: Sat Dec 10, 2022 1:51 am
by AllanH
I am using Visual Studio Code with Java extensions. The seems to work well and all the [/user-ABC] tags are visible.

It is a bit dangerous as a CTRL-S in in VMD may overwrite the Java file. Its just so painful to the built-in editor.

I found Eclipse to cumbersome with VMD.

Re: Editing modules outside of the VMD editor?

Posted: Sat Dec 10, 2022 10:20 am
by UrbanCyborg
I always save from my external editor, with no problems, so long as I resave in VMD when I toggle back to it, so that it's aware of the changes.

Reid

Re: Editing modules outside of the VMD editor?

Posted: Sat Dec 10, 2022 12:04 pm
by Waverley Instruments
UrbanCyborg wrote: Sat Dec 10, 2022 10:20 am I always save from my external editor, with no problems, so long as I resave in VMD when I toggle back to it, so that it's aware of the changes.
Same here using Sublime. Just have to be careful not to make a change in VMD if you haven't saved in the editor, otherwise you get a prompt to re-load the file when you flip back to the editor, potentially loosing your code changes :?

I keep meaning to do a VM plugin for Sublime but it's really not high priority especially as Sublime is "vaguely smart" about remembering stuff. For example, once you've used GetSmoothValue() once when editing a file, it'll remember and suggest it for auto-completion.

Re: Editing modules outside of the VMD editor?

Posted: Sat Dec 10, 2022 1:23 pm
by ColinP
I don't have any problems using VMD's built-in editor. Yes, it's pretty basic but after using it for a while I can edit at very high speed. To be honest I don't even think about editing as it's something so low level that it's effectively done on auto-pilot and doesn't have much impact on productivity.

But then my first commercial programming was done on an Apple II which featured a 40 x 24 character display, all in uppercase.

Cue Monty Python's Four Yorkshiremen sketch...