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

Trigger expansion on Tab #1

Closed
olrtg opened this issue Dec 24, 2023 · 6 comments
Closed

Trigger expansion on Tab #1

olrtg opened this issue Dec 24, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@olrtg
Copy link
Owner

olrtg commented Dec 24, 2023

Moving here olrtg/emmet-language-server#28.

@kola-web we can continue here if you want.

@olrtg olrtg added the enhancement New feature or request label Dec 24, 2023
@kola-web
Copy link

Very happily

@kola-web
Copy link

image
This idea of ​​mine was generated by this option of vscode

@kola-web
Copy link

kola-web commented Dec 29, 2023

@olrtg I found a way to configure it based on the existing
example:

      ['<tab>'] = cmp.mapping(function(fallback)
        if cmp.visible() then
          cmp.mapping.confirm({ select = true })()
        elseif has_words_before() then
          cmp.mapping.complete({
            config = {
              sources = {
                {
                  name = 'nvim_lsp',
                  entry_filter = function(entry)
                    return entry.source:get_debug_name() == 'nvim_lsp:emmet_language_server'
                  end,
                },
              },
            },
          })()
          cmp.mapping.confirm({ select = true })()
        else
          fallback()
        end
      end),

But sadly emmet_language_server non-standard HTML tags (e.g. custom view tags) are not supported

@olrtg
Copy link
Owner Author

olrtg commented Dec 29, 2023

Hey @kola-web! Yeah that's a problem even in vscode too.. What I was thinking is maybe you can just wrap everything that you're typing inside of a tag (for example asdf should produce <asdf></asdf>) without using the language server. I assume vscode does something similar because remember that this language server is just a wrapper of vscode-emmet-helper, so what I mean is that this language server doesn't have control over the completion logic.

And we can't really offer completion for whatever since it'll pollute the cmp results. See aca/emmet-ls#55.

@kola-web
Copy link

kola-web commented Jan 2, 2024

Got it, thank you for your answer

@olrtg
Copy link
Owner Author

olrtg commented Jan 2, 2024

No worries! If you have some implementation maybe you can hang it out here for other people that may need this feature. I'm currently using vim-surround to wrap with tags.

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

No branches or pull requests

2 participants