Module: Jade::LSP::Snippets

Defined in:
lib/jade/lsp/snippets.rb

Defined Under Namespace

Classes: Snippet

Constant Summary collapse

ALL =
[
  Snippet.new(
    label: 'def',
    detail: 'function declaration',
    body: <<~SNIP.chomp,
  ),
  Snippet.new(
    label: 'type',
    detail: 'union type',
    body: <<~SNIP.chomp,
  ),
  Snippet.new(
    label: 'struct',
    detail: 'struct declaration',
    body: <<~SNIP.chomp,
  ),
  Snippet.new(
    label: 'case',
    detail: 'case expression with else fallback',
    body: <<~SNIP.chomp,
  ),
  Snippet.new(
    label: 'if',
    detail: 'if/then/else block',
    body: <<~SNIP.chomp,
  ),
  Snippet.new(
    label: 'module',
    detail: 'module header',
    body: 'module ${1:Name} exposing (${0})',
  ),
  Snippet.new(
    label: 'import',
    detail: 'import declaration',
    body: 'import ${1:Module} exposing (${0:Name})',
  ),
  Snippet.new(
    label: 'interface',
    detail: 'interface declaration',
    body: <<~SNIP.chomp,
  ),
  Snippet.new(
    label: 'implements',
    detail: 'interface implementation',
    body: <<~SNIP.chomp,
  ),
  Snippet.new(
    label: 'uses',
    detail: 'interop import',
    body: <<~SNIP.chomp,
  ),
  Snippet.new(
    label: 'lambda',
    detail: 'anonymous function',
    body: '(${1:args}) -> { ${0:body} }',
  ),
].freeze