Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag expansion prompt showing unexpectedly #203

Open
taylorotwell opened this issue Jul 16, 2023 · 8 comments
Open

Tag expansion prompt showing unexpectedly #203

taylorotwell opened this issue Jul 16, 2023 · 8 comments

Comments

@taylorotwell
Copy link
Contributor

Sometimes when closing an HTML tag, I am prompted for tax expansion unexpectedly. This does not happen on Sublime's HTML syntax - only when using the HTML (Blade) syntax. It seems related to putting colons in attributes and then closing the tag.

Any help solving this extremely appreciated.

Below is a minimal HTML snippet to reproduce the problem.

CleanShot 2023-07-16 at 13 57 48@2x
@Medalink
Copy link
Owner

@deathaxe do you have any thoughts on why this is happening and how to prevent it?

@deathaxe
Copy link
Contributor

The only special thing of this package is a syntax specific auto_completion_selector, which intents to enable autocompletions within template tags. It would require a nonwhitespace character to be typed, to open the panel.

see:

"auto_complete_selector": "( meta.tag | meta.embedded.directive ) - comment",

  1. What ST version is it?
  2. What's the output of
    • view.settings().get("auto_complete_selector")
    • view.settings().get("auto_complete_triggers")
  3. Is any language server involved?
  4. Any other completion plugins?

Is completion panel directly opened by typing >? Maybe > was added to auto_complete_triggers by a plugin (or user customization)? I am aware of LSP manipulating view-specific auto_complete_triggers setting based on what it gets from a language servers.

I get this state only by hitting ctrl+space after the tag.

@taylorotwell
Copy link
Contributor Author

taylorotwell commented Jul 24, 2023

@deathaxe

  1. Build 4143

CleanShot 2023-07-24 at 10 34 29@2x
  1. No LSP.

  2. Other maybe relevant plugins I have installed: ECMAScript Syntax, PHP Companion, Vue Syntax Highlight

@deathaxe
Copy link
Contributor

Did you set syntax to "HTML (Blade)" before calling view.settings().get(...)?

I'd expect

>>> view.settings().get("auto_complete_selector")
'( meta.tag | meta.embedded.directive ) - comment'

>>> view.settings().get("auto_complete_triggers")
[{'characters': '<', 'selector': 'text.html, text.xml'}, {'rhs_empty': True, 'selector': 'punctuation.accessor'}]

Listed syntaxes seem unrelated. Their code doesn't contain hints and I can't reproduce the issue, if they are installed.

You could try to log commands, to see whether anything is triggering auto_complete command when closing tags.

>>> sublime.log_commands()

Trying that I've not seen any command when typing >.

@taylorotwell
Copy link
Contributor Author

Sorry, my settings match yours - forgot I had modified them trying to resolve the issue.

Logging commands doesn't show any commands being fired when the auto-complete window shows up.

So weird. 🙃

@deathaxe
Copy link
Contributor

Indeed.

Blade is just inherits from ST's PHP and HTML re-using most syntax stuff and the html completion plugin. It extends core syntaxes in the same way as Vue and other packages.

Did you try to setup a completely vanilla ST with only Blade installed? Does it happen then, too?

@taylorotwell
Copy link
Contributor Author

taylorotwell commented Jul 24, 2023

I have been able to narrow it down to something within Livewire 3's legacy_tests/Browser directory. When that directory is removed it does not happen. It also does not happen if I tell Sublime to not index "vendor" files (this file I mentioned is in my vendor directory).

Does the Blade plugin attempt to do anything intelligent based on the Blade declarations / components in other files in the application?

@deathaxe
Copy link
Contributor

This package provide plain syntax definitions and a handful of completions. There's no plugin or any other kind of black magic provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants