mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 09:44:31 +00:00 
			
		
		
		
	fix(treesitter): recognize aliased parsers in omnifunc, query linter
**Problem:** A query file for something like `html_tags` will not be given html node completion **Solution:** Check for parser aliases before offering completions Co-authored-by: Lewis Russell <me@lewisr.dev>
This commit is contained in:
		
				
					committed by
					
						
						Christian Clason
					
				
			
			
				
	
			
			
			
						parent
						
							c7b0334cea
						
					
				
				
					commit
					05dcda8f9b
				
			@@ -40,7 +40,8 @@ end
 | 
				
			|||||||
local function guess_query_lang(buf)
 | 
					local function guess_query_lang(buf)
 | 
				
			||||||
  local filename = api.nvim_buf_get_name(buf)
 | 
					  local filename = api.nvim_buf_get_name(buf)
 | 
				
			||||||
  if filename ~= '' then
 | 
					  if filename ~= '' then
 | 
				
			||||||
    return vim.F.npcall(vim.fn.fnamemodify, filename, ':p:h:t')
 | 
					    local resolved_filename = vim.F.npcall(vim.fn.fnamemodify, filename, ':p:h:t')
 | 
				
			||||||
 | 
					    return resolved_filename and vim.treesitter.language.get_lang(resolved_filename) or nil
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user