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

Module 'neogen.types.template' not found #160

Open
Demianeen opened this issue Dec 18, 2023 · 0 comments
Open

Module 'neogen.types.template' not found #160

Demianeen opened this issue Dec 18, 2023 · 0 comments

Comments

@Demianeen
Copy link

Hi everyone!

I try to customize tsdoc that it would wort for interface properties as well.

Description

As for now I have created a tsdoc function:

local tsdoc = function()
  local i = require('neogen.types.template').item

  return {
    { nil, '/** $1 */', { no_results = true, type = { 'func', 'class' } } },
    { nil, '/** @type $1 */', { no_results = true, type = { 'type' } } },

    { nil, '/**', { no_results = true, type = { 'file' } } },
    { nil, ' * @module $1', { no_results = true, type = { 'file' } } },
    { nil, ' */', { no_results = true, type = { 'file' } } },

    { nil, '/**', { type = { 'class', 'func' } } },
    { i.ClassName, ' * $1', { type = { 'class' } } },
    { i.Type, ' * @template %s - $1', { type = { 'func' } } },
    { i.Parameter, ' * @param %s - $1', { type = { 'func' } } },
    {
      { i.Parameter },
      ' * @param %s - $1',
      { required = i.Tparam, type = { 'func' } },
    },
    { i.Return, ' * @returns $1', { type = { 'func' } } },
    { nil, ' */', { type = { 'class', 'func' } } },
    { i.InterfaceProperty, ' * @property %s - $1', { type = { 'interface' } } },
  }
end

And added it to my config. But now, every time I open nvim I get:

   Error  10:05:53 notify.error lazy.nvim Failed to load `plugins.neogen`

/Users/demian/.config/nvim/lua/plugins/neogen.lua:2: module 'neogen.types.template' not found:
	no field package.preload['neogen.types.template']
cache_loader: module neogen.types.template not found
cache_loader_lib: module neogen.types.template not found
	no file './neogen/types/template.lua'
	no file '/opt/homebrew/share/luajit-2.1/neogen/types/template.lua'
	no file '/usr/local/share/lua/5.1/neogen/types/template.lua'
	no file '/usr/local/share/lua/5.1/neogen/types/template/init.lua'
	no file '/opt/homebrew/share/lua/5.1/neogen/types/template.lua'
	no file '/opt/homebrew/share/lua/5.1/neogen/types/template/init.lua'
	no file './neogen/types/template.so'
	no file '/usr/local/lib/lua/5.1/neogen/types/template.so'
	no file '/opt/homebrew/lib/lua/5.1/neogen/types/template.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
	no file './neogen.so'
	no file '/usr/local/lib/lua/5.1/neogen.so'
	no file '/opt/homebrew/lib/lua/5.1/neogen.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'

# stacktrace:
  - lua/plugins/neogen.lua:2 _in_ **tsdoc**
  - lua/plugins/neogen.lua:47
  - lua/config/lazy.lua:10
  - init.lua:2

Expected behaviour

Requiring neogen.types.template wouldn't give an error.

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

1 participant