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

fix: remove multi-character triggerCharacters, yielded block completion #418

Conversation

camerondubas
Copy link

VSCode doesn't seem to support mutli-character triggerCharacters (relevant issue microsoft/language-server-protocol#138), so currently the ::, {{, and this. characters don't do anything. Instead, it's preferable to use the last character in the sequence as the trigger. I also added # to support Handlebars blocks like #each.

Fixes:

  • Completions are triggered immediately after {{ is typed, rather than after another character is pressed.
  • Completions for Handlebars blocks (#each) and block curly components ({{#foo}}) add closing tags automatically
  • Completions for yielded blocks (<:) work.
  • Completions for < now include relevant yielded blocks in addition to components.

I believe this closes #388

Before: After:
els-before-trigger-character-work.mp4
els-after-trigger-character-work.mp4

VSCode ignores these as they should be single characters only
Due to trigger characters being limited to a single character
the completion request is triggered when `<` is typed.
At that point both AngleBracketComponents and yielded blocks are relevant.
@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (4635e71) 72.84% compared to head (15d327b) 72.92%.
Report is 2 commits behind head on component-context-info-origin.

Additional details and impacted files
@@                        Coverage Diff                        @@
##           component-context-info-origin     #418      +/-   ##
=================================================================
+ Coverage                          72.84%   72.92%   +0.08%     
=================================================================
  Files                                 57       57              
  Lines                               4967     4968       +1     
  Branches                             979      979              
=================================================================
+ Hits                                3618     3623       +5     
+ Misses                              1349     1345       -4     
Files Coverage Δ
...uiltin-addons/core/template-completion-provider.ts 93.71% <100.00%> (+0.51%) ⬆️
src/server.ts 64.15% <ø> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lifeart lifeart merged commit 467ab0d into lifeart:component-context-info-origin Oct 4, 2023
9 checks passed
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

Successfully merging this pull request may close these issues.

Auto-closing {{#if}}, {{#let}}, {{#each}}, etc.
2 participants