Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Unknown function: dist#ft# FTVB #91

Open
shaeinst opened this issue Aug 25, 2022 · 8 comments · May be fixed by #93
Open

Unknown function: dist#ft# FTVB #91

shaeinst opened this issue Aug 25, 2022 · 8 comments · May be fixed by #93

Comments

@shaeinst
Copy link

i am getting this error on opening .bas file

full error

               Error detected while processing BufNewFile Autocommands for "*":                                                       
E5108: Error executing lua ...r/start/filetype.nvim/lua/filetype/mappings/function.lua:256: Vim(call):E117: Unknown function: dist#ft#
FTVB                                                                                                                                  
stack traceback:                                                                                                                      
        [C]: in function 'cmd'                                                                                                        
        ...r/start/filetype.nvim/lua/filetype/mappings/function.lua:256: in function 'name'                                           
        ...te/pack/packer/start/filetype.nvim/lua/filetype/init.lua:17: in function 'set_filetype'                                    
        ...te/pack/packer/start/filetype.nvim/lua/filetype/init.lua:65: in function 'try_lookup'                                      
        ...te/pack/packer/start/filetype.nvim/lua/filetype/init.lua:168: in function 'resolve'                                        
        [string ":lua"]:1: in main chunk  
@Penaz91
Copy link

Penaz91 commented Oct 24, 2022

I've been having the same issue, this may be a rough workaround but I managed to avoid this error by using the following configuration:

local filetype_ok, filetype = pcall(require, "filetype")
if not filetype_ok then
    vim.api.nvim_command([[echoerr "Error while loading filetype.nvim"]])
	return
end

filetype.setup({
    overrides = {
        extensions = {
            bas = "basic"
        }
    }
})

-- Do not source the default filetype.vim
vim.g.did_load_filetypes = 1

@jmiln
Copy link

jmiln commented Nov 28, 2022

I was just coming to report the same error, since I finally took the time to figure out what was breaking.

I was able to open javascript files just fine, but typescript or .sh files were where I was getting the errors.

I did try the solution suggested by @Penaz91, and I'm not getting errors for *.ts files anymore, but I am still getting them for *.sh files

@Xevnar
Copy link

Xevnar commented Nov 29, 2022

Neovim removed the flie that defined these functions in neovim/neovim@042eb74. The plugin should be updated to use the new filetype detection functions.

@Philwi
Copy link

Philwi commented Nov 30, 2022

I've got the same issue since a couple of weeks.

I've been having the same issue, this may be a rough workaround but I managed to avoid this error by using the following configuration:

local filetype_ok, filetype = pcall(require, "filetype")
if not filetype_ok then
    vim.api.nvim_command([[echoerr "Error while loading filetype.nvim"]])
	return
end

filetype.setup({
    overrides = {
        extensions = {
            bas = "basic"
        }
    }
})

-- Do not source the default filetype.vim
vim.g.did_load_filetypes = 1

Is only to get rid of the error but does not solve any highlighting or code completion issues.

@tekpriest
Copy link

I've got the same issue since a couple of weeks.

I've been having the same issue, this may be a rough workaround but I managed to avoid this error by using the following configuration:

local filetype_ok, filetype = pcall(require, "filetype")
if not filetype_ok then
    vim.api.nvim_command([[echoerr "Error while loading filetype.nvim"]])
	return
end

filetype.setup({
    overrides = {
        extensions = {
            bas = "basic"
        }
    }
})

-- Do not source the default filetype.vim
vim.g.did_load_filetypes = 1

Is only to get rid of the error but does not solve any highlighting or code completion issues.

especially if you pair it with auto-session plugin, you get error everytime it tries to restore session

@tmvfb
Copy link

tmvfb commented Mar 3, 2023

I get the same issue trying to open .html files. I found a temporary solution to add line:

["html"] = "html", 

to mappings/extensions.lua file.

This seem to work with other currently broken extensions as well. Highlighting and autocompletion works for me.

This is probably just the same answer as above, I'm not very into lua.

@Penaz91
Copy link

Penaz91 commented Mar 3, 2023

FWIW, newer versions of nvim have their own "filetype lua script" integrated which can be activated as follows:

vim.g.do_filetype_lua = true
vim.g.did_load_filetypes = false

You can see more here: https://neovim.discourse.group/t/introducing-filetype-lua-and-a-call-for-help/1806

@seandewar
Copy link

Adding to @Penaz91's comment, if you're using Nvim v0.8+, filetype.lua is already enabled by default, so there is no need to add the suggested lines to your configuration.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants