Skip to content
This repository has been archived by the owner on Oct 7, 2019. It is now read-only.

Problem while running (please help) #11

Closed
ShakilAhmedShaj opened this issue Jan 22, 2018 · 7 comments
Closed

Problem while running (please help) #11

ShakilAhmedShaj opened this issue Jan 22, 2018 · 7 comments
Labels

Comments

@ShakilAhmedShaj
Copy link

ShakilAhmedShaj commented Jan 22, 2018

I hve installed both two packages formatter and this

and when I want to format my code it shows

image

please help me

i also downloaded astyle for windows but its just a zip file and i extracted but i dont know how to use it.

@janosimas
Copy link
Owner

I have never used astyle in windows but i'll try to give some directions

First you should try to put the astyle executable in your project folder, that might solve the problem for one project.

The other option is to put the astyle path in the PATH or the astyle executable somewhere visible in the PATH. I'm not very familiar with Windows best practices so I recommend you avoid this.

@LiZhenhuan1019
Copy link
Contributor

LiZhenhuan1019 commented Jan 23, 2018

There are two ways:

  1. The first way : Copy the executable file to C:\Windows\System32 .
  2. The second way : Generally you should have your own folder to place your executable files so that you can execute them in cmd.
    • So make such a folder and copy your astyle executable into it.
    • Open Control Panel, go to System and Security -> System, select Advanced System Settings on the left, select Advanced tab, click Environment Variables, then a window shown below should appear:
      image
    • Double click on Path variable and add an item for your folder created before.
    • click ok to exit and open cmd, enter astyle and it should work now.

As far as I know it is not convenient to install tools like this on Windows. I tried msys2 to make it more convenient but there seems to be some problems with interaction between msys2 and cmd.

@ShakilAhmedShaj
Copy link
Author

ShakilAhmedShaj commented Jan 23, 2018

@janosimas Thanks a lot for your responce

but let me clear my problem in brief

@LiZhenhuan1019 thank you also for your reply

so I followed this - https://atom.io/packages/formatter-astyle

image

as instruction i installed thye two package and in atom when i tried to format a code pressing ctrl + alt + L then the error message like below

image

came.

then i downloaded artistic style from - https://sourceforge.net/projects/astyle/

but its just a zip file, i extracted this but In dont know how to use it for atom

i just want to know the next step, that how can i format my code in atom editor pressing shortcut key like atom beautifier( but i dont like beautifier)

I hope I have now cleared my problem and sorry, I am a newbie

please guide me for this :-(

@janosimas
Copy link
Owner

The instructions you followed are ok, but the package is not finding the astyle executable.
Try to extract the zip on your project folder e see if it solves the problem.

@LiZhenhuan1019
Copy link
Contributor

Sorry for lack of clarity in previous reply.

formatter-astyle use astyle.exe to actually format the code, so formatter-astyle (or actually, cmd, which is executed by formatter-astyle) needs to be able to find the executable file astyle.exe to execute it.

In fact you need to download the astyle.exe file and either specify the position of astyle.exe in the setting page of formatter-astyle, so that formatter-astyle can know about astyle.exe or you can place astyle.exe in a position that is included in the Path environment variable, which is specified in previous reply, so that cmd will search the Path variable, find astyle.exe and finally execute it.

After following the instructions , it should work by pressing ctrl + alt + L in Atom.

@ShakilAhmedShaj
Copy link
Author

Thanks a lot guys, Thanks a lot...

both the method copying files in the project folder and setting the path worked <3

@janosimas
Copy link
Owner

@LiZhenhuan1019 Do you want to make a ppull request with your comments to the instructions?

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

No branches or pull requests

3 participants