singularityhub / language-singularity

Singularity syntax highlighting support for Atom
GNU Affero General Public License v3.0
3 stars 1 forks source link

The extension breaks Find feature in Atom #9

Open saravanabalagi opened 5 years ago

saravanabalagi commented 5 years ago

This seems to be breaking atom's find feature on Windows (Not sure on other OSes):

20190325_202751

vsoch commented 5 years ago

Hmm, if you are able to propose a fix, and test on your machine, would be open to a PR! I have linux so I wouldn't be able to reproduce the error, but maybe others with Windows could.

saravanabalagi commented 5 years ago

I confirm that I faced the same bug in Ubuntu 18.04

Screencast

saravanabalagi commented 5 years ago

@vsoch I'm happy to help, I just do not where to look! Where could this issue be coming from?

vsoch commented 5 years ago

I was looking over the grammar (here) and it doesn't pop out immediately what might be causing it. Generally most of the match statements are to determine (when a file is open) if it should be highlighted, so the fact that "find" doesn't work sounds like a bug! A surefire way to figure it out is to go through the match statements, one by one, and remove each one, and restart the editor to see if the issue is still there. Once we figure out the statement, we can either determine if it's fix/ changeable, or if it's an Atom bug (and we will report it). How does that sound?

vsoch commented 5 years ago

The grammars should be in .atom/packages/language-boxes/grammars

vsoch commented 5 years ago

And here are the steps to try safe mode, debug, and then look for similar issues on the boards https://github.com/atom/language-python/issues/196

orbsmiv commented 4 years ago

For info, this seems to be the error that's causing the Find issue:

Screenshot 2020-01-08 at 14 26 32

(from ~/.atom/packages/language-singularity/lib/main.js)

It could be due to there being no active text editor when running Search in Folder / Project Find.

Running on macOS Catalina (10.15.1)

vsoch commented 4 years ago

I’d like to see this reproduced on a different version of Mac OS or Linux before changing anything - I know for a fact there were a lot of issues with Catalina.

orbsmiv commented 4 years ago

Hi @vsoch

I've replicated the issue in a fresh Atom install running on Ubuntu 18.04.3 LTS:

Screenshot 2020-01-09 at 09 20 53

There's a brief (and somewhat old!) discussion of a similar issue here: https://discuss.atom.io/t/cannot-get-active-text-editor-in-tests/24285 but if I understand correctly the bit around line 36 probably just needs wrapping in an if (or some other logic) statement for cases where there's no active editor window (which will always be the case when doing a project-level search). I don't know js, else I'd do a PR!

vsoch commented 4 years ago

Thank you this is hugely helpful! I'm not a javascript ninja, but I'll take a look and see if I can put together something to test.