sg.nvim icon indicating copy to clipboard operation
sg.nvim copied to clipboard

:e <sourcegraph URL> not working

Open julienTraversier opened this issue 1 year ago • 1 comments

:e <sourcegraph URL> doesn't work,

in lsp log :

[sg-nvim-agent] failed to read message data did not match any variant of untagged enum Message\n" ["stderr" 'Recieved a message: Request { id: 2, data: SourcegraphRemoteURL { path: "/home/toto/workspaces/project/" } }\nDATA : SourcegraphRemoteURL { path: "/home/jtraversier/workspaces/project/" }\n' [ERROR][2024-06-27 16:09:22] .../vim/lsp/rpc.lua:770 "rpc" "node" "stderr" '{"stack":"Error: Timeout\\n at Timeout._onTimeout (/home/toto/.local/share/nvim/lazy/sg.nvim/dist/cody-agent.js:277769:20)\\n at listOnTimeout (node:internal/timers:569:17)\\n at process.processTimers

the command open a doctype html file (probably the request ?)

sg: require("sg.health").check()

sg.nvim report ~

  • Machine: x86_64, sysname: Linux
  • OK Valid nvim version: 0.10.0-dev+g27fb62988
  • OK Found cargo (cargo 1.75.0 (1d8b05cdd 2023-11-20)) is executable
  • Use `:SourcegraphDownloadBinaries` to avoid building locally.
    
  • OK Found sg-nvim-agent: "/home/toto/.local/share/nvim/lazy/sg.nvim/dist/sg-nvim-agent"
  • OK Found node (config.node_executable) is executable. Version: '18.19.0'
  • OK Found cody-agent: /home/toto/.local/share/nvim/lazy/sg.nvim/dist/cody-agent.js
  • OK Authentication setup correctly
  • OK endpoint set to: https://viavi.sourcegraphcloud.com
  • OK Found correct binary versions: "1.1.0" = "1.1.0"
  • OK Sourcegraph Connection info: { access_token_set = true, endpoint = "https://enterprise.sourcegraphcloud.com", sg_nvim_version = "1.1.0", sourcegraph_version = { build = "5.4.7765", product = "5.4.7765" } }
  • To manage your Cody Account, navigate to: https://sourcegraph.com/cody/manage
  • OK Cody Account Information: { cody_pro_enabled = false, username = "toto" }
  • OK sg.nvim is ready to run

Also i'm using sourcegraph entreprise trial.

Thanks for help

julienTraversier avatar Jun 27 '24 14:06 julienTraversier

in sg.lua

vim.api.nvim_create_autocmd("BufReadCmd", {
  group = vim.api.nvim_create_augroup("sourcegraph-bufread", { clear = true }),
  pattern = { "sg://*", "https://sourcegraphcloud.com/*" },
  callback = function(event)
    bufread.edit(
      event.buf or vim.api.nvim_get_current_buf(),
      vim.fn.expand "<amatch>" --[[@as string]]
    )
  end,
  desc = "Sourcegraph link and protocol handler",
})

The pattern should match the endpoint because in my case it has a prefix with the name of my enterprise

julienTraversier avatar Oct 02 '24 06:10 julienTraversier