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: take snippet template from config #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SteveRusin
Copy link

@SteveRusin SteveRusin commented Sep 3, 2024

🤔 What's changed?

Fix: Take snippetTemplates property from user's lsp config

I have following lsp configuration for cucumber_language_server, however snippetTemplates is ignored. I need to change the template to use regular function instead of arrow one

    lspconfig['cucumber_language_server'].setup({
      capabilities = capabilities,
      on_attach = on_attach,
      cmd = { "fnm", "exec", "--using=18", "node", vim.fn.stdpath('data') .. "/mason/bin/cucumber-language-server", "--stdio" },
      root_dir = require("lspconfig").util.find_git_ancestor,
      settings = {
        cucumber = {
          features = { "**/*.feature" },
          glue = { "**/*.steps.ts" },
          parameterTypes = {},
          snippetTemplates = {
            tsx = string.gsub([[

              {{ keyword }}('{{ expression }}', function ({{ #parameters }}{{ #seenParameter }}, {{ /seenParameter }}{{ name }}{{ /parameters }}) {
                // {{ blurb }}
              })
            ]], "\n%s+", "\n")
          }
        },
      }
    })

⚡️ What's your motivation?

It fixes the bug when user of the service cannot specify custom snippetTemplates option

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

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.

1 participant