atom-plugin icon indicating copy to clipboard operation
atom-plugin copied to clipboard

Property autocomplete does not show custom elements

Open lukasoppermann opened this issue 8 years ago • 7 comments

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.

  • https://github.com/atom-community/autocomplete-paths
  • https://atom.io/packages/autocomplete-semantic-web
  • https://atom.io/packages/language-nginx

lukasoppermann avatar Oct 24 '16 13:10 lukasoppermann

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.

rictic avatar Oct 24 '16 13:10 rictic

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:

  • <material-toggle**|**> + hit space: not working
  • backspace (delete space)
  • <material-toggle**|**> + hit space: not working
  • backspace (delete space)
  • <material-toggle**|**> + hit space: works
  • backspace (delete space)
  • <material-toggle**|**> + hit space: not working

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.

lukasoppermann avatar Oct 24 '16 13:10 lukasoppermann

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?

rictic avatar Oct 24 '16 13:10 rictic

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

lukasoppermann avatar Oct 24 '16 13:10 lukasoppermann

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.

lukasoppermann avatar Oct 24 '16 14:10 lukasoppermann

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.

rictic avatar Oct 24 '16 14:10 rictic

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

lukasoppermann avatar Oct 24 '16 14:10 lukasoppermann