Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught SyntaxError: Unexpected token ] #17

Closed
pmachart opened this issue May 30, 2016 · 7 comments
Closed

Uncaught SyntaxError: Unexpected token ] #17

pmachart opened this issue May 30, 2016 · 7 comments

Comments

@pmachart
Copy link

[Enter steps to reproduce below:]

  1. i just click on the big red flashing button

Atom Version: 1.7.4 & 1.7.2 & 1.8.0 beta 4
System: Debian GNU/Linux
Thrown From: atom-lupa package, v0.5.46

Stack Trace

Uncaught SyntaxError: Unexpected token ]

At /home/pma/.atom/packages/atom-lupa/node_modules/react/lib/ReactErrorUtils.js:52

SyntaxError: Unexpected token ]
    at Object.parse (native)
    at Object.analysis.indexProject (/home/pma/.atom/packages/atom-lupa/node_modules/lupa/src/analysis.js:93:27)
    at /home/pma/.atom/packages/atom-lupa/lib/lupaMiddleware.js:54:30
    at /home/pma/.atom/packages/atom-lupa/lib/middleware/domMiddleware.js:22:9
    at Object.dispatch (/home/pma/.atom/packages/atom-lupa/node_modules/redux-thunk/lib/index.js:14:16)
    at _react2.default.createElement._react2.default.createElement.onClick (/home/pma/.atom/packages/atom-lupa/lib/components/Lupa.js:253:34)
    at Object.invokeGuardedCallback (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/ReactErrorUtils.js:26:12)
    at executeDispatch (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/EventPluginUtils.js:87:21)
    at Object.executeDispatchesInOrder (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/EventPluginUtils.js:110:5)
    at executeDispatchesAndRelease (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/EventPluginHub.js:42:22)
    at executeDispatchesAndReleaseTopLevel (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/EventPluginHub.js:53:10)
    at Array.forEach (native)
    at forEachAccumulated (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/forEachAccumulated.js:24:9)
    at Object.EventPluginHub.processEventQueue (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/EventPluginHub.js:215:7)
    at runEventQueueInBatch (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/ReactEventEmitterMixin.js:18:18)
    at Object.ReactEventEmitterMixin.handleTopLevel [as _handleTopLevel] (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/ReactEventEmitterMixin.js:29:5)
    at handleTopLevelImpl (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/ReactEventListener.js:73:24)
    at ReactDefaultBatchingStrategyTransaction.Mixin.perform (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/Transaction.js:136:20)
    at Object.ReactDefaultBatchingStrategy.batchedUpdates (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/ReactDefaultBatchingStrategy.js:63:19)
    at Object.batchedUpdates (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/ReactUpdates.js:98:20)
    at ReactEventListener.dispatchEvent (/home/pma/.atom/packages/atom-lupa/node_modules/react/lib/ReactEventListener.js:150:20)

Commands

     -0:16.3.0 pane:show-next-item (atom-text-editor.editor.is-focused)
     -0:13.6.0 pane:show-previous-item (div.panels-item)
  2x -0:11.3.0 pane:show-next-item (atom-text-editor.editor.is-focused)
 13x -0:09.3.0 atom-lupa:toggle (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "allowPendingPaneItems": false,
    "autoHideMenuBar": true,
    "disabledPackages": [
      "wrap-guide",
      "welcome",
      "language-c",
      "language-clojure",
      "language-coffee-script",
      "language-csharp",
      "language-gfm",
      "language-git",
      "language-go",
      "language-make",
      "language-objective-c",
      "language-perl",
      "language-python",
      "language-ruby",
      "language-ruby-on-rails",
      "language-todo",
      "language-toml",
      "language-yaml",
      "open-on-github",
      "metrics",
      "package-generator",
      "animated-cursor",
      "seti-icons",
      "quick-highlight",
      "live-archive",
      "fortune-background-tips",
      "background-tips",
      "activate-power-mode",
      "atom-beautify",
      "autocomplete-paths",
      "composer",
      "atom-ctags",
      "symbols-tree-view",
      "hyperclick-php"
    ],
    "ignoredNames": [
      ".git",
      ".hg",
      ".svn",
      ".DS_Store",
      "._*",
      "Thumbs.db",
      ".live-archive"
    ],
    "openEmptyEditorOnStart": false,
    "packagesWithKeymapsDisabled": [
      "multirow-tabs",
      "php-integrator-symbol-viewer",
      "atom-lupa"
    ],
    "projectHome": "/mnt"
  },
  "atom-lupa": {
    "styleguide": true
  }
}

Installed Packages

# User
atom-lupa, v0.5.46
autoclose-html, v0.23.0
autocomplete-html-entities, v0.1.0
caniuse, v0.9.0
custom-title, v1.0.1
disable-keybindings, v0.6.0
fast-eslint, v2.11.0
file-icons, v1.7.13
file-watcher, v0.4.0
foldername-tabs, v0.1.11
highlight-selected, v0.11.2
hyperclick, v0.0.36
indent-guide-improved, v1.4.8
javascript-snippets, v1.2.1
jquery-snippets, v11.0.0
js-hyperclick, v1.4.2
language-diff, v0.4.0
last-cursor-position, v0.9.0
line-diff-details, v1.3.5
linter, v1.11.4
linter-php, v1.2.0
minimap, v4.24.3
minimap-codeglance, v0.4.5
minimap-find-and-replace, v4.5.1
minimap-git-diff, v4.3.1
minimap-highlight-selected, v4.4.0
minimap-selection, v4.4.0
mixed-indent-warning, v0.3.0
open-recent, v5.0.0
php-integrator-annotations, v0.4.1
php-integrator-autocomplete-plus, v0.8.1
php-integrator-base, v0.9.3
php-integrator-navigation, v0.7.1
php-integrator-symbol-viewer, v0.6.1
pigments, v0.28.4
project-view, v0.5.0
svn, v0.0.11

# Dev
No dev packages
@hex13
Copy link
Owner

hex13 commented May 30, 2016

  1. Do you have lupaProject.json file?
  2. how does it look? is it correct JSON?

@pmachart
Copy link
Author

pmachart commented May 31, 2016

yep it's there.
i just copied your json.
when remove the trailing comma, the error doesn't show anymore. looks like that was the issue indeed.

can you please provide a few details on how to use that json config file ? can i configure multiple file patterns ? what are autolabels for ?

a few more things :

  • so, what does the big red button really do ? (suggestion: a tooltip might help)
  • please provide a keybind to toggle the side panel. i tend to open a lot of things simultaneously, and i toggle things a lot (treeview,minimap,symbols)

(the 'atom-lupa:toggle' only activates it)
(oh and by the way, the default ctrl-. doesn't work, i had to rebind it)

thanks for the quick answer and for an otherwise very useful and very promising package :)

@hex13
Copy link
Owner

hex13 commented May 31, 2016

Thanks! It means that there is error in my docs (trailing coma is okay in JavaScript but not in JSON).

hex13 pushed a commit that referenced this issue May 31, 2016
hex13 pushed a commit that referenced this issue May 31, 2016
@hex13
Copy link
Owner

hex13 commented May 31, 2016

autolabels was feature which I temporarily removed. I'll restore it later when I'll improve it.
This worked this way that you could set some "regexp detectors" in your files. And if it detected some regexps it showed in form of labels: angular, numbers.

can i configure multiple file
Try this:
"filePattern": "{spec/*,lib/**/*}"
it catches spec/* and lib/*/
syntax is from glob:
https://github.com/isaacs/node-glob

But I will probably change it to make it more intuitive.
Maybe in future there will be something like that:

{  
    "patterns": {
       "ignored": ["node_modules"],
       "project": ["src/**/*"],
       "tests": ["spec"]
    }
}

What do you think about proposition above? Is is more clear than one file pattern like now?

so, what does the big red button really do ? (suggestion: a tooltip might help)
It's easter egg and cultural reference to the book The Hitchhiker's Guide to the Galaxy which I was reading when I changed it to this form :) But now I restored Index project text.

please provide a keybind to toggle the side panel. i tend to open a lot of things simultaneously, and i toggle things a lot (treeview,minimap,symbols)
But you mean show/hide? Okay. I'll add some shortcut for showing/hiding. And I 'll fix activate button (now it's bound to cmd+., but this is mac keyboard only)

@hex13
Copy link
Owner

hex13 commented Jun 2, 2016

I've added real toggle command (which shows and hides sidepanel). I've renamed previous toggle command as more appropriate focus. (If you want to discuss it, discuss it here: #20 )

I have to work on keybindings, though.

hex13 pushed a commit that referenced this issue Jun 2, 2016
@hex13
Copy link
Owner

hex13 commented Jun 2, 2016

Okay. Check this now. Default keybindings should work (now Linux and Windows have Ctrl+. and Ctrl+Alt+L, and OSX has Cmd+. and Cmd+Alt+L

@pmachart
Copy link
Author

pmachart commented Jun 3, 2016

looking good so far (but i'm currently mostly doing php related stuff, so i'll get into it more thoroughly later)
you might want to rething the ctrl+. keybind, since it's atom's default shortcut for the key binding resolver tool

edit: can't see the :focus binding :/
edit2: can't get it working even if i set it manually in the keymap file :(
edit3: maybe add an option to auto focus the filter input when toggling the sidebar if desired ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants