In Eclipse, I've setup the Java formatter to wrap lines only when they exceed 120 characters. I would like the same setting to be used when I format JSP files, but at the moment it wraps them when they exceed 90 characters, is it possible to change this?
Window - Preferences - Web - JSP Files - Editor. Click on the link for your kind of JSP (HTML or XML content), and adjust the line width.
Note in the latest version of eclipse you won't see the line width option in jsp files editor, instead this is covered by the line with setting in html files - editor menu
Window -> Preferences -> type HTML...You'll see "Editor" so in line width, enter the value as you need. Works for me on eclipse 2018-12 version
Related
Eclipse asked me if I want read a text file with UTF-8 and I agreed. Then all my files in the project where converted into this encoding. How to undo this or convert all files into Cp-1250 ?
When I click on the file I event don't have option to convert it into Cp-1250:
The drop-down values in the encoding combo only show the most common values. You can type in other values in the text area (the highlighted 'UTF-8' in your image).
The value you type must be something supported by the Java Charset class. Charset uses the name windows-1250 for that code page rather than 'CP-1250'
This setting does not actually convert the files, it only changes the way Eclipse reads the file.
You can also set a default for the Workspace in the Preferences on the 'General > Workspace' page.
I need to disable error highlighting in Java files in VS Code. VS Code tries to check a Groovy file while thinking it is a Java file.
As you can see in the picture all imports after the first and the types after the first field are highlighted red (due to missing semicolons). However I do not want the error check for this Groovy file.
NOTE: I only have the plugins Clang, RedHat.Java, Markdown PDF, Sort Lines, and Uncrustify installed. Even if I disable all the red highlighting is visible.
open your preferences file and add this
"java.validate.enable": false
I didn't try it for java, but it works for typescript.
I found this:
"problems.decorations.enabled": false,
You should disable the linter, which is by default enable in VS Code.
To do so you can go to File-> Prefrences -> setting
I wouldn't think this is necessary but you might try:
"files.associations": {
".groovy": "groovy"
}
in your user settings, assuming your file extension is .groovy. If it is something else, just set it to "groovy" as well. When I create a .groovy file with your content or gibberish I get no error linting at all. What is your file extension and what does Vscode call it in the bottom right of the editor? You can click on that file type to change its file associations. See modifying Vscode file extensions.
I'm currently using eclipse Mars and I'm trying to figure out how to enable word wrap so that when my lines are too long, it can go down to the next line. I tried going to
Preferences > Java > Code Style > Formatter
and I created a new eclipse profile then set the maximum line width to 50 under the 'line wrapping' tab. I applied the feature and clicked 'Ok'. I tried to test if it worked by writing a really long line of code and it still didn't wrap. What am I doing wrong?
When I edit the java source code, intellij will auto format my code besides the places I edit, how to disable that ?
In the latest IntelliJ Idea (2021.3), Auto formatting can be stopped for one or more file type by going to
Preferences -> Tools -> Actions on save -> Enable or Disable Reformatting action for one or more file type
For those of you who want to disable formatting just for some specific file(s), there is a way since 2018.3 (IDEA-97848).
Go to Settings > Editor > Code Style > Formatter and add your exclusion pattern(s).
I tried disabling trim trailing spaces in code formatting but this doesn't work for my file type '.erb'.
I added my file type '.erb' to selectively disable code inspection for this file type but this doesn't work in IntelliJ version 2016.2.4.
I locked my file after I had made the changes using the lock icon in the Status Bar and this finally worked!
In Preferences > Tools > Actions on save you have a definition
BUT that can be overwritten by the following one, so check in that order:
In Preferences > Editor > Code style > [language] uncheck reformat on file save.
Update: None of those worked for me, so I change my file, commit without save (DON'T save during commit to avoid data loss, you'll be prompted) and then CTRL-Z.
Your file is committed and saved but only with your changes.
FWIW, I'm using Scala, on IntelliJ Community 2021.2, with the Scala plugin.
In my case intellij was messing with all the spaces in the code.
So, I changed following settings :
Editor > General
You can disable IntelliJ IDEA's ability to format (and therefore auto format) specific file types, but it comes at a cost.
To disable :
Settings > Editor > File Types
Select the file type you want to have never formatted
change the extension to something you don't use - for example '*.styl' to '*.oldstyl'
Now, even if you tell IntelliJ to reformat one of these files it won't.
The cost is that you lose syntax highlighting and language support all together.
In my case for stylus files it was worth it.
IDEA kept removing tab characters in sections of code that I wasn't even working in. SUPER annoying and destructive.
Can anybody reproduce the following?
In my NetBeans 7.2 project I've set the "project.license" property (in project.properties) to "apache20" so that NetBeans generates the appropriate license text in every new .java file. The license text (which is located in "license-apache20.txt") contains the following FreeMarker reference:
${project.organization!user}
When "project.organization" is not set it displays my user name as expected. Also, when I set a custom user name in the User.properties file it displays this user name instead. So far so good.
However, I want to set the "project.organization" property. But when I do this in the project.properties file NetBeans simply doesn't recognize it, displaying my user name instead.
When I remove "!user" from the FreeMarker reference it generates the text "Expression project.organization is undefined on line 4, column 59 in Templates/Licenses/license-apache20.txt." When I set the property in User.properties instead (silly place, but I did it for sake of analysis) I get the same behavior. Does anyone know what might be wrong or how to get NetBeans to find the "project.organization" property? Does anyone have the same behavior on his or her NetBeans?
In license-apache20.txt (or any other license template), change ${project.organization!user} to ${organization!user}
In NetBean menu, Tools ❯ Template, when you click the Setting button, a User.properties file is opened. Add organization=FooBar Inc there.
(This is not very ideal, but at least it allows to customize the organization.)