I created Code Style rules for my HTML files in JetBrains editor.
One of my rule is:
then I export my rules to .editorconfig file:
when I open my file I see one error for that rule:
also when I reformat code it will break into multiple lines
How to setup editor to not showing error and not breaking rule into multiple lines? I didn't find any rule in EditorConfig Code Style.
It's a known issue.
https://youtrack.jetbrains.com/issue/IDEA-244480 -- watch this ticket (star/vote/comment) to get notified with any progress.
Related
What I wanna achieve ?
When any .php file is saved, it checks the file and checks for unused use statements.
How can I parse or somehow get the list of unused use statements in the file without custom code analysis ? The PHPStorm does it with the php plugin. Can I get it from it? The documentation is realy bad and I was not able to find anything.
I have the php plugin dependency in my plugin.xml
<depends>com.jetbrains.php</depends>
It would be great if i could parse the whole php file and access information about use statements, fucntions, classes etc.
I know there are plenty of questions about this problem, but no one of the solved it for me! I'm using the Community Edition of IntelliJ and I tried to run JavaDoc through the IDE. Everytime and it doesn't matter fo which file, I run JavaDoc I got the following output:
javadoc: error - cannot read Input length = 1
I already figured out, that it might be an encoding problem... I'm working on a Windows 10 maschine. I already tried the following:
JavaDoc argfile encoding error
Start the terminal from IntelliJ with cmd.exe /K chcp 65001 instead of the default one cmd.exe to set the charset to UTF-8
I also set the project's default charset through the IntelliJ settings to UTF-8 (See: This Guide)
The problem seems to be the javadoc_args file respectively the path to that file... The path is C:\Users\Somebody Müller\AppData\Local\Temp\javadoc_args. Also if I view the file from IntelliJ, all ü characters are replaced by an unknown symbol.
I know that I could generate the documentation through a maven plugin, but I would prefer to do it via the IntelliJ IDE...
Could somebody identify the problem in detail and/or provide a solution or maybe parts of it?
EDIT
skomisa described the situation/behaviour in easy words:
For me the javadoc_args file does not exist! I see it is named in the Javadoc window as an argument to javadoc.exe, and if I click the link its content is shown in a pop up window within Intellij IDEA, but if I check in File Explorer there is no such file. Is this the case for you as well? I have no idea how it gets generated. Also, I created a project in a folder named Müller and the ü was rendered as � within the popup window that showed the content of javadoc_args.
UPDATE 04/12/2018
As skomisa already commented, JetBrains plans to fix this bug in a future version, likely in version 2019.1 (Build 191.2458).
UPDATE 22/02/2019
I know this question is quite old but it seems to be still relevant. I didn't check up to now if JetBrains fixed the bug but a similar one occurred for me when I try to open an JavaFX fxml externally inside of the SceneBuilder. In another post about renaming a Windows 10 user directory I found a possible workaround at least for Windows users! Just create an additional user directory without ü in the path and link to the existing one:
C:
CD\Users
MKLINK /J Müller Mueller
If you now uses the link as directory for project paths it should work fine.
I am unable to generate the Javadoc for a project in Intellij IDEA if the name of the path contains the character ü (u with umlaut). The workaround is to rename the project so that the project directory file path does not contain an umlaut.
To reproduce:
Use the project wizard to create a trivial Java Hello World project where the root directory name contains ü. I used Müller for testing purposes.
Ensure that the class for main() contains valid Javadoc documentation.
Build and run the project to verify that there are no unexpected issues.
Select Tools > Generate Javadoc, specify an empty Output Directory and click OK.
Javadoc creation fails with the error - cannot read Input length = 1 (shown below), and clicking the link to C:\Users\johndoe\AppData\Local\Temp\javadoc_args shows that the ü in the file path is (mis)represented as �, which presumably is the cause of the Javadoc error.
However, once the root directory is renamed from Müller to Muller (to remove the umlaut) the Javadoc creation works:
As a sanity check, rename the project from Muller back to Müller to reintroduce the error:
Notes:
As noted in the comments, the javadoc_args file does not exist, and I see no way to prevent its use during the Javadoc creation process.
Having the project name as Müller is not an issue; it's having ü within the project's file path that causes the problem.
Environment: Windows 10 + Intellij IDEA 2018 3.1 EAP (Ultimate Edition) + Open JDK 10.
I raised a bug report with JetBrains for this: https://youtrack.jetbrains.com/issue/IDEA-202849
Update 11/25/18
There is a workaround for this issue without needing to rename the project's path:
Run Generate Javadoc and let it fail.
Click the link to the file .../javadoc_args shown in the Javadoc window.
Copy and paste the content of the file javadoc_args into a text editor.
Correct any characters that are misrepresented (e.g. change M�ller to Müller).
Save the file using UTF-8 encoding, and the same absolute filename.
Open a Command Prompt window.
Copy the entire javadoc.exe command from the Javadoc window in Intellij IDEA and paste it to the Command Prompt window.
Submit the line that was pasted. It will now work because the project's path is correctly specified in the file javadoc_args.
Today (21-aug-2021) I tried to generate a javadoc but it failed. The error message was:
javadoc: error - cannot read Input length = 1
In my case it referred to the length of the path to the file, which is shown below.
D:\Tecnologia(ytrabajo)ysistemas26sep2020\misiontic2022\U El Bosque\UEB académico\Ciclo 2\Programación Básica\NetBProjects\R5DTO_DAOMVC_GUI
So I shortened the path to the following:
D:\Tecnologia(ytrabajo)ysistemas26sep2020\misiontic2022\NBProjects(m)\R5DTO_DAOMVC_GUI
As one can see, this route is shorter than the first so NetBeans could access it and generate the javadoc.
Note: It is not possible that NetBeans could not read the location because of the following characters: é and á in the words académico and Básica that I used in the first file location. Because, in that location, I tried to generate a JavaDoc in another project located there and NetBeans generated the Doc. So the error is more about the length of the path and the names of the files in the project.
I generated a Vue.js project using this tutorial: https://www.vuemastery.com/courses/real-world-vue-js/vue-cli/
And then I proceeded to change Visual Studio Code settings and project configuration as described here: https://www.vuemastery.com/courses/real-world-vue-js/optimizing-your-editor
Unfortunately, this caused the Vue-CLI and Visual Studio Code to have different formatting settings. Whenever I save a file in VS Code, it gets formatted (which is fine). But when I run a command in Vue-CLI, all the files get reformatted by different rules. This means that almost all the files get modified even if the change is irrelevant to what I'm doing. This is driving me crazy.
How can I get these tools "in sync" so that they don't apply different formatting rules? Which configuration files are relevant for this?
Or would it be possible do disable the formatting in Vue-CLI completely?
UPDATE:
Recently I noticed that VS Code is messing up the formatting by itself. Even without using Vue-CLI. When I make changes to a .vue file and save them, VS Code adds trailing commas after last elements in javascript maps. When I make a couple of additional changes, the commas stay there. But then with another change, it suddenly removes them all. This behavior seems completely random.
I created a file called prettierrc.js in the root directory with the following content:
module.exports = {
trailingComma: "all",
arrowParens: "always",
};
I have a Scala app built with Lift framework. It has a few .conf files. When I open those .conf files in my IntelliJ IDEA Ultimate Fancy Pants Edition, I do not see any buttons to fold those curly braces in those files. Hotkeys do not do it either. Browsed for plugins, none applicable found. Is there any solution to enable code folding in .conf files?
Update:
Here is an illustration of what would be lovely. Those "-" and "+" icons do not appear in .conf files:
The relevant plugin is the HOCON plugin.
To install, click the Get button from the above JetBrains Marketplace link. Or, from within IntelliJ, go to Settings/Preferences (Ctrl+Alt+S for Windows; ⌘+Comma for Mac) and select Plugins, then click Marketplace to search for the plugin and install it. Restart IntelliJ to enable it.
To confirm, go back to Settings/Preferences and select Editor > File Types. You should now see HOCON (Human-Optimized Config Object Notation) file types among those listed as "Recognized File Types". Click HOCON and you should see *.conf under "File name patterns".
All your .conf files should now appear in IntelliJ with syntax highlighting and code folding.
Edited Oct 2020 to remove Scala plugin reference, as it no longer seems to support HOCON files.
Those .conf files are of HOCON type ("Human-Optimized Config Object Notation"). To enable folding them, you have to force the editor treat them as such. In IntelliJ settings, configure it as illustrated:
Preferences->Editor->File Types, and there add filename patterns to HOCON filetype.
2020+
The best option is to install HOCON plugin separately. For now, HOCON file type is not bundled with Scala plugin anymore.
P.S. All credits to ghik's comment. Decided to put this into separate answer because I was not able to find the tip at first time.
I am working on a project where tab size is supposed to be 4 and tabs should not be spaces. I updated my Preferences.sublime-settings file to include
"detect_indentation": "false",
"tab_size": 4,
"translate_tabs_to_spaces": false,
When I open a new file these settings are set to how I want and everything works. However, if I open an existing file (scss or html) that has indentations as 2 spaces, my Sublime settings are overwritten and indentations change to 2 spaces. If I click View > Indentation I see that Tab Size is set to 2 and Indent Using Spaces is enabled, even though my preferences should be the opposite of that.
If I manually change Indentation via View > Indentation to Tab Width: 4 and deselect Indent Using Spaces, this works until I save the file, at which point the settings revert to Tab Width 2 and Indent Using Spaces turned on.
How can I force Sublime Text to honor my indentation preferences and not be overwritten by another file. I would assume that Sublime is detecting the indentations on the page, but I've turned that setting off.
Here is my preferences file showing that things should be working:
Here are the messed up settings for a scss file. All I did was open it:
I don't think any plugin is causing this, I disabled most of them and was still experiencing this issue. However, for reference, here is a list of all packages I have installed:
Alignment
BracketHighlighter
Capybara Snippets
ColorPicker
Dotfiles Syntax Highlighting
EditorConfig
Emmet
ERB Snippets
Gem Browser
Gist
Git
GitGutter
Haml
jQuery
JSHint
Package Control
Pretty JSON
PyV8
RSpec
SCSS
SideBarEnahancements
SublimeLinter
Terminal
TrailingSpaces
Thanks in advance for any help.
So I figured this out by completely uninstalling Sublime Text and all associated packages and settings, then reinstalling the app and one-by-one reinstalling my packages. It turns out that one of my packages, EditorConfig, was overwriting my Sublime Text style settings.
EditorConfig is actually a really cool plugin that allows a number of developers working on one project across multiple IDEs to have a consistent style by defining indentation type, size, charset, and other settings.
The answer to my problem was that in the particular project directory I was working some of the node modules I had downloaded had .editorconfig files that had indentation set as size 2 and spaces instead of tabs. I had to either uninstall the EditorConfig package from my Sublime Text or create a new .editorConfig file in the root directory of my project. This is the .editorConfig file I created that fixed my problem.
# top-most EditorConfig file
root = true
# 4 Tab Indentation
indent_style = tab
indent_size = 4
When a file is loaded, its contents are examined, and the "tab_size" and "translate_tabs_to_spaces" settings are set for that file. The status area will report when this happens. While this generally works well, you may want to disable it. You can do that with the "detect_indentation" setting.
This might be helpful: https://www.sublimetext.com/docs/2/indentation.html