strozw / github-actions-languageserver.nvim

MIT License
0 stars 0 forks source link

Uses completion does not work #1

Open Crashdummyy opened 3 months ago

Crashdummyy commented 3 months ago

HI there

thanks for maintaining this, I really appreciate the effort.

However it appears like part of the completion won't work for me. Essentially the input parameters of another action wont show.

vscode https://github.com/github/vscode-github-actions/blob/main/media/authoring.gif

Did I somehow just mess up ?

Here's my lazy configuration

  {
    "strozw/github-actions-languageserver.nvim",
    event = "User GhWorkflowFile",
    config = function()
      require("github-actions-languageserver").setup()

      local lspconfig = require("lspconfig")

      lspconfig.github_actions.setup({
          init_params = {
            sessionToken = "ghp_XXXXX",
            logLevel = 3 -- Debug: 0, Info: 1, Warn: 2, Error: 3, Default: nil
          }
      })
    end
  },

those apparently work image

But that ones empty image

My sysstem runs on node: v20.12.2 and nvim-lsp is already there. image

node /home/crashdummy/.npm/_npx/3743145adc2a05ba/node_modules/.bin/github-actions-languageserver --stdio

The log isn't helpful either.

changeNotifications = true,          supported = true        }      }    },    settings = <table 12>,    stop = <function 71>,    supports_method = <function 72>,    workspace_did_change_configuration = <function 73>,    workspace_folders = <table 13>,    <metatable> = <table 4>  }, {    _log_prefix = "LSP[github_actions]",    _on_attach_cbs = { <function 74> },    _on_exit_cbs = { <function 75>, <function 3> },    _on_init_cbs = { <function 76> },    _root_dir = "/home/crashdummy/coding/CMI/cmi-loadtests/.github/workflows",    _trace = "off",    attached_buffers = { true },    cancel_request = <function 77>,    capabilities = <15>{      general = {        positionEncodings = { "utf-16" }      },      textDocument = {        callHierarchy = {          dynamicRegistration = false        },        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }            }          },          dataSupport = true,          dynamicRegistration = true,          isPreferredSupport = true,          resolveSupport = {            properties = { "edit" }          }        },        completion = {          completionItem = {            commitCharactersSupport = false,            deprecatedSupport = false,            documentationFormat = { "markdown", "plaintext" },            preselectSupport = false,            snippetSupport = false          },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }          },          completionList = {            itemDefaults = { "editRange", "insertTextFormat", "insertTextMode", "data" }          },          contextSupport = false,          dynamicRegistration = false        },        declaration = {          linkSupport = true        },        definition = {          dynamicRegistration = true,          linkSupport = true        },        diagnostic = {          dynamicRegistration = false        },        documentHighlight = {          dynamicRegistration = false        },        documentSymbol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        formatting = {          dynamicRegistration = true        },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = true        },        implementation = {          linkSupport = true        },        inlayHint = {          dynamicRegistration = true,          resolveSupport = {            properties = { "textEdits", "tooltip", "location", "command" }          }        },        publishDiagnostics = {          dataSupport = true,          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 }          }        },        rangeFormatting = {          dynamicRegistration = true        },        references = {          dynamicRegistration = false        },        rename = {          dynamicRegistration = true,          prepareSupport = true        },        semanticTokens = {          augmentsSyntaxTokens = true,          dynamicRegistration = false,          formats = { "relative" },          multilineTokenSupport = false,          overlappingTokenSupport = true,          requests = {            full = {              delta = true            },            range = false          },          serverCancelSupport = false,          tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" },          tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" }        },        signatureHelp = {          dynamicRegistration = false,          signatureInformation = {            activeParameterSupport = true,            documentationFormat = { "markdown", "plaintext" },            parameterInformation = {              labelOffsetSupport = true            }          }        },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = true,          willSaveWaitUntil = true        },        typeDefinition = {          linkSupport = true        }      },      window = {        showDocument = {          support = true        },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false          }        },        workDoneProgress = true      },      workspace = {        applyEdit = true,        configuration = true,        didChangeConfiguration = {          dynamicRegistration = false        },        didChangeWatchedFiles = {          dynamicRegistration = false,          relativePatternSupport = true        },        inlayHint = {          refreshSupport = true        },        semanticTokens = {          refreshSupport = true        },        symbol = {          dynamicRegistration = false,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" }        },        workspaceFolders = true      }    },    commands = {},    config = {      autostart = true,      capabilities = <table 15>,      cmd = { "/usr/bin/npx", "@strozw/github-actions-languageserver@latest", "--stdio" },      cmd_cwd = "/home/crashdummy/coding/CMI/cmi-loadtests/.github/workflows",      filetypes = { "yaml", "yml" },      handlers = <table 11>,      init_options = {},      init_params = {        logLevel = 0,        sessionToken = "ghp_XXXXXXX"      },      log_level = 2,      message_level = 2,      name = "github_actions",      on_attach = <function 74>,      on_exit = <function 75>,      on_init = <function 76>,      root_dir = "/home/crashdummy/coding/CMI/cmi-loadtests/.github/workflows",      settings = <16>vim.empty_dict(),      workspace_folders = <17>{ {          name = "/home/crashdummy/coding/CMI/cmi-loadtests/.github/workflows",          uri = "file:///home/crashdummy/coding/CMI/cmi-loadtests/.github/workflows"        } },      <metatable> = <table 14>    },    dynamic_capabilities = {      capabilities = {        ["workspace/didChangeWorkspaceFolders"] = { {            id = "d9bf09d8-a000-440b-b7a7-7848b422683e",            method = "workspace/didChangeWorkspaceFolders",            registerOptions = vim.empty_dict()          } }      },      client_id = 3,      <metatable> = {        __index = <table 2>      }    },    flags = {},    get_language_id = <function 14>,    handlers = <table 11>,    id = 3,    initialized = true,    is_stopped = <function 78>,    messages = {      messages = {},      name = "github_actions",      progress = {},      status = {}    },    name = "github_actions",    notify = <function 79>,    offset_encoding = "utf-16",    on_attach = <function 80>,    progress = {      _idx_read = 0,      _idx_write = 0,      _items = {},      _size = 51,      pending = {},      <metatable> = {        __call = <function 81>,        __index = <table 3>      }    },    request = <function 82>,    request_sync = <function 83>,    requests = {},    root_dir = "/home/crashdummy/coding/CMI/cmi-loadtests/.github/workflows",    rpc = {      is_closing = <function 84>,      notify = <function 85>,      request = <function 86>,      terminate = <function 87>    },    server_capabilities = {      completionProvider = {        resolveProvider = false,        triggerCharacters = { ":", "." }      },      documentLinkProvider = {        resolveProvider = false      },      hoverProvider = true,      textDocumentSync = {        change = 1,        openClose = true,        save = {          includeText = false        },        willSave = false,        willSaveWaitUntil = false      },      workspace = {        workspaceFolders = {          supported = true        }      }    },    settings = <table 16>,    stop = <function 88>,    supports_method = <function 89>,    workspace_did_change_configuration = <function 90>,    workspace_folders = <table 17>,    <metatable> = <table 4>  } }

[DEBUG][2024-06-20 12:15:41] ...m/lsp/client.lua:676    "LSP[github_actions]"   "client.request"    3   "textDocument/completion"   {  context = {    triggerKind = 1  },  position = {    character = 10,    line = 20  },  textDocument = {    uri = "file:///home/crashdummy/coding/CMI/cmi-loadtests/.github/workflows/release.yml"  }} <function 1>    1
[DEBUG][2024-06-20 12:15:41] .../vim/lsp/rpc.lua:286    "rpc.send"  {  id = 2,  jsonrpc = "2.0",  method = "textDocument/completion",  params = {    context = {      triggerKind = 1    },    position = {      character = 10,      line = 20    },    textDocument = {      uri = "file:///home/crashdummy/coding/CMI/cmi-loadtests/.github/workflows/release.yml"    }  }}
[DEBUG][2024-06-20 12:15:41] .../vim/lsp/rpc.lua:408    "rpc.receive"   {  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///home/crashdummy/coding/CMI/cmi-loadtests/.github/workflows/release.yml"  }}
[DEBUG][2024-06-20 12:15:41] .../vim/lsp/rpc.lua:408    "rpc.receive"   {  id = 2,  jsonrpc = "2.0",  result = {}}
[DEBUG][2024-06-20 12:15:41] .../vim/lsp/rpc.lua:408    "rpc.receive"   {  id = 8,  jsonrpc = "2.0",  result = {    isIncomplete = false,    items = { {        documentation = "",        insertText = "args: ",        insertTextFormat = 2,        kind = 10,        label = "args",        textEdit = {          newText = "args: ",          range = {            ["end"] = {              character = 10,              line = 20            },            start = {              character = 10,              line = 20            }          }        }      }, {        documentation = "",        insertText = "entrypoint: ",        insertTextFormat = 2,        kind = 10,        label = "entrypoint",        textEdit = {          newText = "entrypoint: ",          range = {            ["end"] = {              character = 10,              line = 20            },            start = {              character = 10,              line = 20            }          }        }      } }  }}
[DEBUG][2024-06-20 12:15:41] .../vim/lsp/rpc.lua:286    "rpc.send"  {  jsonrpc = "2.0",  method = "$/cancelRequest",  params = {    id = 7  }}
strozw commented 5 days ago

@Crashdummyy

Thank you for pointing that out.

Sorry, I neglected to add a note to the README.

I haven't properly researched the values ​​to set in init_options yet, so as you said, auto-completion doesn't work for args in custom actions or env in the global scope.

I'll fix the confusing usage in README.md and add a note.