Polymer / atom-plugin

Provides autocompletion, linting, and more for web components.
Other
32 stars 8 forks source link

Property autocomplete does not show custom elements #28

Open lukasoppermann opened 7 years ago

lukasoppermann commented 7 years ago

Hey, I can not get the autocomplete for the properties of my vanilla custom element to show up. I did add comments like below (found that in the tests). However when I am within the tag only the standard html element autocomplete shows up. Any idea what I am doing wrong?

static get observedAttributes() {
    return [
        /** @type {boolean} When given the element is totally inactive */
        'disabled',

Could there be a plugin conflict? For autocomplete I am only using the following and disabling them did not help.

rictic commented 7 years ago

Maybe? Do you get completions in the example_project/ directory of this repo? (After doing a bower install there)

If not, probably a plugin conflict, if so, analyzer may be failing to recognize the custom element.

lukasoppermann commented 7 years ago

Okay, it was actually working, but it only works with ctrl + space. Why does neither the example project nor mine not show up in the normal autocomplete that is shown when hitting space when within the element?

e.g. <material-toggle|> + hit space?

In this case I only get the huge list of all attributes. Hitting ctrl + space I get my attributes and all the other attributes from the normal dropdown below.

Actually it is very inconsistant. Sometimes it works, sometimes it does not.

Example:

Actually I narrowed it down even more.

If I do a slow backspace (delete space) wait a second and do <material-toggle|> + hit space it does not work.

If I do a fast backspace (delete space) and very fast <material-toggle|> + hit space it works.

This also means it never works the first time.

rictic commented 7 years ago

Huh, strange. Look in package settings under Autocompete+ to see how it's completions are configured. That's atom's built in autocompeter and it's what we use. I believe there's an option for as you type completions. Is it checked?

lukasoppermann commented 7 years ago

Yes, it is, and it always shows completions, just not with the one from this package. I checked this before. 😄

lukasoppermann commented 7 years ago

I believe it is a timing issue. I noticed that when I set Delay before suggestions are shown to anything above 300 it works every time.

rictic commented 7 years ago

Curiouser and curiouser. For very large projects it takes us about 30ms to generate completions. I wonder if this is a last-one-wins sort of situation.

lukasoppermann commented 7 years ago

My project is extremely tiny: https://github.com/nuclei/material-toggle/tree/v1