extrabacon / atom-turbo-javascript Goto Github PK
View Code? Open in Web Editor NEWCommands and snippets for faster Javascript and Typescript with the Atom Editor
License: MIT License
Commands and snippets for faster Javascript and Typescript with the Atom Editor
License: MIT License
[Enter steps to reproduce below:]
Atom Version: 0.175.0
System: linux 3.13.0-48-generic
Thrown From: turbo-javascript package, v0.0.7
Uncaught TypeError: Cannot read property 'getCursors' of undefined
At /home/teodor/.atom/packages/turbo-javascript/lib/turbo-javascript.coffee:8
TypeError: Cannot read property 'getCursors' of undefined
at Object.module.exports.endLine (/home/teodor/.atom/packages/turbo-javascript/lib/turbo-javascript.coffee:8:11)
at atom-workspace.<anonymous> (/home/teodor/.atom/packages/turbo-javascript/lib/turbo-javascript.coffee:3:65)
at atom-workspace.handler (/usr/share/atom/resources/app/src/space-pen-extensions.js:115:32)
at atom-workspace.jQuery.event.dispatch (/usr/share/atom/resources/app/node_modules/space-pen/vendor/jquery.js:4681:9)
at atom-workspace.elemData.handle (/usr/share/atom/resources/app/node_modules/space-pen/vendor/jquery.js:4359:46)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:243:29)
at /usr/share/atom/resources/app/src/command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:558:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:396:22)
at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/usr/share/atom/resources/app/src/window-event-handler.js:170:20)
-0:00.0 turbo-javascript:end-line (atom-pane.pane.active)
{
"core": {
"themes": [
"atom-dark-ui",
"greti-syntax"
]
}
}
# User
atom-grails, v0.1.0
autocomplete-css, v0.4.0
autocomplete-glsl, v0.1.4
autocomplete-haskell, v0.2.1
autocomplete-html, v0.3.0
autocomplete-paths, v1.0.2
greti-syntax, v0.3.1
ide-haskell, v0.3.0
language-csharp, v0.5.0
language-groovy-cloned-from-java, v0.2.0
language-javascript-jsx, v0.3.1
language-js-specs, v0.1.0
language-swift, v0.3.0
linter, v0.12.0
project-manager, v1.15.5
react, v0.9.10
recent-files, v0.3.0
refactor, v0.4.1
# Dev
No dev packages
/cc @atom/core
Hi, I'm confused to why it is not working for my .ts
and .tsx
files.
Works for my .js
files.
Store package style sheets in the styles/
directory instead of stylesheets/
in the turbo-javascript
package
Package.getStylesheetsPath (/usr/share/atom/resources/app.asar/src/package.js:460:9)
Package.getStylesheetPaths (/usr/share/atom/resources/app.asar/src/package.js:471:32)
Package.loadStylesheets (/usr/share/atom/resources/app.asar/src/package.js:453:38)
<unknown> (/usr/share/atom/resources/app.asar/src/package.js:183:19)
Package.measure (/usr/share/atom/resources/app.asar/src/package.js:163:15)
Package.load (/usr/share/atom/resources/app.asar/src/package.js:177:12)
The ctrl-,
keybinding does not work in JSON files.
Apparently the plugin actually does wrap the selected code in braces but then does some stuff extra that unindents the code and removes the opening brace. Doing a couple of "undo" actions takes the code back to where it was properly wrapped in braces.
Hello,
I'm missing throw new snippets could you please add ones for following use cases:
Would you be open to the implementation some snippets for ES6 since the last RC is now TC39 accepted and it's used fully through traspilers such as Babel?
Lot's of new syntax so would be nice to have some qucik snippets!
I would be more than happy to work on a PR for this. :)
Not sure how to activate these...
For console log I assume I type
cl:
and then tab?
That isn't working. Sorry, maybe it's obvious. Just isn't working for me.
[Enter steps to reproduce below:]
Atom Version: 0.194.0
System: Mac OS X 10.10.2
Thrown From: turbo-javascript package, v0.0.8
Failed to activate the turbo-javascript package
At Cannot read property 'command' of undefined
TypeError: Cannot read property 'command' of undefined
at Object.module.exports.activate (/Users/mohitnarang/.atom/packages/turbo-javascript/lib/turbo-javascript.coffee:3:24)
at Package.module.exports.Package.activateNow (/Users/mohitnarang/Downloads/Atom.app/Contents/Resources/app.asar/src/package.js:222:19)
at /Users/mohitnarang/Downloads/Atom.app/Contents/Resources/app.asar/src/package.js:203:30
at Package.module.exports.Package.measure (/Users/mohitnarang/Downloads/Atom.app/Contents/Resources/app.asar/src/package.js:147:15)
at Package.module.exports.Package.activate (/Users/mohitnarang/Downloads/Atom.app/Contents/Resources/app.asar/src/package.js:195:14)
at PackageManager.module.exports.PackageManager.activatePackage (/Users/mohitnarang/Downloads/Atom.app/Contents/Resources/app.asar/src/package-manager.js:434:21)
at /Users/mohitnarang/Downloads/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-manager.js:234:29
at exit (/Users/mohitnarang/Downloads/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-manager.js:43:16)
at BufferedProcess.triggerExitCallback (/Users/mohitnarang/Downloads/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:63:47)
at /Users/mohitnarang/Downloads/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:70:18
at Socket.<anonymous> (/Users/mohitnarang/Downloads/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:150:18)
at emitOne (events.js:82:20)
at Socket.emit (events.js:166:7)
at Pipe.close (net.js:464:12)
-0:18.3.0 settings-view:check-for-package-updates (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-atom-dark-syntax.theme-atom-light-ui)
{
"core": {
"themes": [
"atom-light-ui",
"atom-dark-syntax"
]
}
}
# User
javascript-snippets, v1.0.0
language-javascript-better, v1.4.0
turbo-javascript, v0.0.8
# Dev
No dev packages
On June 1st all deprecated APIs in Atom will be removed in preparation for the 1.0 Atom release
currently i use atom 0.200.0, I obtained this 2 warnings from deprecation cop:
Store package style sheets in the styles/
directory instead of stylesheets/
in the turbo-javascript
package
Package.getStylesheetsPath (C:\Users\ascherer\AppData\Local\atom\app-0.200.0\resources\app.asar\src\package.js:460:9)
Package.getStylesheetPaths (C:\Users\ascherer\AppData\Local\atom\app-0.200.0\resources\app.asar\src\package.js:471:32)
Package.loadStylesheets (C:\Users\ascherer\AppData\Local\atom\app-0.200.0\resources\app.asar\src\package.js:453:38)
<unknown> (C:\Users\ascherer\AppData\Local\atom\app-0.200.0\resources\app.asar\src\package.js:183:19)
Package.measure (C:\Users\ascherer\AppData\Local\atom\app-0.200.0\resources\app.asar\src\package.js:163:15)
Package.load (C:\Users\ascherer\AppData\Local\atom\app-0.200.0\resources\app.asar\src\package.js:177:12)
Use activationCommands
instead of activationEvents
in your package.json
Commands should be grouped by selector as follows:
"activationCommands": {
"atom-workspace": ["foo:bar", "foo:baz"],
"atom-text-editor": ["foo:quux"]
}
Package.getActivationCommands (C:\Users\ascherer\AppData\Local\atom\app-0.200.0\resources\app.asar\src\package.js:808:9)
Package.hasActivationCommands (C:\Users\ascherer\AppData\Local\atom\app-0.200.0\resources\app.asar\src\package.js:733:20)
<unknown> (C:\Users\ascherer\AppData\Local\atom\app-0.200.0\resources\app.asar\src\package.js:185:24)
Package.measure (C:\Users\ascherer\AppData\Local\atom\app-0.200.0\resources\app.asar\src\package.js:163:15)
Package.load (C:\Users\ascherer\AppData\Local\atom\app-0.200.0\resources\app.asar\src\package.js:177:12)
PackageManager.loadPackage (C:\Users\ascherer\AppData\Local\atom\app-0.200.0\resources\app.asar\src\package-manager.js:355:14)
Would it be possible to add this support?
Just installed Atom @ Version 0.187.0 (0.187.0) and installed this project. Attempted a CTRL+;
& got:
atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please useatom.views.getView(atom.workspace)
,
which returns an HTMLElement.Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:54:11) Object.activate (/Users/Eric/.atom/packages/turbo-javascript/lib/turbo-javascript.coffee:3:9)
Use activationCommands
instead of activationEvents
in your package.json
Commands should be grouped by selector as follows:
"activationCommands": {
"atom-workspace": ["foo:bar", "foo:baz"],
"atom-text-editor": ["foo:quux"]
}
Package.getActivationCommands (/usr/share/atom/resources/app.asar/src/package.js:808:9)
Package.hasActivationCommands (/usr/share/atom/resources/app.asar/src/package.js:733:20)
<unknown> (/usr/share/atom/resources/app.asar/src/package.js:185:24)
Package.measure (/usr/share/atom/resources/app.asar/src/package.js:163:15)
Package.load (/usr/share/atom/resources/app.asar/src/package.js:177:12)
PackageManager.loadPackage (/usr/share/atom/resources/app.asar/src/package-manager.js:355:14)
Hey extrabacon,
Thanks for the great package! It looks like "st" is overloaded for String and setTimeout (I'm getting "String" in Atom). Is there a way to trigger different behavior, or should there be a separate snippet for each one? (Tip: search for "st:" in README.md).
Thanks,
Greg
Normally when I press CTRL+; it will find the end of the line and insert a semicolon, but this functionality has broken in recent days, and will insert the comma inside of a closing paran like so:
Not sure if it matters, but i'm using the language syntax Javascript + JSX
.
Let me know if there is anything else I can add to help you debug.
Failed to load package named 'turbo-javascript' [stdin]:2:16: error: unexpected newline
'context-menu':
^
Package looks very useful, thanks for this.
hey if u there, will u please add the snippets for maths,number object
Or at least would you accept a PR adding these changes? I would gladly do the work.
Hi,
It seems to be single quotes for all snippets except for the bdd
-snippets (https://github.com/extrabacon/atom-turbo-javascript/blob/master/snippets/bdd.cson#L5). I believe that the snippets for bdd
should be updated to use single quotes.
This will affect #26.
[Enter steps to reproduce below:]
Atom Version: 1.0.7
System: Microsoft Windows 8.1 Pro
Thrown From: turbo-javascript package, v1.1.3
Uncaught TypeError: Cannot read property 'getSelectedBufferRanges' of undefined
At C:\Users\UnderNotic\.atom\packages\turbo-javascript\lib\turbo-javascript.coffee:33
TypeError: Cannot read property 'getSelectedBufferRanges' of undefined
at Object.module.exports.wrapBlock (C:\Users\UnderNotic\.atom\packages\turbo-javascript\lib\turbo-javascript.coffee:33:26)
at atom-text-editor.atom.commands.add.turbo-javascript:wrap-block (C:\Users\UnderNotic\.atom\packages\turbo-javascript\lib\turbo-javascript.coffee:15:42)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\UnderNotic\AppData\Local\atom\app-1.0.7\resources\app.asar\src\command-registry.js:241:29)
at C:\Users\UnderNotic\AppData\Local\atom\app-1.0.7\resources\app.asar\src\command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\UnderNotic\AppData\Local\atom\app-1.0.7\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:524:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\UnderNotic\AppData\Local\atom\app-1.0.7\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:347:22)
at HTMLDocument.module.exports.WindowEventHandler.onKeydown (C:\Users\UnderNotic\AppData\Local\atom\app-1.0.7\resources\app.asar\src\window-event-handler.js:177:20)
-0:12.6.0 command-palette:toggle (summary.welcome-summary.icon.icon-keyboard)
-0:10.6.0 core:backspace (atom-text-editor.editor.mini.is-focused)
-0:09.5.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
-0:09.5.0 core:cancel (atom-text-editor.editor.mini.is-focused)
-0:08.9.0 command-palette:toggle (summary.welcome-summary.icon.icon-keyboard)
12x -0:08.2.0 core:move-down (atom-text-editor.editor.mini.is-focused)
-0:06.8.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
-0:06.8.0 core:cancel (atom-text-editor.editor.mini.is-focused)
-0:06.2.0 fuzzy-finder:toggle-buffer-finder (summary.welcome-summary.icon.icon-keyboard)
-0:05.7.0 turbo-javascript:wrap-block (atom-text-editor.editor.mini.is-focused)
-0:04.5.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
-0:04.5.0 core:cancel (atom-text-editor.editor.mini.is-focused)
-0:03.1.0 fuzzy-finder:toggle-buffer-finder (summary.welcome-summary.icon.icon-keyboard)
2x -0:02.6.0 turbo-javascript:wrap-block (atom-text-editor.editor.mini.is-focused)
-0:00.4.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
-0:00.4.0 core:cancel (atom-text-editor.editor.mini.is-focused)
{}
# User
turbo-javascript, v1.1.3
# Dev
No dev packages
The snippets are now showing up in the autcomplete plus snippets or in the available snippets menu. The package is installed and working, other commands works. Any thoughts?
thanks
erik
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.