atom / language-python

Python package for Atom
Other
190 stars 146 forks source link

Fold code seems to be unstable #301

Closed BinaryAura closed 5 years ago

BinaryAura commented 5 years ago

Prerequisites

Description

Folding handles don't always appear and the shortcuts don't always work. I have not been able to determine any reason why they would or would not work. Sometimes it does work but a while later it would be working.

Steps to Reproduce

This problem seems to happen randomly.

  1. Open Atom
  2. Open Folder
  3. Edit python3 code for a while
  4. Attempt to fold a function

Expected behavior: Function folds for any function/block

Actual behavior: Nothing, Handle is missing. But not on all. Sometimes the handle will come back then go away again

Reproduces how often: Everytime I code with atom. But it seems to be random, once it happens it won't fix itself for hours

Versions

Atom : 1.36.0 Electron: 2.0.18 Chrome: 61.0.3163.100 Node : 8.9.3 x64 apm : 2.1.3 npm : 6.2.0 python : 2.7.15 (python3 3.7.2 is also on the system) git : 2.20.1 OS : Fedora release 29 (VMWare 14.1.7 build-12989993 on Windows 10 Version 1809 (OS Build 17763.437))

Additional Information

I just work normally, then I go to fold a function, and I can't...sometimes. I don't get it.

In the attachment, you should note that the handle is on line 199 for def _pushPlayer() but not on line 214 for def parseResponse(). But I've been able to fold parseResponse() before. atom no fold handle

BinaryAura commented 5 years ago

I found and fixed the problem... Atom doesn't know what to do when a (,[,or { is not matched, and when this happens the current function and some functions after handles break. I didn't think about this earlier.

rsese commented 5 years ago

Thanks for the report!

I found and fixed the problem... Atom doesn't know what to do when a (,[,or { is not matched, and when this happens the current function and some functions after handles break. I didn't think about this earlier.

Can you share a minimal code example that we can copy/paste along with steps to reproduce?

no-response[bot] commented 5 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.