Coder Social home page Coder Social logo

atom-go-imports's People

Contributors

abiosoft avatar iu0v1 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

iu0v1

atom-go-imports's Issues

Uncaught TypeError: Cannot read property 'isModified' of undefined

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.2.3
System: Microsoft Windows 10 Pro
Thrown From: go-imports package, v0.1.1

Stack Trace

Uncaught TypeError: Cannot read property 'isModified' of undefined

At /C:/Users/Ameen/.atom/packages/go-imports/lib/go-imports.coffee:31

TypeError: Cannot read property 'isModified' of undefined
    at Object.module.exports.process (file:///C:/Users/Ameen/.atom/packages/go-imports/lib/go-imports.coffee:20:30)
    at atom-text-editor.subscriptions.add.atom.commands.add.go-imports:process (file:///C:/Users/Ameen/.atom/packages/go-imports/lib/go-imports.coffee:13:88)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\Ameen\AppData\Local\atom\app-1.2.3\resources\app.asar\src\command-registry.js:260:29)
    at CommandRegistry.handleCommandEvent (C:\Users\Ameen\AppData\Local\atom\app-1.2.3\resources\app.asar\src\command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\Ameen\AppData\Local\atom\app-1.2.3\resources\app.asar\src\command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (C:\Users\Ameen\AppData\Local\atom\app-1.2.3\resources\app.asar\src\atom-environment.js:987:28)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)

Commands

     -0:03.4.0 go-imports:process (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {},
  "go-imports": {}
}

Installed Packages

# User
go-imports, v0.1.1
go-plus, v3.5.2

# Dev
No dev packages

Changes required due to TextBuffer.save becoming async in Atom 1.19

Hi! Thanks for maintaining the go-imports package!

In Atom v1.19, we will release a major change to Atom's core text buffer data structure. As part of this change, we have made TextBuffer.save asynchronous; rather than blocking until the save is complete, it now immediately returns a Promise that resolves when the save is complete. Because of this, a few other Atom APIs that use save have similarly become async:

  • Pane.close
  • TextBuffer.save
  • TextEditor.save
  • Pane.saveItem
  • Pane.saveItemAs
  • Pane.saveActiveItem
  • Pane.saveActiveItemAs
  • Pane.saveItems
  • Workspace.saveActivePaneItem
  • Workspace.saveActivePaneItemAs

Effects on this package

We think this package could be impacted by this upgrade because it calls the changed methods in the following places:

We found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.

What to do about the change

It should be pretty easy to adjust your package code and/or tests to work with the new async behavior, and to simultaneously keep it working with older versions of Atom. Here are some examples of pull requests we opened on our bundled packages to cope with the change:

Deletes most of file

When running the command on a file, it seems to be deleting the majority of the content leaving 8 lines of code instead of adding the missing imports.

Uncaught Error: spawn EACCES

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.0
System: Mac OS X 10.10.3
Thrown From: go-imports package, v0.1.1

Stack Trace

Uncaught Error: spawn EACCES

At /Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:260

Error: spawn EACCES
    at exports._errnoException (util.js:734:11)
    at ChildProcess.spawn (child_process.js:1145:11)
    at Object.exports.spawn (child_process.js:977:9)
    at BufferedProcess.module.exports.BufferedProcess.spawn (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:188:44)
    at new BufferedProcess (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:52:14)
    at Object.module.exports.process (/Users/ZQ/.atom/packages/go-imports/lib/go-imports.coffee:55:24)
    at atom-text-editor.subscriptions.add.atom.commands.add.go-imports:process (/Users/ZQ/.atom/packages/go-imports/lib/go-imports.coffee:20:26)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:241:29)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:156:19)

Commands

     -0:13.3.0 application:add-project-folder (atom-text-editor.editor.is-focused)
     -0:03.7.0 core:save (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "solarized-dark-syntax"
    ]
  },
  "go-imports": {
    "path": "/Users/ZQ/developtools/go"
  }
}

Installed Packages

# User
atom-runner, v2.4.1
go-imports, v0.1.1
go-plus, v3.3.12
project-manager, v1.15.10

# Dev
No dev packages

Uncaught TypeError: Cannot read property 'lastIndexOf' of undefined

[Enter steps to reproduce below:]

  1. elected Atom Menu item Packages and go imports
  2. error message pops up

Atom Version: 0.210.0
System: Mac OS X 10.11
Thrown From: go-imports package, v0.1.1

Stack Trace

Uncaught TypeError: Cannot read property 'lastIndexOf' of undefined

At /Users/neallepage/.atom/packages/go-imports/lib/go-imports.coffee:23

TypeError: Cannot read property 'lastIndexOf' of undefined
  at Object.module.exports.process (/Users/neallepage/.atom/packages/go-imports/lib/go-imports.coffee:23:20)
  at atom-text-editor.subscriptions.add.atom.commands.add.go-imports:process (/Users/neallepage/.atom/packages/go-imports/lib/go-imports.coffee:13:88)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:238:29)
  at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:153:19)
  at EventEmitter.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:70:30)
  at emitOne (events.js:77:13)
  at EventEmitter.emit (events.js:166:7)

Commands

     -2:03.6.0 golang:getmissingtools (atom-text-editor.editor.is-focused)
     -1:32.9.0 golang:goinfo (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-monokai.theme-atom-dark-ui)
     -1:09.3.0 golang:golint (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-monokai.theme-atom-dark-ui)
     -0:00.9.0 go-imports:process (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "monokai"
    ]
  }
}

Installed Packages

# User
foundation5-snippets, v0.2.1
go-imports, v0.1.1
go-plus, v3.3.12
go-runtime, v0.2.0
language-r, v0.2.0
linter-lintr, v0.0.1
monokai, v0.14.0

# Dev
No dev packages

Uncaught Error: write EPIPE

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.57.0 x64
Electron: 9.4.4
OS: "Fedora release
Thrown From: go-imports package 0.2.0

Stack Trace

Uncaught Error: write EPIPE

At events.js:200

Error: write EPIPE
    at afterWriteDispatched (internal/stream_base_commons.js:149:25)
    at writeGeneric (internal/stream_base_commons.js:140:3)
    at Socket._writeGeneric (net.js:776:11)
    at Socket._write (net.js:788:8)
    at doWrite (_stream_writable.js:435:12)
    at writeOrBuffer (_stream_writable.js:419:5)
    at Socket.Writable.write (_stream_writable.js:309:11)
    at Object.process (/packages/go-imports/lib/go-imports.coffee:35:29)
    at /packages/go-imports/lib/go-imports.coffee:13:88)
    at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/static/<embedded>:11:352215)
    at Object.didConfirmSelection (/usr/share/atom/resources/app/static/<embedded>:11:686807)
    at SelectListView.confirmSelection (/usr/share/atom/resources/app/static/<embedded>:14:555627)
    at SelectListView.didClickItem (/usr/share/atom/resources/app/static/<embedded>:14:553569)
    at ListItemView.onclick (/usr/share/atom/resources/app/static/<embedded>:14:552559)
    at ListItemView.didClick (/usr/share/atom/resources/app/static/<embedded>:14:556647)

Commands

     -1:01.5.0 typescript:activate (atom-workspace.workspace.scrollbars-visible-always)
     -0:38.2.0 golang:update-tools (atom-workspace.workspace.scrollbars-visible-always.theme-base16-tomorrow-dark-theme.theme-atom-material-ui)
     -0:29 intentions:highlight (input.hidden-input)
     -0:28 command-palette:toggle (input.hidden-input)
     -0:20.1.0 core:backspace (input.hidden-input)
     -0:12.3.0 go-imports:process (input.hidden-input)

Non-Core Packages

atom-ide-base 3.4.0 
atom-ide-code-format 1.0.2 
atom-ide-datatip 0.25.0 
atom-ide-definitions 0.4.2 
atom-ide-hyperclick 1.0.11 
atom-ide-javascript 1.5.0 
atom-ide-markdown-service 2.1.0 
atom-ide-outline 3.1.0 
atom-ide-signature-help 0.16.0 
atom-ide-ui 0.13.0 
atom-material-syntax 1.0.8 
atom-material-ui 2.1.3 
atom-pug 0.2.0 
atom-typescript 14.3.2 
autocomplete-paths 2.15.2 
best-js-snippets 4.1.0 
busy-signal 2.0.1 
cobalt2-syntax 0.5.3 
es6-javascript 1.0.0 
express-snippets 0.2.0 
expressjs 2.2.0 
go-debug 1.7.0 
go-imports 0.2.0 
go-plus 6.1.0 
go-signature-statusbar 1.2.3 
ide-golang 0.0.5 
intentions 2.1.1 
javascript-drag-import 0.1.13 
linter 3.4.0 
linter-eslint 8.6.6 
linter-ui-default 3.4.1 
my-express-nodejs 0.0.10 
platformio-ide-terminal 2.10.1 

Doesn't seem to do anything at all for me

  1. Open a go file in atom
  2. Remove an import line
  3. "Go Imports: Process" from the command palette -- nothing changes.
  4. From the command line: goimports -w $the_file -- the import is added back.

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.