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.