[I7 IDE; Mac] Edit in External Editor; Sync with IDE

This is more a question about multiple editor usage, mainly for classroom purposes and allowing for a bit of an easier time with multiple source files, which we store as extensions for the moment. In these classes there are a mix of students with either Windows or Mac machines.

I notice that with the Windows IDE you can edit source.ni outside of the IDE itself (say, in VS Code or Atom) and that change will be reflected in the IDE. The same applies to any of your .i7x files.

However, when using the Mac IDE, this does not happen.

I wasn’t sure if this was just “the way it is” on the Mac or if there was something that I could do to allow this syncing between editors.

Side note: we would be happy to just use the Inform 7 extension editor but it doesn’t seem that either IDE lets you open an extension that’s in your project itself, at least from within the IDE. It expects that all extensions to be opened are installed, versus in your project. And, in this context, the Mac editor will let you click on a file to open it in the editor but the Windows version will not so I’m not sure I can use that as a consistent strategy.

You can access the plain-text source file (story.ni) on all platforms, macOS just “hides” the file. You need to navigate to your project in Finder, then right-click it and select “Show package contents”.

If by “syncing” you mean that you want the IDE to automatically reload the file whenever it changes while it’s open, I don’t think that’s possible. You need to keep the IDE closed down while using another editor or you’d risk your changes being overwritten.

Got it. Yeah, I meant syncing between the editors. So, for example, on Windows I can have the Inform 7 IDE open and also have my project loaded in, say, VS Code. When I make changes to source.ni in VS Code, those updates are reflected in the IDE.

That same thing doesn’t happen on the Mac version.

Your point about overwriting is a totally valid concern but in our case we often use the external editor for all editing, only using the Inform 7 IDE for the compiling, looking at the Index, etc. The reason for using the external editor approach is it just makes it a lot easier to have a project with multiple source files that are all visible at a glance and openable as tabs within the editor.

In the case of the Windows version, you don’t lose changes because both editors update. So if I make a change in VS Code, it updates in Inform 7 IDE right away. Thus no discrepancies.

I’ll plug my project inf7 – facilitating the use of an external editor is one of the reasons I wrote it. It’s a command-line program that can compile a project, translate the project index to straight HTML viewable in any browser, and, on successful compilation launch an interpreter running the game or on failure, a browser showing Problems.html. Other than the skein, I don’t think there’s any significant IDE functionality missing. It’s in ruby; once you’ve installed that, I would expect it to be straightforward to install and use on a Mac (though I haven’t tried it).

All that said, while I could recommend it to a sole developer, it would probably be a nuisance to write up installation instructions for a multi-platform classroom of students and to train them in how to use it. But I thought I’d offer it up.

Quite interesting! And I actually did have your post on this topic bookmarked for further study.

We do actually have Ruby on all of the machines due to other projects we are writing in that language. So this is definitely worth looking at and I appreciate you reminding me about this! (I also very much appreciate the work you put into your project.)

Sadly, that’s just the way it is. Updating the Mac editor to allow this has been on my long-time wishlist, but nobody has offered a patch.

You can edit extensions in the project itself using an external editor. There’s no chance of overwriting the file that way. So one plan is to have a tiny source file that does nothing but include extensions.

However, this doesn’t work perfectly. The IDE doesn’t check timestamps, so sometimes it refuses to recompile even though you’ve edited an extension. Then you have to go into the source pane and hit enter (adding a blank line) to convince the IDE that it’s recompile time.