GithubHelp home page GithubHelp logo

atom-gpp's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

atom-gpp's Issues

Uncaught Callback must be a function

Hi
I have just installed this package and encountered this error when I pressed F9 to compile and run a file:
Screen Shot 1398-10-05 at 23 38 33
I'm using atom in macOS 10.15 and I have installed Xcode and its stuff.
I also tried disabling other non-core packages and restarting the atom, which didn't solve the problem.
this issue has already been reported: #9
but the user who opened the issue, closed it himself without providing any reason.

by the way, this is the full error report:
steps to reproduce:

  1. install this package
  2. press fn + F9

Atom: 1.42.0 x64
Electron: 4.2.7
OS: Mac OS X 10.15.2
Thrown From: gpp package 0.4.3

Stack Trace

Uncaught Callback must be a function

At fs.js:129

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:129:9)
    at Object.writeFile (fs.js:1137:14)
    at ChildProcess.child.on (/packages/gpp/index.js:57:12)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Socket.stream.socket.on (internal/child_process.js:381:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close (net.js:606:12)

Commands

     -6:48.6.0 core:backspace (input.hidden-input)
  2x -6:43.4.0 editor:newline (input.hidden-input)
     -6:38.7.0 core:backspace (input.hidden-input)
     -6:36.5.0 editor:newline (input.hidden-input)
     -6:34.1.0 core:backspace (input.hidden-input)
     -6:31.7.0 editor:newline (input.hidden-input)
     -6:30.7.0 core:backspace (input.hidden-input)
  2x -6:28.6.0 editor:newline (input.hidden-input)
     -6:26.8.0 core:backspace (input.hidden-input)
     -6:23.9.0 gcc-make-run:compile-run (input.hidden-input)
     -3:02.6.0 tree-view:remove (span.name.icon.icon-file-text)
  3x -2:55.5.0 editor:newline (input.hidden-input)
     -2:47.4.0 gpp-compiler:compile (input.hidden-input)
     -1:54.1.0 gpp:compile-run (input.hidden-input)

Non-Core Packages

atom-smart-template 0.3.2 
autosave-onchange 1.5.1 
gcc-make-run 0.2.12 
gpp 0.4.3 
gpp-compiler 3.0.7 
linter-gcc 0.7.1 

Uncaught Callback must be a function

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.34.0 x64
Electron: 3.1.1
OS: "Manjaro Linux"
Thrown From: gpp package 0.4.3

Stack Trace

Uncaught Callback must be a function

At fs.js:157

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:157:9)
    at Object.fs.writeFile (fs.js:1290:14)
    at ChildProcess.child.on (/packages/gpp/index.js:57:12)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:961:16)
    at Socket.stream.socket.on (internal/child_process.js:380:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close [as _onclose] (net.js:596:12)

Commands

  3x -1:58 core:backspace (input.hidden-input)
     -1:55.8.0 core:move-right (input.hidden-input)
     -1:55.7.0 core:move-down (input.hidden-input)
  2x -1:55.2.0 core:backspace (input.hidden-input)
  2x -1:53.1.0 editor:newline (input.hidden-input)
  6x -1:48.8.0 core:backspace (input.hidden-input)
     -1:43.6.0 core:move-right (input.hidden-input)
  3x -1:42.6.0 core:backspace (input.hidden-input)
 11x -1:37.1.0 core:move-left (input.hidden-input)
     -1:34.1.0 editor:consolidate-selections (input.hidden-input)
     -1:34.1.0 core:cancel (input.hidden-input)
     -1:33.3.0 core:save (input.hidden-input)
     -1:31.5.0 gpp-compiler:compile (input.hidden-input)
     -0:39.6.0 core:confirm (input.hidden-input)
     -0:16.7.0 core:save (div.tool-panel.tree-view)
     -0:05.4.0 gpp:compile-run (input.hidden-input)

Non-Core Packages

atom-ide-ui 0.13.0 
gpp 0.4.3 
ide-python 1.2.0 
python-debugger 0.2.0 

MinGW added to path but won't spawn (Windows)

I've added MinGW to the path in Windows 10 as C:\MinGW\bin
To check the install, I used the terminal:
C:\Users\mike>g++ --version
g++ (MinGW.org GCC-8.2.0-5) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

C:\Users\mike>

In Atom, after adding the gpp-compiler package and trying to 'compile and run', I get the error:
'g++' could not be spawned. Is it installed and on your path? If so please open an issue on the package spawning the process.

Weird thing is, if I go to the project folder and enter the following, the file compiles properly and produces an executable.
**C:\Users\mike\Documents\atom\CPP>g++ main.cpp

C:\Users\mike\Documents\atom\CPP>a.exe
Hello world

C:\Users\mike\Documents\atom\CPP>**

Any fixes?
Thanks,
Mike

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

Hi! Thanks for maintaining the gpp 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:

  • TextEditor.save

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:

Please let me know if you have any questions. I would be happy to help!

Compiling doesn't work when there is a whitespace in the filepath

I got an error when i wanted to compile a file with a whitespace in it's path. This is the fix for index.js:

const options = (file.path + ' -o ' + compiledPath + ' ' + atom.config.get('gpp.compilerOptions')).replace(/[\s{2,}]+/g, ' ').trim();
path.join(filePath.dir, filePath.name);
console.log(options.split(' '));
const child = child_process.spawn('g++', options.split(' '), {
  cwd: filePath.dir
});

To

  const options = atom.config.get('gpp.compilerOptions').replace(/[\s{2,}]+/g, ' ').trim();
  path.join(filePath.dir, filePath.name);
  var new_options = [file.path,'-o',compiledPath]
  if (options != ""){
    new_options = new_options.concat(options.split(' '));
  }
  const child = child_process.spawn('g++', new_options, {
    cwd: filePath.dir
  });

The problem was that split(' ') would split on the whitespaces in the filename.

Personal improvement for macOS I'm sharing :)

index.js:148

let cmd = `osascript -e 'tell application "Terminal" to activate' -e 'tell application "Terminal" to do script "clear && cd ${filePath.dir} && time ./${filePath.name} && ${closeCmd} && while [ true ];do read -t 3 -n 1;if [ $? = 0 ];then exit;else continue;fi;done"'`
child_process.exec(cmd, options);

will produce a cleaner terminal and wait for enter at the end of the program to close the session and close the window instantly if you change this option in terminal preferences

Screenshot 2021-07-19 at 21 19 17

Preview

Screenshot 2021-07-19 at 21 18 26

Uncaught Error: Can't save a buffer with no file

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.29.0 x64
Electron: 2.0.5
OS: Microsoft Windows 10 Home
Thrown From: gpp package 0.4.3

Stack Trace

Uncaught Error: Can't save a buffer with no file

At C:\Users\Ridho\AppData\Local\atom\app-1.29.0\resources\app\node_modules\text-buffer\lib\text-buffer.js:1326

Error: Can't save a buffer with no file
    at TextBuffer.module.exports.TextBuffer.saveTo (~/AppData/Local/atom/app-1.29.0/resources/app/node_modules/text-buffer/lib/text-buffer.js:1326:21)
    at TextBuffer.module.exports.TextBuffer.save (~/AppData/Local/atom/app-1.29.0/resources/app/node_modules/text-buffer/lib/text-buffer.js:1310:25)
    at TextEditor.save (~/AppData/Local/atom/app-1.29.0/resources/app/src/text-editor.js:1173:38)
    at Object.compile (/packages/gpp/index.js:19:12)
    at /packages/gpp/index.js:429:18)
    at CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.29.0/resources/app/src/command-registry.js:384:49)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (~/AppData/Local/atom/app-1.29.0/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (~/AppData/Local/atom/app-1.29.0/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
    at WindowEventHandler.handleDocumentKeyEvent (~/AppData/Local/atom/app-1.29.0/resources/app/src/window-event-handler.js:110:40)

Commands

     -8:22.4.0 editor:newline (input.hidden-input)
     -8:19 core:move-right (input.hidden-input)
     -8:17.2.0 editor:newline (input.hidden-input)
     -8:15.8.0 snippets:next-tab-stop (input.hidden-input)
     -8:15.8.0 snippets:expand (input.hidden-input)
     -8:15.8.0 editor:indent (input.hidden-input)
  5x -8:11.7.0 core:backspace (input.hidden-input)
     -8:02.3.0 core:move-right (input.hidden-input)
     -8:01.0 editor:newline (input.hidden-input)
     -7:58.6.0 core:backspace (input.hidden-input)
  2x -7:55.2.0 editor:newline (input.hidden-input)
  5x -7:50.1.0 core:backspace (input.hidden-input)
  2x -7:44.3.0 editor:newline (input.hidden-input)
  3x -7:33.7.0 gpp:compile-run (input.hidden-input)

Non-Core Packages

gpp 0.4.3 

Uncaught TypeError: Path must be a string. Received undefined

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.31.2 x64
Electron: 2.0.7
OS: Microsoft Windows 10 Home
Thrown From: gpp package 0.4.3

Stack Trace

Uncaught TypeError: Path must be a string. Received undefined

At path.js:28

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.parse (path.js:999:5)
    at Object.compile (/packages/gpp/index.js:27:27)
    at /packages/gpp/index.js:429:18)
    at CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.31.2/resources/app/src/command-registry.js:384:49)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (~/AppData/Local/atom/app-1.31.2/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (~/AppData/Local/atom/app-1.31.2/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
    at WindowEventHandler.handleDocumentKeyEvent (~/AppData/Local/atom/app-1.31.2/resources/app/src/window-event-handler.js:110:40)

Commands

Non-Core Packages

gpp 0.4.3 
teletype 0.13.3 

compiler tools not found

atom wont install anything! it says compiler tools not found. I cant install anything on it please help mee. I dont know how to resolve this. btw my software of atom is at the latest version.

Unable to spawn the xfce4-terminal.

I am unable to spawn the xfce4-terminal. It perfectly compiles, then the terminal appears for a split second and then vanishes. The terminal just doesn't spawn properly.
Screenshot_2022-04-22_21-57-40

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.