code-peek-atom icon indicating copy to clipboard operation
code-peek-atom copied to clipboard

Error reported

Open cheborneck opened this issue 7 years ago • 9 comments

Peek function does not currently support Babel ES6 Javascript files. New to React and Atom so if there's a config file you want to see let me know.

cheborneck avatar Jul 05 '18 16:07 cheborneck

Hey, just send me an example of the function you're trying to peek and I'll see if I can reproduce it. Also, the type of file shown at the bottom matters. If you could tell me what that is or see if it's in this list (https://github.com/DFreds/code-peek-atom/blob/master/lib/supported-files.coffee), that'd be great.

DFreds avatar Jul 06 '18 03:07 DFreds

[image1.jpeg]

Tom Hare

On Jul 5, 2018, at 8:33 PM, DFreds <[email protected]mailto:[email protected]> wrote:

Hey, just send me an example of the function you're trying to peek and I'll see if I can reproduce it. Also, the type of file shown at the bottom matters. If you could tell me what that is or see if it's in this list (https://github.com/DFreds/code-peek-atom/blob/master/lib/supported-files.coffeehttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDFreds%2Fcode-peek-atom%2Fblob%2Fmaster%2Flib%2Fsupported-files.coffee&data=02%7C01%7C%7Ce2c5daa4d31e4dc4375f08d5e2f136d9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636664447983383736&sdata=z4mltbQHDiMyerADMhO5kzg2MPZ4FuGYXkdUTqsYlcE%3D&reserved=0), that'd be great.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDFreds%2Fcode-peek-atom%2Fissues%2F41%23issuecomment-402915646&data=02%7C01%7C%7Ce2c5daa4d31e4dc4375f08d5e2f136d9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636664447983383736&sdata=aireInQAIJV4x76uFPXSkWOBiAdEZQd3Vo9yVNSVWc8%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAMLxFJPby0N0eLqRy47ykrLoME56o-nhks5uDtp9gaJpZM4VENbP&data=02%7C01%7C%7Ce2c5daa4d31e4dc4375f08d5e2f136d9%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636664447983383736&sdata=CSZH8oU6DFk0Uo2k5yi%2Fu%2B%2FjG9yOttsXE99NivQS3BI%3D&reserved=0.

cheborneck avatar Jul 06 '18 03:07 cheborneck

I think something went wrong there.

DFreds avatar Jul 06 '18 03:07 DFreds

I mean that I can't see the image. Please send me some code and a picture of your atom window.

DFreds avatar Jul 09 '18 15:07 DFreds

I don't know if I have exactly the same problem, but after a fresh package install of code-peek, the javascript functions should be found I guess, however, when I select the description text of a function or the part where I import it, the ctrl-alt-e shortcut returns an error: "Could not find {functionName} in project".

However if the function is declared within the scope of the same file it does not return an error. It feels like code-peek does not search through all of the files in the project. Is that correct? And if so, would you know a fix?

TLDR; ctrl-alt-e only works within the same file

HanJoHibender avatar Nov 08 '18 09:11 HanJoHibender

Hm, I wrote code peek a long time ago. It uses the Atom API to search through all the files for a match based on some regular expressions. It's possible that Atom has updated it's API since I've looked at it. I'll check it out

DFreds avatar Nov 08 '18 14:11 DFreds

@HanJoHibender Can you send me an example of the function declaration you're trying to match?

DFreds avatar Nov 08 '18 14:11 DFreds

@HanJoHibender Can you send me an example of the function declaration you're trying to match?

These are async functions used in a React environment, async and const are not part of the normal declaration. I think unfilled they are called anonymous functions, but anonymous declarations are out of scope.

Example: export const functionName = async ( variables ) => { code }

HanJoHibender avatar Nov 08 '18 15:11 HanJoHibender