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

Neorg generate-workspace-summary causes an error #1624

Closed
2 tasks done
erezak opened this issue Dec 30, 2024 · 3 comments
Closed
2 tasks done

Neorg generate-workspace-summary causes an error #1624

erezak opened this issue Dec 30, 2024 · 3 comments
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@erezak
Copy link

erezak commented Dec 30, 2024

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

v0.10.2

Neorg setup

  1   {                                                                                                                                                                                                 
  2     "nvim-neorg/neorg",                                                                                                                                                                             
  3     opts = {                                                                                                                                                                                        
  4       load = {                                                                                                                                                                                      
  5         ["core.defaults"] = {},                                                                                                                                                                     
  6         -- ["core.dirman"] = {                                                                                                                                                                      
  7         --  config = {                                                                                                                                                                              
  8         --    workspaces = {                                                                                                                                                                        
  9         --      notes = "~/notes/general",                                                                                                                                                          
 10         --      aidev = "~/notes/aidev",                                                                                                                                                            
 11         --      example_gtd = "~/notes/gtd",                                                                                                                                                        
 12         --    },                                                                                                                                                                                    
 13         --    default_workspace = "notes",                                                                                                                                                          
 14         --  },                                                                                                                                                                                      
 15         -- },                                                                                                                                                                                       
 16         -- -- ["core.integrations.nvim-cmp"] = {},                                                                                                                                                  
 17         -- ["core.completion"] = {                                                                                                                                                                  
 18         --  config = {                                                                                                                                                                              
 19         --    engine = "nvim-cmp",                                                                                                                                                                  
 20         --  },                                                                                                                                                                                      
 21         -- },                                                                                                                                                                                       
 22         -- ["core.concealer"] = {                                                                                                                                                                   
 23         --  config = {                                                                                                                                                                              
 24         --    folds = false,                                                                                                                                                                        
 25         --  },                                                                                                                                                                                      
 26         -- },                                                                                                                                                                                       
 27         -- ["core.integrations.image"] = {},                                                                                                                                                        
 28         -- ["core.latex.renderer"] = {},                                                                                                                                                            
 29         -- ["core.export"] = {},                                                                                                                                                                    
 30         ["core.summary"] = {},                                                                                                                                                                      
 31       },                                                                                                                                                                                            
 32     },                                                                                                                                                                                              
 33   },                                                                                                                                                                                                

Actual behavior

Generated error when trying to generate summary:

image

Error executing Lua callback: vim/shared.lua:0: bad argument #1 to '?' (string expected, got table)
stack traceback:
    [builtin#81]: at 0x0105211810
    vim/shared.lua: in function 'tbl_map'
    ...vim/lazy/neorg/lua/neorg/modules/core/summary/module.lua:344: in function 'generate_workspace_summary'
    ...vim/lazy/neorg/lua/neorg/modules/core/summary/module.lua:366: in function 'on_event'
    .../local/share/nvim/lazy/neorg/lua/neorg/core/modules.lua:822: in function 'broadcast_event'
    ...im/lazy/neorg/lua/neorg/modules/core/neorgcmd/module.lua:301: in function <...im/lazy/neorg/lua/neorg/modules/core/neorgcmd/module.lua:206>

Expected behavior

A summary of the workspace should be inserted into the file

Steps to reproduce

:Neorg workspace notes
:Neorg generate-workspace-summary

Potentially conflicting plugins

No response

Other information

No response

Help

No

Implementation help

No response

@erezak erezak added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Dec 30, 2024
@github-project-automation github-project-automation bot moved this to added-updated-reopened in sorting neorg issue tracker Dec 30, 2024
@amalgame21

This comment has been minimized.

@OmegaLambda1998
Copy link
Contributor

Issue seems to be with this line, which epxects include_categories to be a list of strings. Just printing include_categories shows it is instead:

  data = {
    args = "generate-workspace-summary",
    bang = false,
    count = 2,
    fargs = { "generate-workspace-summary" },
    line1 = 19,
    line2 = 19,
    mods = "",
    name = "Neorg",
    range = 0,
    reg = "",
    smods = {
      browse = false,
      confirm = false,
      emsg_silent = false,
      hide = false,
      horizontal = false,
      keepalt = false,
      keepjumps = false,
      keepmarks = false,
      keeppatterns = false,
      lockmarks = false,
      noautocmd = false,
      noswapfile = false,
      sandbox = false,
      silent = false,
      split = "",
      tab = -1,
      unsilent = false,
      verbose = -1,
      vertical = false
    }
  }
}

as generated by the event.content object.

Should probably be {table.unpack(event.content.data.fargs, 2)} instead, I'll submit a PR

OmegaLambda1998 added a commit to OmegaLambda1998/neorg that referenced this issue Jan 15, 2025
OmegaLambda1998 added a commit to OmegaLambda1998/neorg that referenced this issue Jan 15, 2025
OmegaLambda1998 added a commit to OmegaLambda1998/neorg that referenced this issue Jan 15, 2025
@erezak
Copy link
Author

erezak commented Jan 21, 2025

Issue seems to be with this line, which epxects include_categories to be a list of strings. Just printing include_categories shows it is instead:
...
...
Should probably be {table.unpack(event.content.data.fargs, 2)} instead, I'll submit a PR

I'm not sure. When I print the table with categories, the strings are the first values, not the ones following the "data" table.

Maybe try another approach of only copying the strings to a new table.

erezak pushed a commit to erezak/neorg that referenced this issue Jan 21, 2025
erezak pushed a commit to erezak/neorg that referenced this issue Jan 21, 2025
erezak pushed a commit to erezak/neorg that referenced this issue Jan 21, 2025
@github-project-automation github-project-automation bot moved this from added-updated-reopened to done in sorting neorg issue tracker Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
Development

No branches or pull requests

3 participants