-
Notifications
You must be signed in to change notification settings - Fork 453
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
Could not find 'uncrustify'. The program may not be installed. #598
Comments
I have the same problem. It was working before (when i used it a month ago). I don't know how i broke this (atom update maybe ?). Anyway i am using debian jessie with xfce and am using the official deb for atom. Uncrustify is in my local home directory. my path is ok in terminal and i can launch uncrustify from anywhere ("which uncrustify" shows the correct binary). I can't use Atom Beautify Debug (after i press "ok" nothing happens) and in my console i get the following error. Unhandled promise rejection Promise with error: TypeError: value.split is not a function
at Object.lineDiff.tokenize (/home/xxx/.atom/packages/atom-beautify/node_modules/diff/lib/diff/line.js:20:32)
at Object.diff (/home/xxx/.atom/packages/atom-beautify/node_modules/diff/lib/diff/base.js:37:39)
at Object.diffLines (/home/xxx/.atom/packages/atom-beautify/node_modules/diff/lib/diff/line.js:45:19)
at structuredPatch (/home/xxx/.atom/packages/atom-beautify/node_modules/diff/lib/patch/create.js:18:24)
at createTwoFilesPatch (/home/xxx/.atom/packages/atom-beautify/node_modules/diff/lib/patch/create.js:130:14)
at Object.createPatch (/home/xxx/.atom/packages/atom-beautify/node_modules/diff/lib/patch/create.js:150:10)
at Promise.all.then.cb (/home/xxx/.atom/packages/atom-beautify/src/beautify.coffee:399:21)
at tryCatcher (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/util.js:26:23)
at Promise._settlePromiseFromHandler (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/promise.js:507:31)
at Promise._settlePromiseAt (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/promise.js:581:18)
at Promise._settlePromises (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/promise.js:697:14)
at Async._drainQueue (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/async.js:123:16)
at Async._drainQueues (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/async.js:133:10)
at MutationObserver.Async.drainQueues (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/async.js:15:14)
at process._tickCallback (node.js:368:9) I can get Atom Beautify Debug to work by commenting out lines 398 to 401 in beautify.coffee but i think thats another story (beautify.coffee line 398 to 401) JsDiff = require('diff')
diff = JsDiff.createPatch(filePath, text, \
result, "original", "beautified")
addInfo('Original vs. Beautified Diff', "\n```#{codeBlockSyntax}\n#{diff}\n```") What i noticed is that the PATH variable in the log does not match my actual PATH variable. But when i type process.env['PATH'] in the atom console it shows the correct PATH variable contents. I think that gddabe in this thread #394 had the same problem. He or she managed to solve it by reinstalling everything. That did not help me. |
The problem is caused by non-existence of unscrustify.exe. The solution is to download uncrustify.exe from http://sourceforge.net/projects/uncrustify/, and then copy it to |
Why not embedding uncrustify inside the package itself? - some other packages out there download additional required dependencies on-demand |
@gjmveloso if you submit a Pull Request I'd be happy to review the code and the implications (change in file size, etc) of bundling the executables with Atom-Beautify. Note that we must support Mac, Linux, and Windows. |
just install the programm: linux: sudo apt-get install uncrustitfy |
A spell wrong. $sudo apt-get install uncrustify |
For macOS users to instal uncrustify using brew: if you want to change the tab width from 8(Unix default) to 4:
then change path of the C and C++ setting of atom-beautify: |
I really want to focus on improving the installation experience for users. I have created a new Issue, #1687, to target this problem. Please provide your feedback! Thanks in advance. |
download uncrustify copy to this path |
I have the same problem when I installed this plugin use command "apm install atom-beautify"。 Could not find 'uncrustify'. The program may not be installed.
|
You need 'uncrustify' to beautify code of c,c++ etc. in 'atom-beautify' since it is not given in the default package. Installing uncrustify from terminal using |
|
Hi. I found something that worked for me. In try
v = text.match(/uncrustify (\d+\.\d+)/)[1]
catch error
@error(error)
v = text.match(/Uncrustify-(\d+\.\d+)/)[1] if not v? it attempts to get the uncrustify version by parsing the output of try
v = text.match(/[Uu]ncrustify[^\d]*(\d+\.\d+)/)[1]
catch error
@error(error) Fixed the problem for me. |
|
Hey @emendir ! Sorry it took so long to get back to you. try
v = text.match(/[Uu]ncrustify[^0-9]*(\d+\.\d+)/)[1]
catch error
@error(error) -- which swaps out that first character group for only digits. (if I remember corrently, |
Atom Beautify - Debugging information
The following debugging information was generated by
Atom Beautify
onFri Oct 09 2015 09:37:07 GMT+0200 (CEST)
.Platform: linux
Versions
Atom Version: 1.0.11
Atom Beautify Version: 0.28.14
Original file to be beautified
Original File Path:
/home/byjokese/MEGAsync/Codigos/C++/SAR/echo_ser_udp_conc.c
Original File Grammar: C
Original File Language: C
Original File Contents:
Beautification options
Editor Options:
Options from Atom Editor settings
Config Options:
Options from Atom Beautify package settings
Home Options:
Options from
/home/byjokese/.jsbeautifyrc
{ "_default": {} }
EditorConfig Options:
Options from EditorConfig file
{ "_default": {} }
Project Options:
Options from
.jsbeautifyrc
files starting from directory/home/byjokese/MEGAsync/Codigos/C++/SAR
and going up to rootFinal Options:
Final combined options that are used
Package Settings:
The raw package settings options
Results
Beautified File Contents:
Logs:
The text was updated successfully, but these errors were encountered: