Editing I7 with Atom Editor

In 2016, @zarf created a syntax highlighter for I7 on Atom. This is a great development since the Inform IDE has some limitations (for me, I am struggling with slow typing rates with large files). I also struggle with clicking into a section of the story file, and then having no easy way to zoom back out.

There were a few feature requests left hanging here: https://intfiction.org/t/i7-syntax-coloring-for-bbedit-mac/4571

Code Navigation Aids in Atom

With a small file, it is easy enough to scrub up and down or ⌘-F your way to happiness. With a large file, less so (my current work is 7000 lines and growing). As you scroll up and down, there are no rapid visual clues to the relative hierarchy of sections of the document. While I don’t expect Atom to generate Inform IDE’s great index, there are a few things that would help:

  1. Code folding for the volume, book, part, chapter, and section (a fold-all option, essentially provides an index)
  2. Options to modify how these headings appear, particularly font-size increases for higher-level headings
  3. Options to indent code within each level heading

Inform IDE Integration

Currently using any external editor feels like a hack. And there is a real possibility of code falling out-of-sync. Here are some feature requests that would help that:

  1. Inform IDE has built-in support for an external editor
  2. Inform IDE checks periodically for file modification and picks up that new version (or asks) like most modern editors
  3. An option from Atom to edit/compile/run in the Inform IDE.

Thank you for all your work providing these tools.

1 Like

I’m not sure the Inform IDE should have built-it support for external editors. For me, the IDE is arleady kind of a supercharged text editor.

In any case, with advanced text editors such as Atom, I think it’s the role of the text editor to add support for Inform through extensions, not the other way around.

Have you heard of the VS Code extension I wrote? Not only does it highlight Inform source, but it also allows to compile, play and release Inform projects directly within VS Code (and underlines errors when compiling).

Features are missing (jumping to a heading, creating projects and extensions, installing extensions, replaying previous commands, the skein, the documentation or the index), but it’s definitely possible to add them. (Well, it’s quite difficult for the index because Inform outputs whole HTML pages instead of only the useful data, but anyway.) In fact, it’s totally possible to fully replicate Inform IDE’s experience in VS Code.

I’m sure it’s possible to do the same with the Atom extension, if someone was willing to dedicate their time.

3 Likes

I am. At least point 2 above – that is basic ecosystem compatibility for any editor.

1 Like

If you are talking about watching external modifications, yeah, sure, I think that feature should be added to the IDE, too.

I was seeing the point 1 (which is separate from the point 2 you mentioned) as a “prefered editor” field in the settings, specifying what sofware should open when you open a source or an extension. Say, like in a game engine like Unity, where you still edit game objets in Unity but C# files in your editor of choice. In Inform’s case, since the main asset is the source, I’m not sure how that would be useful (you’d always switch to the IDE to test or look at the index anyway.) And you can open extensions in your editor of choice without having a specific field in the settings for it.

It would be useful. I understand you prefer the Inform IDE. Not everyone does.

Anything that would streamline the workflow for using an external editor is useful, including:

  1. Option to edit with default external editor
  2. Periodic checks for modified file, and confirmation before replacing file contents (particularly if it has been changed).
  3. An option for an external editor to load/compile/run the file in the Inform IDE.
  4. An option NOT to save before compile in the IDE. (this changes my file contents in my external editor)

Right now, using Atom, every time I compile I am forced to:

  1. save the file in Atom,
  2. go to the Inform IDE, close the window if I left it open, careful not to save
  3. confirm I don’t want to save (which would overwrite my changes in my editor)
  4. go to file > open recent > select my project to reopen the project
  5. click Go to compile it.
  6. if I have errors, I have to click the link which takes me to the location
  7. copy the text of the broken code
  8. go back to Atom and search for the text
  9. rinse, repeat

It is manageable, I suppose, but not a great workflow.

If you can’t compile directly from your other IDE, then it’s not an IDE.

1 Like

Unless I’m not understanding, that can’t be done from the IDE’s side (at least not completely). You’d still have to have an extension/plug-in in your text editor to hook into the IDE. (For example, my VS Code extension does the compilation part, and the story can be played directly in VS Code, mostly removing the need for the IDE.)


As for your workflow, an easy way to improve it is to write your project entirely in a project-specific extension. (Relevant section of Inform’s documentation.)

You would write

Project by wmodes begins here.

The Kitchen is a room.

[And the rest of your story.]

Project ends here.

in projectname.materials/Extensions/wmodes/Project.i7x.

Your main source file would only contain the title and include the above extension.

"My Awesome Project" by wmodes

Include Project by wmodes.

You’ll then only need to open and edit the project-specific extension in Atom, leaving the main source file to Inform’s IDE. You’ll still need to search manually mistakes in your code when compiling, but you won’t need to close and reopen your project in Inform’s IDE constantly, and the extension won’t save automatically when compiling.

This also allows to split your project into multiple files, alleviating the need to be able to jump to any heading in a single big file.

That’s really helpful. That’s a huge improvement. I was nervous that it would cache the “extension” but it reloads it during each compile.