forked from sourcegraph/sg.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
39 lines (33 loc) · 1.12 KB
/
Copy pathinit.lua
File metadata and controls
39 lines (33 loc) · 1.12 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
---@tag sg.nvim
---@config { ["name"] = "INTRODUCTION" }
---@brief [[
--- sg.nvim is a plugin for interfacing with Sourcegraph and Cody
---
--- To login, either:
---
--- - Run `:SourcegraphLogin` after following installation instructions for `sourcegraph.com` usage.
--- - Run `:SourcegraphLogin!` and provide an endpoint and access token to be stored.
--- - Use the `SRC_ENDPOINT` and `SRC_ACCESS_TOKEN` environment variables to manage tokens for enterprise usage.
--- - See [src-cli](https://github.com/sourcegraph/src-cli#log-into-your-sourcegraph-instance) for more info
---
--- See `:help sg.auth` for more information.
---
--- You can check that you're logged in by then running `:checkhealth sg`
---@brief ]]
local M = {}
--- Setup sourcegraph
---@param opts sg.config
M.setup = function(opts)
opts = opts or {}
local config = require "sg.config"
for key, value in pairs(opts) do
if config[key] ~= nil then
config[key] = value
end
end
require("sg.lsp").setup()
require("sg.request").start()
require("sg.cody.plugin.agent").setup(config)
require("sg.cody.plugin.commands").setup(config)
end
return M