Laravel auto formatting for Netbeans - netbeans

I'm using Laravel on Netbeans but any time that I use auto format (alt shift f) it messes up my code formatting. I know that I can edit each setting individually in Netbeans but that could take hours and never be complete. Is there an easy way for Netbeans to adapt to my files, or is there a settings file somewhere that I can import into Netbeans?
The only one I could find is this:
http://forumsarchive.laravel.io/viewtopic.php?id=13032
But it doesnt work. It messes up my blade templates and my routes file gets formatted differently.
Thanks!

For Laravel on PHPStorm I'm using php-cs-fixer plugin. For me, It's perfect toool for formatting.
Here you can find this plugin for Netbeans.
Also, you can install php-cs-fixer on your machine and run it from console. Git repository of php-cs-fixer.

Related

Feature file not getting formatted in Cucumber format

In eclipse, for cucumber feature file using for selenium,
When a feature file was opened, the feature file used to show in cucumber/gherkin format which doesn't show anymore.
When a feature file is created, sample features used to be created
When a feature is executed using dry run, Step definitions used to be created.
src/test/java and src/test/resources are showing greyed out in eclipse which was not the case.
Above mentioned three things are not happening any more which used to work earlier. I believe it's related to the set up of eclipse. I know the issue, not sure what details might be required. So please do let me know what might be required so that I can share here.
Eclipse Version:
Version: 2019-09 R (4.13.0)
Build id: 20190917-1200
That means either your editor is disable or corrupted.
1)
Try to open your feature file again as below:
Select other if cucmber editor not shown.
2)
Uninstall the cucumber plugin and install again.
Refer below link to uninstall the plugin from eclipse
Correct way to remove plugin from Eclipse
When a feature file was opened, the feature file used to show in
cucumber/gherkin format which doesn't show anymore.
Changed the default editor to cucumber, Not sure how default editor
was changed
When a feature file is created, sample features used to be created
After changing the default editor to cucumber, this started working
When a feature is executed using dry run, Step definitions used to
be created.
Added this parameter in the
#CucumberOptions(plugin = {"pretty","summary"})
src/test/java and src/test/resources are showing greyed out in
eclipse which was not the case.
Not sure, but this is not creating any issues so far
Associating feature file type with cucumber in Selenium WebDriver
I don't know the reason but I am also having a similar problem occasionally. When you over the file name go to the file tab and choose properties and then choose Associate with File Type --> then choose cucumber. I hope it helps.

Liclipse - Javascript

In the pydev liclipse editor how do add javascript folders so that it doesn't show errors in javascript files, such as $ is undefined (doesn't know jquery is also loaded when file is run).
I have tagged it with eclipse but this is a fork built around pydev "liclipse" so i don't see "javascript" as a project type.
TIA
Well, the LiClipse validator currently integrates JSHint internally (with Rhino), and there's no option to disable it...
Still, you can add a comment to the top of the file so that it knows that some symbols are expected to be undefined.
I.e.: if you add:
/*global $:false,alert:false*/
to the top of your file, the $ and alert symbols won't be triggered as not-defined.
I don't know anything about liclipse, so can't be certain my answer is correct. But I'd guess you will need to install some Javascript tooling in order to properly handle javascript code and projects. The options for Eclipse are not great, but there are JSDT and VJet.

Sublime Text 2 edited file-changes does not show when refreshing browser in Maven project

I am having problems when editing template-files(HTML-files) in my Maven-project. I have made the Maven-project an Eclipse-project with the command "mvn eclipse:eclipse" (if it matters). I am using the Apache Velocity Engine as template engine for this project.
The problem arises when I'm editing the files in Sublime, and then save the file and refresh the browser. The changes does not show! If I however open the template file in Eclipse, just open it, I can even just open and close it right away, and THEN refresh the browser, the changes will show.
I have done a test to see if this problem occurs on other simple projects as well, and with a single HTML-file and a simple http-server, the work I save in Sublime shows as normal.
Does anybody know what is happening here? Am I bound to keep on using Eclipse as a HTML-editor? :( Does the Eclipse project files prevent me from using other editors? Why are the changes only showing when I open the files in Eclipse?
Any help is greatly appreciated!
In order for the changes to take place you have to right-click the file in Eclipse explorer tab and choose "refresh" in order for the (static) changes to be reloaded to Apache. For dynamic changes you'll need to restart apache or use a plugin such as JRebel.
Eclipse copies the files to the "target"-folder in the webapp. Sublime(and others) does not do this automatically, so you need to do this manually, or by a plug-in that will copy the files on save.

Why doesn't Eclipse show default proposals for JSTL code?

I have the following problem:
I am working on a .jsp file on eclipse. My problem is that Eclipse somehow doesn't support default proposals for jstl code <c:[anything] and gives out the warning Unknown tag(<c:[anything]>). What's strange about it is that syntax highlighting works perfectly fine for JSTL code and for different code (Java, PHP, HTML...) there are default proposals. My servlet container is Tomcat and I've already copied the file jstl.jar in [folder]/webapps/ROOT/WEB-INF/lib/ but didn't help.
When I take a look at Eclipse->Window->Preferences->Web->JSP Files->Editor->Content Assist the checkboxes JSP Proposals, JSP Java Proposals and JSP Template Proposals are checked.
I feel like it's actually pretty obvious to figure out where the problem is but I just don't get it!
There are some event that it would trigger eclipse to validate files. You can rebuild eclipse project. or open problems viewer, and delete the problem which you can make sure the problem is not problem, if you really import the jstl.jar, next time it wouldn't warn you.
I managed to solve the problem. I still don't konw what it actually was but I just reinstalled tomcat (I'm working on a lubuntu system) and this time I didn't do it manually by extracting a .tar.bz2 file but via apt-get install ... . Then I created a new eclipse project and told it to use tomcat as servlet container. Then it worked right away so I assume that there was just something wrong with the way I installed tomcat before (maybe some variable didn't point to the correct directory or so).

Pydev, auto code format all files in an eclipse project

Please suggest a way to auto format all py files in an eclipse project using pydev auto code format. We're using the pydev code formatter to make our code consistent and would really like to get all files standardized.
Since we've enabled code formatting in pydev, every time a py file is touched by pydev, it gets changed at many places only due to code formatting cleanup. We'd like to do it across the project in one sweep.
Thanks
You can apply code-formatting to all the files within a project/folder.
To do that, right-click a project/folder and select pydev > source format python files.