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

Value Converter Capabilities #10

Open
hiaux0 opened this issue Nov 14, 2020 · 1 comment
Open

Value Converter Capabilities #10

hiaux0 opened this issue Nov 14, 2020 · 1 comment

Comments

@hiaux0
Copy link
Owner

hiaux0 commented Nov 14, 2020

What

Inside your view (.html file) inside a "value converter region" (indicated by |), have intellisense for value converters

Glossary

[VC] - Value Converter
[VCR] - Value Converter Region

Official Example

export class SortValueConverter {
  toView(array: string[], config: Config, solution: number) {
    // ...
  }
}
    <tr
                           [VCR1]
                         _v__
      if.bind="message | sort"
      repeat.for="repo of repos | sort:column.value:direction.value | take:10"
                                  _____________^____________________  __^___
                                                   [VCR2]              [VCR3]
    >
      ...
    </tr>

Capabilities

Completion

Complete all [VC]s
  • After a [VCR] starts (eg. after |), type au to get a list of all available [VC]s
GIF

au-lsp-completion

Complete [VC] toView arguments
  • After the name of a [VC] (eg. after the "t" in [VCR1] type ":" to get completions for arguments of toView
GIF

au-lsp-completion-1

Go to definition

  • Go to the file if "go to def." is triggered inside a [VCR]
GIF

au-lsp-completion-2

Limitations

  1. all [VC]s are provided
  2. not limited to [VC]s you imported inside the view
  3. not aware of global [VC]s, because completion is for all (see 1.)
  4. Does not work on chained value converters
    repo of repos | sort:column.value:direction.value | take:10

Future

  • Intellisense for value converter arguments of current view (ie. complete view Model variables for VC)
    Eg.
  1. Argument completion are config and solution
  2. If tab to config get completion of the current view/viewModel

image

  • Diagnosis
@bigopon
Copy link

bigopon commented Nov 15, 2020

That go to definition is really cool 👍 nice progress

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

2 participants