How do you turn off XML code completion in IntelliJ IDEA? - intellij-idea

In IntelliJ IDEA if you open an XML document and start entering XML
<body name=
Then the software immediately and undesirably adds untyped quote characters
<body name=""
Without realizing there is extra input I continue to type a quote character followed by the value of the property followed by another quote character
<body name=""value""
and that's a syntax error.
The preferences has a whole section for Auto Completion and I unchecked every box. That didn't change anything, the XML editor still does it. How is this feature controlled?

Disable Add quote for attribute... under Preferences | Editor | General | Smart Keys | HTML/CSS

Related

Unexpected whitespace between function name and paren.(func-call-spacing), A space is required before '}'.(object-curly-spacing), webstorm quasar vue

I'm new to using stackoverflow and using WebStorm quasar,and vuejs, so let me know if you need any more details or if I did something wrong.
pictures of code errors:
https://drive.google.com/drive/folders/13oSjnK6Q21ztsihbcF0a-TUUAWAo0vcW?usp=sharing
errors:
ESLint: A space is required after '{'.(object-curly-spacing)
enter image description here
ESLint: Unexpected whitespace between function name and paren.(func-call-spacing)
I correct these errors by adding the correct spacing, but whenever I refresh the website, I'm working on, WebStorm changes them back.
I believe its some sort of a formatting error.
I've gone into,
Settings->Editor->Code Style -> JavaScript
Settings->Editor->Code Style -> TypeScript
and clicked on spaces, and check the appropriate boxes.
spaces - before parenthesis - function call parenthesis
spaces - within - object literal braces
but the problem still persists.
You should have disabled the Spaces > Before parentheses > Function call parentheses and enabled the Within > ES6 Import/Export Braces in Settings | Editor | Code Style | JavaScript; please also make sure that you don't have the IDE code style preferences overwritten by the settings in project .editorconfig (if any)

How do I stop SQL splitting string literals when I press Enter in DataGrip or IntelliJ Database Editor?

When my cursor is after an open quote in a SQL statement in an IntelliJ database console and I press Enter, it closes the quote on the current line and adds a concatenation symbol with an open quote on the newline.
I disabled formatting the SQL code style settings but that didn't fix it for me.
UPDATE blah SET blah2 = 'something<pressed enter>' ||
'<argh!>...';
Is there a way to disable this autoformatting?
This request was addressed in 2017.1 version, as a result, Insert string concatenation on Enter setting was added specifically for SQL:
This can be archived since IntelliJ 13. You simply need to wrap your code with
// #formatter:off
your code goes here
// #formatter:on
Since IntelliJ Idea 15-16(pardon if i'm wrong), you can also make permanent set up by Preferences > Editor > Code Style option
Hope it helps

WebStorm wrapper text with square brackets

When I select some text, for example form-col and press [ I want to get [form-col] but WebStorm replace selected text with [. Is there a way to configure it?
I don't think that functionality exist. However you can use the Live template functionality. It's very useful and it does pretty much the same thing.
To do this, go on : [File]->[Settings]->[Editor]->[Live Templates]->user, Click button + and add a live template like:
In you html file when you write the abbreviation what you are added, press Tab and it generate you [] and place the cursor after the first [and now you can write your html tag [form-col]
Settings/Preferences
Editor | General | Smart Keys
Ensure that Surround selection on typing quote or brace option is enabled

Intellij - Reformat Code - Insert whitespace between // and the comment-text?

I am working with another human being on project from that the professor expects to have uniform code-style. We have written large separate junks of code on our own, in which one has written single line comments without a white-space between the single-line-comment-token and the other one has inserted a white-space. We are working with IntelliJ and have failed to find an option to enable the Reformat Code function, to insert a white-space.
TLDR:
Can you tell us how to convert comments from that to this in IntelliJ?
// This is a load bearing comment - don't dare to remove it
//This is a load bearing comment - don't dare to remove it!
You can do a global search and replace (ctrl-shift-r on windows with default keyboard layout, or Replace in Path under the Edit/Find menu).
Check the regular expression option and enter //(\S.*) as the text to find and // $1 as the replacement. Check the whole project option, and clear any file masks. You can single step through the replacements, or simply hit the All Files option.

IntelliJ: Suppress quote insertion for HTML attributes

In IntelliJ IDEA 11 or 12, with an HTML file open, typing
<img src=
causes automatic insertion of double quotes, resulting in
<img src=""
Since I type ahead of where I read, this usually means I end up with something like
<img src=""image.png" alt="Image"/>"
How do I prevent double-quotes from being inserted automatically after attribute names?
In Intellij IDEA 14 and 15 (see #Zook's comment for IDEA 13), the option is now
Windows:
Menu File→Settings→Editor→General→Smart Keys→Add quotes for attribute value on typing '=' and attribute completion (under XML/HTML section on the right side of the Settings dialog)
Mac:
Preferences→Editor→General→Smart Keys→Add quotes for attribute value on typing '='
I don't know if it was the same for previous versions, but what actually happens in IDEA 14 is it automatically inserts both quotes and puts the cursor inside them. That's fine, but then when you type what you expect to be your opening double-quote, the smart punctuation mechanism thinks you're closing the quotes and skips you over the automatically-inserted close quote (the same as it does in e.g. java code when you type a closing parenthesis when it has already auto-inserted one). So you wind up with the cursor after the pair of quotes, typing your attribute value. This seems consistent with the original observation.
I would actually consider this a bug in IDEA but I guess the fact that opening and closing punctuation are the same symbol in this case makes things complicated. The smart punctuation mechanism would need to know to ignore the first quote you typed, but if you actually wanted to type an empty attribute value like src="", it would need to ignore the first quote and then jump over the close quote for the second one. Fiddly, but not impossible.
I've tried it with IDEA 12 and double quotes are inserted only after you start completing src attribute and press Enter or type = to confirm the completion. It doesn't happen automatically, you invoke completion that inserts quotes.
There is no option to control it, so you will have to break your habit to insert quotes manually and use Enter instead.
It's also possible to use the template completion with:
imgTab to generate <img src="" alt=""> with the caret inside first pair quotes.
Then just enter the image file name, Tab, enter alt text.
You can always submit a feature request to disable adding quotes on attributes completion.
Just change Input Language from "US - International" to "US". Switching to just "US" fixed the problem.
Read IntelliJ thread