GithubHelp home page GithubHelp logo

Comments (10)

tgandrews avatar tgandrews commented on July 30, 2024

Do you have more of the code from the file? It creates an AST of the whole
file. Sounds like there is a strange # in the file somewhere.
On Fri, 29 Apr 2016 at 02:59, Andrew Williams [email protected]
wrote:

[Enter steps to reproduce below:]

put cursor before:

function main()

and ran jsdoc block

Atom Version: 1.7.3
System: Mac OS X 10.10.5
Thrown From: atom-easy-jsdoc
https://github.com/tgandrews/atom-easy-jsdoc package, v4.5.0
Stack Trace

Uncaught SyntaxError: Unexpected character '#' (1:0)

At /Users/andrew/.atom/packages/atom-easy-jsdoc/node_modules/acorn/dist/acorn.js:922

SyntaxError: Unexpected character '#' (1:0)
at Parser.pp.raise (/Users/andrew/.atom/packages/atom-easy-jsdoc/node_modules/acorn/dist/acorn.js:920:13)
at Parser.pp.getTokenFromCode (/Users/andrew/.atom/packages/atom-easy-jsdoc/node_modules/acorn/dist/acorn.js:2813:8)
at Parser.pp.readToken (/Users/andrew/.atom/packages/atom-easy-jsdoc/node_modules/acorn/dist/acorn.js:2508:15)
at Parser.pp.nextToken (/Users/andrew/.atom/packages/atom-easy-jsdoc/node_modules/acorn/dist/acorn.js:2500:71)
at Parser.parse (/Users/andrew/.atom/packages/atom-easy-jsdoc/node_modules/acorn/dist/acorn.js:1615:10)
at Object.parse (/Users/andrew/.atom/packages/atom-easy-jsdoc/node_modules/acorn/dist/acorn.js:882:44)
at getNode (/Users/andrew/.atom/packages/atom-easy-jsdoc/lib/jsdocer.js:207:21)
at comment (/Users/andrew/.atom/packages/atom-easy-jsdoc/lib/jsdocer.js:273:16)
at createComment (/Users/andrew/.atom/packages/atom-easy-jsdoc/lib/index.js:23:29)
at atom-text-editor.jsdocBlock (/Users/andrew/.atom/packages/atom-easy-jsdoc/lib/index.js:52:9)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/homebrew-cask/Caskroom/atom/1.5.3/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
at /opt/homebrew-cask/Caskroom/atom/1.5.3/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/opt/homebrew-cask/Caskroom/atom/1.5.3/Atom.app/Contents/Resources/app.asar/node_modules/command-palette/lib/command-palette-view.js:183:32)
at CommandPaletteView.module.exports.SelectListView.confirmSelection (/opt/homebrew-cask/Caskroom/atom/1.5.3/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
at space-pen-div.atom.commands.add.core:confirm (/opt/homebrew-cask/Caskroom/atom/1.5.3/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:109:19)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/homebrew-cask/Caskroom/atom/1.5.3/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
at /opt/homebrew-cask/Caskroom/atom/1.5.3/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/opt/homebrew-cask/Caskroom/atom/1.5.3/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/opt/homebrew-cask/Caskroom/atom/1.5.3/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/opt/homebrew-cask/Caskroom/atom/1.5.3/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:98:36)
at HTMLDocument. (/opt/homebrew-cask/Caskroom/atom/1.5.3/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

Commands

 -2:11.3.0 jsdoc-generator:out (atom-text-editor.editor)
 -2:00.7.0 open-in-browser:open-tree-view (span.name.icon.icon-file-text)
 -1:34.8.0 core:save (atom-text-editor.editor.is-focused)
 -1:20.9.0 command-palette:toggle (atom-text-editor.editor.is-focused)
 -1:19 core:confirm (atom-text-editor.editor.mini.is-focused)
 -1:19 jsdoc:block (atom-text-editor.editor)
 -0:28 core:move-right (atom-text-editor.editor.is-focused)
 -0:27.4.0 editor:select-to-first-character-of-line (atom-text-editor.editor.is-focused)

2x -0:26.9.0 core:backspace (atom-text-editor.editor.is-focused)
2x -0:25 core:save (atom-text-editor.editor.is-focused)
-0:10 core:backspace (atom-text-editor.editor.is-focused)
-0:08.8.0 core:save (atom-text-editor.editor.is-focused)
-0:04.2.0 editor:newline (atom-text-editor.editor.is-focused)
-0:03.1.0 command-palette:toggle (atom-text-editor.editor.is-focused)
-0:01.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)
-0:01.4.0 jsdoc:block (atom-text-editor.editor)

Config

{
"core": {
"projectHome": "/Users/andrew/Development",
"themes": [
"one-dark-ui",
"solarized-dark-syntax"
]
},
"atom-easy-jsdoc": {
"beta": true,
"useReturns": true
}
}

Installed Packages

User

atom-beautify, v0.29.7
atom-easy-jsdoc, v4.5.0
atom-sync, v0.7.3
file-icons, v1.7.8
fonts, v1.2.0
highlight-line, v0.11.1
highlight-selected, v0.11.2
imdone-atom, v1.3.29
imdone-atom-github, v0.1.11
jsdoc-generator, v0.2.3
linter, v1.11.4
linter-eslint, v7.2.1
minimap, v4.23.2
mocha-test-runner, v0.4.7
node_modules, vundefined
open-in-browser, v0.4.7
remote-edit, v1.8.24
sync-settings, v0.7.2
terminal-plus, v0.14.5

DevNo dev packages


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#24

from atom-easy-jsdoc.

skarfacegc avatar skarfacegc commented on July 30, 2024

it's the main script that starts my project. I think I narrowed the issue down to the #! at the start.

from atom-easy-jsdoc.

tgandrews avatar tgandrews commented on July 30, 2024

Is it valid JS to have that at the beginning of a script? I don't like so.

from atom-easy-jsdoc.

skarfacegc avatar skarfacegc commented on July 30, 2024

If you want to have a script that can self execute from the command line it's nessecary.

#!/bin/env node

That said, I do understand why the AST parser chokes on it.

from atom-easy-jsdoc.

tgandrews avatar tgandrews commented on July 30, 2024

I'll add an exception and strip it before it runs. Thanks for the info.
On Fri, 29 Apr 2016 at 15:50, Andrew Williams [email protected]
wrote:

If you want to have a script that can self execute from the command line
it's nessecary.

#!/bin/env node

That said, I do understand why the AST parser chokes on it.


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#24 (comment)

from atom-easy-jsdoc.

jbree avatar jbree commented on July 30, 2024

I know this is a package intended for javascript, but I also use it for when I'm working in C/C++ as well. Just ran into this issue when I enabled the beta, I'm guessing it's being triggered by my #ifndef, #define, and #includes.

from atom-easy-jsdoc.

tgandrews avatar tgandrews commented on July 30, 2024

The beta version uses a JS parser - it won't work with C. Not sure what to
do about this...

Is anyone else using this for non-JS docs?
On Wed, 18 May 2016 at 14:37, Joshua [email protected] wrote:

I know this is a package intended for javascript, but I also use it for
when I'm working in C/C++. Just ran into this issue when I enabled the
beta, I'm guessing it's being triggered by my #ifndef, #define, and
#includes.


You are receiving this because you modified the open/close state.

Reply to this email directly or view it on GitHub
#24 (comment)

from atom-easy-jsdoc.

jbree avatar jbree commented on July 30, 2024

Maybe if the parser takes a dump, you can just print the /**\n*\n */ ? just a thought.

from atom-easy-jsdoc.

tgandrews avatar tgandrews commented on July 30, 2024

I appreciate your use case and maybe the best solution would be for you to create a C Doc tool. It was accidental that it worked.

from atom-easy-jsdoc.

jbree avatar jbree commented on July 30, 2024

Thanks for the response, no worries!

from atom-easy-jsdoc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.