[Suggestion] Enable spell checking by default when using Atom

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
Woetoo
Newbie
Posts: 20
Joined: Sat Feb 09, 2019 9:48 am
Contact:

[Suggestion] Enable spell checking by default when using Atom

#1 Post by Woetoo » Tue May 26, 2020 10:05 am

If I understand the process correctly, when you select Atom as your default editor - RenPy downloads a pre-packaged version 1.34.0 of Atom, including a default configuration that best supports RenPy.

I recognize that version 1.36.0 of Atom introduced some changes that makes Atom less practical when using RenPy... so I understand why it's still 1.34.0 (btw, 1.35.1 still works fine, as far as I can tell).

However, one thing that doesn't work out of the box is spell checking.

I see so many games that just include so many knucklehead spelling errors that even the simplest of checks could have fixed.
The fact that Atom is the preferred editor for RenPy makes me wonder if that is somewhat responsible for some of that.

If I'm understanding things correctly, the language-renpy package included with RenPy's version of Atom classifies all renpy code as "source-renpy" in something called "grammars". Honestly, I've tried to look at it before, and it's beyond me.

But... if you go into Atom's settings pages for the "spell-check" package to add "source-renpy" to the list of grammars... Voila... RenPy source code is spell checked by default.

If the default Atom configuration file shipped with RenPy had the following lines added...

Code: Select all

 "spell-check":
    addKnownWords: true
    grammars: [
      "source.asciidoc"
      "source.gfm"
      "text.git-commit"
      "text.plain"
      "text.plain.null-grammar"
      "source.rst"
      "text.restructuredtext"
      "source.renpy"
    ]
    
... RenPy would spell check right out of the box for new users.

I appreciate there's nothing you can do for the majority of existing users out there... but for future users... well, I think it would only help create better games.

The only downside I foresee is that Atom can't tell the difference between RenPy code and conversation text. It therefore spell checks keywords and such, which throws up what I tend to think of as false-positives. I don't know if it's even possible, but if the "language-renpy" could somehow classify conversational text as "text.plain" instead of "source.renpy"... that would fix that... But that is SO FAR outside beyond my understanding... it is more wishful thinking on my part that it might even be possible. (But if it were possible, this "add source.renpy" to the list of spellchecked grammars wouldn't be necessary).

User avatar
Zetsubou
Veteran
Posts: 494
Joined: Wed Mar 05, 2014 1:00 am
Completed: See my signature
Github: koroshiya
itch: zetsuboushita
Contact:

Re: [Suggestion] Enable spell checking by default when using Atom

#2 Post by Zetsubou » Tue May 26, 2020 7:39 pm

I think part of the problem here is the spell-check package itself (https://github.com/atom/spell-check)
There are open issues dating back to 2016 (eg. https://github.com/atom/spell-check/issues/118) regarding only spell-checking some inner scopes.
As far as I can tell, it's still not possible. So you'd either be checking everything in a renpy file (dialogue, code, everything) or nothing.

As long as that's the case, I don't think spell-check would be enabled for the source.renpy scope by default.
If it can't be limited to dialogue, then the number of false positives seem like they'd do more harm than good.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails

Working on:
Circadian Loop, A Dragon's Treasure + VN writing commissions

Image

Woetoo
Newbie
Posts: 20
Joined: Sat Feb 09, 2019 9:48 am
Contact:

Re: [Suggestion] Enable spell checking by default when using Atom

#3 Post by Woetoo » Wed May 27, 2020 1:56 pm

I get where you're coming from, but I disagree with the whole "more harm than good", even if it spell checked the whole source.
(but then I would wouldn't I... since I thought it worth suggesting).

Enabling spell checking now requires the user to:
File -> Settings -> Packages -> Search "spell-check" -> Settings -> go to "Grammars" section -> add ", renpy.source" to list of grammars.

Where as switching off spell checking, when it's available, is:
Packages -> Spell Check -> Toggle.

My point being that switching off spell checking where it's annoying the developer is a trivial matter (relatively). Whereas trying to explain how to enable spelling to a relatively inexperienced developer is like pulling teeth.
Developers, especially inexperienced ones, will follow the path of least resistance. I'm just suggesting that RenPy games as a whole would benefit if that "least effort" path included spell checking.

Meanwhile, there is an additional configuration setting which allows to add a list of "known words". At the very least it might be possible to preload that list with the majority of frequently used keywords.

Just expand the default version of config.json to include:

Code: Select all

  "spell-check":
    addKnownWords: true
    grammars: [
      "source.asciidoc"
      "source.gfm"
      "text.git-commit"
      "text.plain"
      "text.plain.null-grammar"
      "source.rst"
      "text.restructuredtext"
      "source.renpy"
    ]
    knownWords: [
      "USB"
      "xpos"
      "ypos"
      "xalign"
      "yalign"
      "xanchor"
      "yanchor"
      "xfill"
      "yfill"
      "xsize"
      "ysize"
      "wipeleft"
      "wiperight"
      "subpixel"
      "focus_mask"
      "SetVariable"
      "unhovered"
      "moveinleft"
      "moveinright"
      "moveoutleft"
      "moveoutright"
      "hpunch"
      "vpunch"
      "style_prefix"
      "vbox"
      "textbutton"
      "imagebutton"
      "after_load"
    ]
(yeah, hardly an extensive list... and probably too many infrequently used keywords in there anyway. I'm just trying to show the possibility)

Anyway, I've made my case. Either the team will agree or not.
But I hate to see such a bit QOL improvement overlooked because experienced devs can't see the advantages for inexperienced devs.

Post Reply

Who is online

Users browsing this forum: No registered users