How to enable Code Completion Auto pop-up in WebStorm? - html

I've been trying to get Code Completion to work on the current version of WebStorm (2017.3), but to no avail.
Specifically when working with HTML code completion seems to only work when I press the shortcut ctrl+space. As far as I can tell I should be able to get the Code Completion look up table to pop-up automatically when I start typing by going to Preferences > Editor > General > Code Completion and checking the box for Autopopup code completion the thing is... I DON'T SEE THAT BOX!!!
This is driving me insane. I've looked under Code Completion in WebStorm 2017.3 Help and there are discrepancies between what the instructions say I should see, and what I actually see.
This is a picture of my Code Completion window in WebStorm 2017.3:
but it should look more like this (IntelliJ IDE 2017.3):
The Basic Completion box is missing in WebStorm. Not sure if that has something to do with it.
I've looked around and it seems like other people's Code Completion window looks like it's supposed to. For example in this Community Forum there is a post in 2015 and another in 2016 where the users show their Code Completion preferences and they look like they're supposed to.
I've tried re-installing WebStorm, deleting all preferences and the .plist but it hasn't worked.
I would like to note, that this issue seems to be affecting only my HTML documents, since the Autocomplete pop-up table for JavaScript works well.
Any ideas on what might be going on? Is there something on my end I can do to fix this?

In short: it works as intended.
Thing is: it's HTML context ... where everything is a plain text with HTML tags inside (despite the fact that whole HTML document starts with <html> tag and stuff).
In this regard HTML context is not that strict/obvious as JavaScript/PHP/etc is. There is no way to guess if you are trying to write a word strong or a HTML tag <strong> .. hence you see no completion popup when you just typing any word. But .. if you type < before starting typing strong it will be a hint for IDE that you are typing a HTML tag (which means HTML context)... and completion popup will appear as usual (no need to invoke it manually).
If it would work as you are expecting/proposing (having completion popup for each word) then I would see it for every word in Any ideas on what might be going on? sentence. It will be supper annoying to see that popup appearing/disappearing for no reason for each word (when I'm clearly typing a plain text). Some people get mad even for much smaller things (like highlighting a matching brace or tag when you move caret left/right)...
Related subject: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000719050-Autopopup-completion-works-inside-php-tag-but-doesn-t-work-outside-of-it-Is-there-any-fix-
If typing < is a problem (not convenient or any other "religious" reasons (e.g. "why should I type it -- IDE should do that for me" etc)) -- consider speed up even more with Emmet (IDE supports basic abbreviations as well as expanding sequences) or Live Templates (basic Emmet abbreviations are handled with Live Template under the hood anyway).
https://www.jetbrains.com/help/webstorm/emmet.html
https://www.jetbrains.com/help/webstorm/live-templates.html

Related

Disable code completion for a shortcut in PhpStorm

I stumbled across this, when I tried solving this: Searching for Live Template in PhpStorm, from abbreviation (wrong expansion?).
TL;DR
In PhpStorm, in a markdown-file, when I write 3 back-ticks and press enter, it expands to this:
```angular2html
```
And I would like PhpStorm to stop helping me here, and just type what I typed:
```
```
Detailed description and solution attempts
In a Markdown-file (readme.md), I use it often to write a code block with three ticks:
```
But when I do so, PhpStorm suggest a bunch of stuff:
So if I press Enter here, then it expands to:
```angular2html
```
So how do I change this behaviour?
Solution attempt 1: Deactivate the bundled Angular-plugin
There is a (bundled) plugin called: 'Angular and AngularJS'. If I deactivate that, then it looks like this:
and expands to this:
```apacheconf
```
Solution attempt 2: Ensure Markdown is supported
I'm really baffled why this happens. Does PhpStorm not realize that I'm in an .md-file?
And/or is this the usual desired behaviour, when people write three backticks in a and .md-file?
I can confirm that I have an active (bundled) plugin called: 'Markdown' (version 222.3739.61).
Solution attempt 3: Add a new Live Template
This actually works, by making a new Live Template, to be this:
```
$END$
Remember the blank line underneath. This is since I would like to press Enter, and that replaces the first 3 ticks with this, but not the ones PhpStorm automatically adds dues to auto-closing of brackets and backticks.
This solution attempt seems quite hacky, though. :-/
From https://youtrack.jetbrains.com/issue/IDEA-266239
The pop up was created to make specification of code fence language easier and to enable automatic code injection. We can’t disable it since it would affect a lot of users using it for fast code injection.
angular2html is the first entry in your case. Somebody else may have another language ID (e.g. aidl).
Right now it cannot be disabled or customized. So you will have to either use your own workaround (with Live Template) or press Esc before hitting Enter.
Other than that: watch that IDEA-266239 ticket (star/vote/comment) to get notified with any progress. No better suggestions right now.

VSCode Emmet html boilerplate?

We used to be able to type ! inside an html document in vscode to get html boiler plate content completion as documented here.
However it no longer works. Thoughts?
I noticed that if we type ! and select Edit > Expand Abbreviation, the ! is replaced with boilerplate, but I no longer get the intellisense that was there before.
Update
Looks like we need to do ctrl+shift+p and search for User Settings. Filter for the emmet settings and select the Trigger expansion on tab then the ! is replaced with the corresponding emmet snippet.
I also selected Show suggestions as snippets, but the intellisense / snippet is still not showing up.
If you want to get html boilerplate with Emmet Abbreviation, you should type html:5 and hit tab.
I have faced this issue in visual studio.
Step-1:
try below steps in url. https://marketplace.visualstudio.com/items?itemName=sidthesloth.html5-boilerplate
Step-2:
if it worked : "cheers .!"
else:
it could be issue with select language mode. on the bottom of visual studio next to LF on your screenshot select language mode and change it to html.
Thanks & Regards, Surya kiran.
The issue was with Language mode only. You will get the option to select the Langauage mode on the bottom.
Been very annoyed for many, many long minutes by the boilerplate shortcut's suddenly, inexplicably not working (maugre much extension-de-installing and intalling and re-installing, even with VS Code uninstalls and re-installs, but what I'm come up with from mining various forums (what does seem to work and doesn't appear to be settings-dependent or peculiar to my laptop) is:
COMMAND+K plus COMMAND+L (one can just HOLD COMMAND and type K and then L sequentially).
In the Emmet Abbreviation window that comes up type ! as usual and then press Enter/Return.
Simply striking ! will bring up the boilerplate. One can then simply press Enter to return to the code.
The two-stroke process of ! + TAB is now replaced by the only marginally more involved five-stroke process of ⌘ + K + L + ! + Enter.
For me it was the "<" problem
this is not working: <html
this is working: html
After a recent update to VS Code the familiar why of getting a html boilerplate failed. You could add a index.html to the file explore and the window would open for its content.
Using Shift and the exclamation mark key would produce it. That is no longer the case instead create your file in the explore. When it opens the window type html, you will receive a dropdown to select from instead.
enter image description here
I experienced this issue after configuring my VS Code environment for an online course. In my case, the behavior was due to the following pair being added to my settings.json file:
"emmet.showExpandedAbbreviation": "never"
After I removed this, the shortcuts returned.

Use method name for SublimeText 2 autocomplete as well as tab trigger

The default SublimeText 2 snippets, located in the Packages directory and then under, say, Ruby are useful but only if you happen to know the tab trigger. For example the file ~/Library/Application Support/Sublime Text 2/Packages/Ruby/alias_method-..-(am).sublime-snippet contains:
<snippet>
<content><![CDATA[alias_method :${1:new_name}, :${0:old_name}]]></content>
<tabTrigger>am</tabTrigger>
<scope>source.ruby</scope>
<description>alias_method ..</description>
</snippet>
So we can access this trigger by hitting am then tab.
My question is, if this snippet chucks in alias_method :${1:new_name}, :${0:old_name} isn't there a way that I can use this snippet without knowing its am trigger, just by starting to type alias_m... for example?
Umm, no, not that I can find. I just opened up a blank Ruby file, hit a, and autocomplete popped up with all sorts of options, including the snippet you mentioned. However, if I then typed an l (starting to spell out alias...), the option for the am snippet disappeared. So, it looks like autocomplete is not searching the <description> field, only the <tabTrigger> field. There aren't any options in Preferences -> Settings - Default that would seem to address this situation.
So, unfortunately it would seem the solution is one of two things - either edit all your commonly-used snippets to have tabTriggers that make more sense to you, or put together a snippet cheat sheet. It looks like at least one other person was thinking the same thing, as I found this collection without too much searching.
Good luck!

Syntax in Sublime Text 2 Converts From "HTML" to "HTML (RAILS)" on save

I've tried various fixes with this, and it is really annoying me now.
Whenever I open a file as html, the default syntax for the file changes to HTML (RAILS). I can flip it back to HTML by the little select list in the corner, but it reverts. I've tried changing syntax specific files, setting extensions, etc. I even grepped HTML (RAILS) in my Sublime root folder recursively, and found nothing.
The thing that makes it hard to pin down, is that there is no extension difference. No matter which syntax highlighting I choose, the tag is the same.
I don't need syntax highlighting or autocomplete for HTML, but I do really like how matching tags are underlined in HTML syntax highlighting, and without it, I often miss unmatched tags, and cause lots of extra work for myself.
Any guesses on what this is / how to restore HTML to proper clean HTML highlighting?
(Note: The behaviour is identical for HTML and HTML5 and as I discussed in this post, I can't get tag matching to work in HTML5 anyway. That problem preceeded this one, but using HTML instead of HTML5 was an acceptable fix - that no longer works.)
In case anyone else has this bizarre issue, I've solved it.
There is a package installed (dont' remember if it was installed from the beginning, or if I added it) called Syntax Matcher. I commented out the following lines in a file called SyntaxHighlighter.py:
if self.ext == '.html':
self.set_syntax('HTML (Rails)', 'Rails')
return True
And the problem was solved instantly.

IE printing out source code at random (seems very nondeterministic)

Hey. the busted website is: www.mgxvideo.com/mgxcopy-alpha-3, and the specific error that I'm getting is the thing where IE prints out all my source code.
As far as I can tell, the error is appearing at random in IE6, 7, and 8, but it's a commonly occuring error. I'm looking for explanations, debugging tools, fixes. Anything is appreciated, because I'm fully stuck.
Here's how to reproduce:
Add item(s) into cart.
At the display cart (the url shud end with cart_display_ie.php)
Use the shipping calculator over and over and over again until you get the error. It's happened one the first, second, 5th, and the 17th try.
Reset cookies to restart from fresh
Here are some possibly relevant details
1and1 hosting, php from scratch, and mysql
I'm using Mark Sanborn's php code to interface with UPS's servers.
I'm using a local DTD for xhtml transitional 1.0
This error also appears in the checkout cart and also seems associated with the UPS function.
This isn't directly relevant, but IE also plagues me with "The XML page cannot be displayed."
Occassionally, the "The XML page cannot be displayed" is displayed as a small canvas within the context of a source print like the error I'm printing. It'll appear near the location of the error in html source, except the canvas has a really small width and height, and not display any further source code afterwards. I've fixed all these errors; they were all caused by improper syntax or w3 rationing of DTD downloads.
The cart_display*.php is responsible for adding products, removing products, and calculating shipping.
Sometimes it's something stupid like custom settings on my computer b/c I tweak with random settings that cause side effects. But I've tested in msft's VirtualPC, and had friends reproduce the error.
Here are some resources of similar problems. I haven't tried them because--even if they work--they mean that the website doesn't work at typical/default settings.
http://www.techsupportforum.com/microsoft-support/internet-explorer-forum/168285-ie7-problem-printing-html-xml-source-rendering.html
http://www.computing.net/answers/windows-xp/ie6-printing-problem/160128.html
Like I said: any explanations, tools, guesses, or fixes are fully appreciated. I'm trying to finalize the site so I can present it as a beta within the week, and I'm fully stuck. Also, is there a workaround (like a tag) that can hide this error from the user?
I grabbed a network capture of the repro using Fiddler (www.fiddler2.com).
It looks like you're sending an HTML comment containing a webservice result before the HTML body. It further looks like IE is subsequently sniffing this as an XML body instead of a HTML response.
It appears that if you move your HTML comment inside your HTML tag, the problem goes away.
Note that you should confirm changes in a new browser tab. Once IE is on an XML page, simply hitting F5/Refresh isn't necessarily going to show you the HTML content properly due to caching of the MIME-type decision.
To resolve this issue, you need to re-register two dlls.
Open a elevated command prompt and type following commands
regsvr32 /i mshtml.dll
regsvr32 /i shdocvw.dll
For detailed fix steps, visit http://geekzsupport.com/internet-explorer-prints-html-source-code/