atom-plugin
atom-plugin copied to clipboard
Autocomplete doesn't work if you didn't start with a leading `<`
e.g. import paper-button.html and type:
paper-bu
then select <paper-button>
in the autocomplete and press enter
.
What happens?
Nothing
What should happen?
Autocomplete to <paper-button></paper-button>
I am having the same button tab
as well as return
should insert the element. Can you please look into it? I have no idea how to fix this, but if there is any testing, etc. I can do to help, let me know.
Without this feature the plugin is really not that useful.
So I have spent the last couple of hours fiddling with this bug. The problem is that the plugin does not know anything about the context of the typeahead, that's what the editor service knows about. Therefore I tried to implement this into the editor-service
, but got stuck since it returns {kind: 'text'}
and no corresponding node nor context to make a decision on. The fix I developed does not work for <vanilla
since it will duplicate the <
.
Huh, it gives text but not the text content node? That's unexpected in most cases, really that should only happen in strange cases where typing would type into a text content but there's no text content currently, like a totally empty document, or where the cursor is somewhere like <foo>|</foo>
. Seems like that's a bug in getLocationInfoForPosition
.
As an aside, the editor service's canonical location is https://github.com/Polymer/polymer-editor-service, the version in the analyzer will be deleted very soon.