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

nvim-html-css doesn't load when used with nVim v0.10.0 #1

Closed
savchenko opened this issue Jun 9, 2024 · 2 comments
Closed

nvim-html-css doesn't load when used with nVim v0.10.0 #1

savchenko opened this issue Jun 9, 2024 · 2 comments

Comments

@savchenko
Copy link

savchenko commented Jun 9, 2024

EDIT

I think this is happening because the plugin loads prematurely. I can manually get user_config via Lua once cmp has loaded without any issues.

Adding nvim-cmp as the dependency of nvim-html-css makes it load successfully, but the cmp source is still unavailable:

# ready source names                                                                                                                                                                            
- async_path                                                                                                                                                                                    
- nvim_lsp:html                                                                                                                                                                                 
                                                                                                                                                                                                
# unavailable source names                                                                                                                                                                      
- html-css

ORIGINAL MESSAGE

Sorry for creating this in the wrong repo, but the "Issues" section is disabled at ESSO0428/nvim-html-css.

This check:

if not vim.tbl_contains(self.option.enable_on, vim.bo.filetype) then

Fails with:

Error executing vim.schedule lua callback: vim/shared.lua:0: t: expected table, got nil
stack traceback:                                                                                                                                                                                
        [C]: in function 'error'                                                                                                                                                                
        vim/shared.lua: in function 'validate'                                                                                                                                                  
        vim/shared.lua: in function 'tbl_contains'                                                                                                                                              
        ...ocal/share/nvim/lazy/nvim-html-css/lua/html-css/init.lua:327: in function ''                                                                                                         
        vim/_editor.lua: in function ''                                                                                                                                                         
        vim/_editor.lua: in function <vim/_editor.lua:0>

Plugin is installed with default settings, nvim-cmp source added. Here is the content of self at the time:

{                                                                                                                                                                                               
  after_inert_before_update = true,                                                                                                                                                             
  cached_local_css_data = {},                                                                                                                                                                   
  embedded = "",                                                                                                                                                                                
  enable_file_patterns = { "*.html" },                                                                                                                                                          
  enable_on = {},                                                                                                                                                                               
  file_extensions = {},                                                                                                                                                                         
  href_links = {},                                                                                                                                                                              
  ids = {},                                                                                                                                                                                     
  isRemote = "^https?://",                                                                                                                                                                      
  items = {},                                                                                                                                                                                   
  last_html_buffer = 2,                                                                                                                                                                         
  local_classes = {},                                                                                                                                                                           
  local_css_file_mod_times = {},                                                                                                                                                                
  local_file = "",                                                                                                                                                                              
  local_ids = {},                                                                                                                                                                               
  local_style_sheets = {},                                                                                                                                                                      
  option = {},                                                                                                                                                                                  
  remote = "",                                                                                                                                                                                  
  remote_classes = {},                                                                                                                                                                          
  remote_ids = {},                                                                                                                                                                              
  remote_item_write = "",                                                                                                                                                                       
  remote_style_sheets = {},                                                                                                                                                                     
  source_name = "html-css",                                                                                                                                                                     
  style_sheets = {},                                                                                                                                                                            
  update_done = "",                                                                                                                                                                             
  user_config = {},                                                                                                                                                                             
  <metatable> = {                                                                                                                                                                               
    __index = {                                                                                                                                                                                 
      complete = <function 1>,                                                                                                                                                                  
      is_available = <function 2>,                                                                                                                                                              
      new = <function 3>,                                                                                                                                                                       
      update_completion_data = <function 4>                                                                                                                                                     
    }                                                                                                                                                                                           
  }                                                                                                                                                                                             
}

...and the relevant snippet from cmp config:

{
    name = 'html-css',
    option = {
        enable_on = {
            "htmldjango",
            "html",
        },
        enable_file_patterns = { "*.html" },
        file_extensions = { "css" },
        style_sheets = {}
    }
}
@ESSO0428
Copy link
Owner

ESSO0428 commented Jun 10, 2024 via email

@ESSO0428
Copy link
Owner

Since I haven't received any further responses after my last reply, I'll go ahead and close this issue for now. If you have any additional questions or need further assistance, please feel free to reopen it. Thank you for your understanding and support!

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