I've been looking at the atom-beautify site and example .jsbeauifyrc, .editorconfig, and uncrustify.cgf files.
I've also reviewed the options for atom-beautify. I know I'm supposed to specify where the config file is located in the atom-beautify settings. I've tried putting a .jsbeautifyrc file, an uncrustify.cfg file, and both files in the same directory I specify in the atom-beautify settings. It doesn't have any effect. The default settings are used. I'd like to make some old C++ code look more uniform for my current project and future projects my group is working on.
Which file am I supposed to use?
What must I include in each file?
Where should this/these file(s) be located?
How do I specify the path?
Are there any other changes I need to make that I'm not aware of?
To sum up, I want to use uncrustify from within the Atom editor (using the atom-beautify package) to make my C++ code look nice.
Make sure uncrustify is installed on your computer, and accessible from CLI
In the settings for atom-beautify, go under the C++ section and type uncrustify.cfg as a Config Path
Place the config file name uncrustify.cfg in the root folder
Try beautifying your code, it should be using your config file now
you have to add PathVariable of uncrustify.exe (From Source AtomBeatify : https://atom.io/packages/atom-beautify ) on your system , when you upload you code to Atom click on ALT+CTRL+B it will beautify you Code .
Download zip On Windows, download the latest version of Uncrustify here: https://sourceforge.net/projects/uncrustify/files/latest/download
Extract zip The program is a standalone exe, so just extract the downloaded uncrustify-...-win32.zip file anywhere. For this example, I'll use C:\Uncrustify. So, the uncrustify.exe would be in that directory.
Add directory to PATH System Environment Variable In Windows 7+: Type Winkey + env - Select "Edit the system environment variables"
On the Advanced tab, click the Environment Variables button at the bottom. In the System variables section at the bottom, click the Path variable, then click the Edit... button.
Click the New button, and type C:\Uncrustify, or the directory that you extracted uncrustify.exe to.
Important: Click OK to close the dialog boxes or your change will not save. Verify
In a CMD window, typing where uncrustify should return the path to the uncrustify.exe.
In my case it shows C:\Uncrustify\uncrustify.exe Close Atom and reopen it. Now you should be able to atom-beautify and it will use Uncrustify to format your selection
Related
I am writing an Electron application. I'm using HTML + CSS + JAVASCRIPT with Electron. As you can see below, I have a form and I keep this form information in an .env file. I start the Electron application, open and fill the form, and then save it to the .env file. Thus, my .env file is changed, but I cannot immediately recognize the changes in my .env file. Therefore, if I open my form again, old information is coming. If I restart my Electron application, this event is fixed. How can i solve this problem? I would appreciate your help, my dear developer friends.
First situation: Before I don't save informations to .env file
Second situation: Saved time view
I'm reopen settings window and last result (It gets old information but .env file changed)
Last situation: As you can see...
I'm try app.relaunch() method on this situation. But nothing affect.
There are a few ways to detect changes to a .env file during a process in real-time:
File System Watcher: You can use the watch command in Linux or the fs.watch method in Node.js to watch for changes to a specific file or directory. This method will trigger a callback function whenever the .env file is modified.
Polling: You can use a setInterval or setTimeout function to periodically check the .env file for changes. This method will trigger a callback function if the .env file has been modified since the last check.
Event-driven: You can use an event-driven approach to detect changes to the .env file. This method will trigger a callback function whenever the .env file is modified.
Use a library: There are several libraries available that can be used to detect changes in the .env file like dotenv-expand, dotenv-webpack and etc.
You should choose the method that best suits your specific use case and programming language.
Please keep in mind that the above methods are general suggestions and you may need to make some adjustments depending on your specific use case.
I am developing a VSCode extension to generate templates.
However, I cannot figure out how to get the location of the VSCode file that I am currently editing.
When I search for this question, most answers say to do something like vscode.window.activeTextEditor.document.uri.fsPath - however - this gets you the directory for the target VS code window (the Extension Development Host window) - which is not what I want
I want to get the directory of the VS code extension file I am editing (such as the extension.ts file).
Any help greatly appreciated.
If you mean the extension's path:
context.extensionPath
For extension.ts try something like:
context.asAbsolutePath("extension.ts") // if at top level
If you don't know the directory structure of the file you are interested in, like src/otherDirectory/otherSubDirectory, I think you will have to search/walk for it with fs commands starting from the extensionPath. See https://dustinpfister.github.io/2018/07/20/nodejs-ways-to-walk-a-file-system/ for example.
So i am making a mobile app. in this app, on my main screen, i have a button that when clicked it will load another frame, or js file. this i know how to do but when pressing the button it gives me an error, "cant find file". after 3 hours of web searching i have tried changing the path names to every possible combination and moveing the file around. after doing so i came to realize that next to the new file i created, or any new file i create, there is an "*" and a question mark. for example if i make a new file called login.js it will show up on the explorer window as *?login.js, where the question mark is much smaller symbol. Is there a manifest i must add it to, like in netbeans, because it seems as if there is an error in the file but it is empty.
function signup(e){
var menu = Ti.UI.createWindow({
url: 'Main-Menu.js'
});
menu.open();
}
i also did: Titanium.include('/controllers/Main-Menu.js');
but always getting the same error, the JS file is in my apps controller folder.
This *? indication comes from the git plugin that is shipped with Titanium Studio. It indicates that the file is not commited.
To answer your "can't find file" - question, I need to know some more details about your environment (target platform, sdk version, example code, ...)
I'm using schedule component of Primefaces 2.2.1. If you decompress primefaces-2.2.1.jar included in your project in /lib, you see a .js file and a .css file for each component of primefaces. In my case, I have schedule.js and schedule.css (placed at primefaces-2.2.1\META-INF\resources\primefaces\schedule). The point is that I have to modify schedule.js to add some functionality. So, I decompress primefaces-2.2.1.jar, modify schedule.js, compress everything again to primefaces-2.2.1.jar an place it again in /lib. Then I run the application and this message is showed to me:
javax.servlet.ServletException: Error loading theme, cannot find "themes/sam/theme.css" resource of "primefaces" library
I can see that the file theme.css is present in primefaces-2.2.1\META-INF\resources\primefaces\themes\sam
And I know that it's possible to change schedule.js and make it work becouse some other user did. You can see it here http://forum.primefaces.org/viewtopic.php?f=3&t=15163&p=80971#p80971
Anybody knows how?
All you have to do is :
1) Install 7-zip
2) Browse the primefaces-2.2.1.jar , copy the relevant js file outside the jar
3) Modify it as you wish
4) Delete the relevant js file from the jar
5) Drag and Drop the modified js file back to the jar
Also , take a look at a similar question :
Customizing event appearance primefaces schedule
I have a Mac with jEdit 4.5 installed on it, including the Sidekick and the JavaScript plugin from here1. Now when I open the Sidekick window, I can choose from two JavaScript parsers (skrul-xml-javascript and skrul-javascript).
However, none of them parses my JavaScript file (the window only shows the document name with "Not parsed" underneath it). When I open a PHP file and choose my PHPParser, it does parse the file and shows clickable PHP function names.
You can install "Ctags SideKick" plugin and choose to use "ctags" parser in sidekick.
And you should install ctags in your system and config it in CtagsSideKick options.