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

Autocomplete not working

Open JWhiteUX opened this issue 9 years ago • 15 comments

I'm new to Fuse and UXML. I've installed the Fuse package, and removed the fuze-language package per instructions from Fuse. Autocomplete does not want to work even after a restart.

Am I missing something? Is fuse autocomplete like emmet autocomplete?

JWhiteUX avatar Mar 01 '16 19:03 JWhiteUX

Hi, are you on Windows or OS X? Which version of Fuse are you running?

Also, are you able to run Fuse aside from this problem? Can you for instance start preview of your apps?

knatten avatar Mar 02 '16 09:03 knatten

Really sorry about that. I should know better than just to fire of an issue without the details.

OSX 10.10.5 Latest version of Atom (1.5.3) Latest version of Fuse (0.9.11) I am able to run preview Latest version of the Atom Package XML support installed Uninstalled fuse-language package

Auto suggest seems to work, though it doesn't auto close tags. Steps to replicate:

  1. Type: <DockPanel>
  2. Press Return
  3. new line with indent returned
  4. manually type closing tag </DockPanel>

Step four is driving me nuts. Is this a feature of the fuze package, or is this a setting in Atom that I have disabled?

Thanks for your help.

JWhiteUX avatar Mar 02 '16 18:03 JWhiteUX

@JWhiteUX, this is the default behavior in Atom. I will recommend you to install https://atom.io/packages/autoclose-html

Just set "Additional Grammars" to include UX in the settings of Autoclose-html package

Tapped avatar Mar 03 '16 11:03 Tapped

image

Tapped avatar Mar 03 '16 11:03 Tapped

Thanks for getting back to me. I've installed atutoclose-html and, checked the autoclose-html settings for "Additional Grammars" and I'm not seeing it. screenshot 2016-03-03 14 20 09

JWhiteUX avatar Mar 03 '16 22:03 JWhiteUX

Oh, I see. Looks like it was removed in one of the latest versions :( (https://github.com/mattberkowitz/autoclose-html/commit/73cdb1292978c3b491ef5adc24bb108001aebce3). I gonna see what I can do about that. I will update you, when I know more

Tapped avatar Mar 04 '16 15:03 Tapped

Temporary Workarund

  1. Run apm uninstall autoclose-html. Skip this step if you already have uninstalled autoclose-html
  2. Run apm install [email protected]
  3. Set grammar language to UX as I mentioned above
  4. Restart atom

Sorry, for all the trouble

Tapped avatar Mar 04 '16 15:03 Tapped

Thanks for your help, Tapped. Seems to be working now. Cheers!

JWhiteUX avatar Mar 07 '16 21:03 JWhiteUX

Good, it worked out :) I am not gonna close this ticket just yet. I have been in contact with the developer behind autoclose-html, to get some suggestions to how to integrate our package properly. I may have a fix that we can add, where autoclose-html will automatically work with UX.

Tapped avatar Mar 07 '16 22:03 Tapped

Hi Tapped,

Did you ever get this worked out with the developer behind autoclose-html? Or, should I install 0.21.0?

mgleason avatar Aug 31 '16 23:08 mgleason

Hi, wasn't able to get it working properly on none-US keyboards, because of a bug in Atom. The author made a legacy workaround: https://github.com/mattberkowitz/autoclose-html/issues/128 However that workaround doesn't support custom grammars.

But adding this to your keymap should work for US keyboards.

'atom-text-editor[data-grammar~="ux"]':
  '>': 'autoclose-html:close-and-complete'

You may use a different shortcut if you have a none-US keyboard eg. (shift - c)

'atom-text-editor[data-grammar~="ux"]':
  'shift-c': 'autoclose-html:close-and-complete'

Tapped avatar Sep 01 '16 09:09 Tapped

Thanks Tapped - that was easy!

On a US Keyboard on OS X/Mac, on Atom 1.10.1 (or 1.10.2), simply choose:

  1. Click the Atom menu then Preferences.

  2. Click Keybindings.

  3. Click the blue-highlighted text which says: your keycap file.

    (It's under the "Keybindings" title, at the end of the sentence which says "You can override these keybindings by copying and pasting them into your keycap file").

  4. Paste in Tapped's keymap:

    'atom-text-editor[data-grammar~="ux"]': '>': 'autoclose-html:close-and-complete'

mgleason avatar Sep 08 '16 19:09 mgleason

Thanks for keeping this issue open, was really helpful to get this working. The keybinding didn't work for me as it simply replaced the closing tag but just installing [email protected] and adding "UX" to additional grammars worked.

Not sure if this is related, but doesn't this package also support code completion in UX? Don't seem to have that working, assuming that means this type of thing, like in the examples which run on sublime text:

screen shot 2016-09-13 at 10 39 20 am

alubling avatar Sep 13 '16 14:09 alubling

Hi,

I can see that this is still open, I have another autocomplete problem, it seems that autocomplete works for attributes but not to start a tag, for example, I can start typing <Stac to create <StackPanel>, and nothing shows up, but once I finished typing <StackPanel it shows up the attribute list.

I don't think this is the intended behavior as I have seen it work somewhere else, any advice? Thanks!

allochi avatar May 07 '17 13:05 allochi

Hi,

First I'm sorry, I should have mentioned that I'm using atom 1.16 on MacOS Sierra.

As an update, I think it's a bug. Basically if I type anything inside <App></App> it doesn't start the autocomplete, but if I add a container tag like <StackPanel>, the autocomplete does work inside of that.

<App>
   # autocomplete doesn't work #
</App>
<App>
	<StackPanel>
		   # autocomplete works #
	</StackPanel>
	# autocomplete doesn't work #
</App>

I hope that this get fixed sometime. Thanks!

allochi avatar May 07 '17 14:05 allochi