spgennard / vscode_cobol

Visual Studio Code Extension for COBOL, JCL and MF Directive Files
MIT License
37 stars 16 forks source link

Update cobol.json: Minimum mainframe program [uppercase] snippet. #324

Closed dastagg closed 1 year ago

dastagg commented 1 year ago

When running "Minimum mainframe program [uppercase] snippet, got the following error:

E5108: Error executing lua ...ker/start/LuaSnip/lua/luasnip/util/parser/ast_parser.lua:339: cannot represent snippet: contains circular dependencies                        
stack traceback:                                                                                                                                                            
        [C]: in function 'assert'                                                                                                                                           
        ...ker/start/LuaSnip/lua/luasnip/util/parser/ast_parser.lua:339: in function 'to_luasnip_nodes'                                                                     
        ...ck/packer/start/LuaSnip/lua/luasnip/util/parser/init.lua:51: in function 'parse_fn'                                                                              
        .../packer/start/LuaSnip/lua/luasnip/nodes/snippetProxy.lua:33: in function 'instantiate'                                                                           
        .../packer/start/LuaSnip/lua/luasnip/nodes/snippetProxy.lua:86: in function '__index'                                                                               
        .../packer/start/LuaSnip/lua/luasnip/nodes/snippetProxy.lua:99: in function 'copy'                                                                                  
        ...rvim/site/pack/packer/start/LuaSnip/lua/luasnip/init.lua:187: in function 'snip_expand'                                                                          
        ...e/pack/packer/start/cmp_luasnip/lua/cmp_luasnip/init.lua:143: in function 'execute'                                                                              
        ...arvim/site/pack/packer/start/nvim-cmp/lua/cmp/source.lua:378: in function 'execute'                                                                              
        ...narvim/site/pack/packer/start/nvim-cmp/lua/cmp/entry.lua:472: in function 'execute'                                                                              
        ...unarvim/site/pack/packer/start/nvim-cmp/lua/cmp/core.lua:467: in function <...unarvim/site/pack/packer/start/nvim-cmp/lua/cmp/core.lua:466>                      
        ...te/pack/packer/start/nvim-cmp/lua/cmp/utils/feedkeys.lua:47: in function <...te/pack/packer/start/nvim-cmp/lua/cmp/utils/feedkeys.lua:45>

Changed this to match the same string for PROGRAM-ID in other snippets.

spgennard commented 1 year ago

Can you explain why you think it is a problem as it seems fine to me:

image

dastagg commented 1 year ago

Something is off. In the fork that I just did yesterday and the code that was installed by Packer the snippet looks like:

"Minimum mainframe program [uppercase]": {
        "prefix": "IDENTIFICATION",
        "body": [
            "       IDENTIFICATION DIVISION.",
            "       PROGRAM-ID. ${1:${1:${TM_FILENAME/(.*)\\..+$/$1/}}}.",
            "       AUTHOR. $2.",

But in the code that I see in your repo, it looks like:

"Minimum mainframe program [uppercase]": {
        "prefix": "IDENTIFICATION",
        "body": [
            "       IDENTIFICATION DIVISION.",
            "       PROGRAM-ID. ${1:${TM_FILENAME/(.*)\\..+$/$1/}}.",
            "       AUTHOR. $2.",

Note the extra {1:$ I'm not sure where that extra parameter is coming from. But that extra parameter is causing the error that I posted above.

So the patch would make your code "look like your code"???

I guess hold off on the merge for now. I will delete my fork , fork the repo again and see what the code looks like.

dastagg commented 1 year ago

Actually, I see you already changed it with b222f1a. So, go ahead and delete this PR and I will do a Packer update and see if it pulls it down.