-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use cody-agent as the backend (#30)
- create build/init.lua for building the project - use jsonrpc for communication (cody-agent and sg-nvim-agent) - add doc/sg.txt - add tos - vendor lsp rpc client and vim system (can remove when 0.10 support only) - addditional tests for sg-cody, sg-agent - vendor telescope debounce - add :SourcegraphBuild
- Loading branch information
Showing
96 changed files
with
4,490 additions
and
1,239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/cody-agent.js binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Generate docs | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
|
||
jobs: | ||
build-sources: | ||
name: Generate docs | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-22.04 | ||
url: https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: date +%F > todays-date | ||
- name: Restore cache for today's nightly. | ||
uses: actions/cache@v3 | ||
with: | ||
path: _neovim | ||
key: ${{ runner.os }}-${{ matrix.url }}-${{ hashFiles('todays-date') }} | ||
|
||
- name: Cache rust items | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.rustup/ | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Prepare | ||
run: | | ||
test -d _neovim || { | ||
mkdir -p _neovim | ||
curl -sL ${{ matrix.url }} | tar xzf - --strip-components=1 -C "${PWD}/_neovim" | ||
} | ||
mkdir -p ~/.local/share/nvim/site/pack/vendor/start | ||
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim | ||
git clone https://github.com/tjdevries/tree-sitter-lua ~/.local/share/nvim/site/pack/vendor/start/tree-sitter-lua | ||
ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start | ||
- name: Run build scripts | ||
run: | | ||
export PATH="${PWD}/_neovim/bin:${PATH}" | ||
export VIM="${PWD}/_neovim/share/nvim/runtime" | ||
nvim -l build/init.lua | ||
- name: Build parser | ||
run: | | ||
# We have to build the parser every single time to keep up with parser changes | ||
cd ~/.local/share/nvim/site/pack/vendor/start/tree-sitter-lua | ||
make dist | ||
cd - | ||
- name: Generating docs | ||
run: | | ||
export PATH="${PWD}/_neovim/bin:${PATH}" | ||
export VIM="${PWD}/_neovim/share/nvim/runtime" | ||
nvim --version | ||
nvim -l scripts/gendocs.lua | ||
# inspired by nvim-lspconfigs | ||
- name: Update documentation | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COMMIT_MSG: | | ||
[docgen] Update doc/sg.txt | ||
skip-checks: true | ||
run: | | ||
git config user.email "actions@github" | ||
git config user.name "Github Actions" | ||
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | ||
git add doc/ | ||
# Only commit and push if we have changes | ||
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,54 @@ | ||
[package] | ||
name = "sg" | ||
version = "0.1.1" | ||
edition = "2018" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
anyhow.workspace = true | ||
mlua.workspace = true | ||
tokio.workspace = true | ||
serde.workspace = true | ||
serde_json.workspace = true | ||
graphql_client.workspace = true | ||
reqwest.workspace = true | ||
lsp-types.workspace = true | ||
|
||
anyhow = "1" | ||
graphql_client = { version = "0.13.0", features = ["reqwest", "reqwest-blocking"] } | ||
regex = "1.4.6" | ||
reqwest = "0.11.3" | ||
serde = "1.0.125" | ||
futures = "0.3.17" | ||
lsp-server = "0.7.0" | ||
lsp-types = "0.94.0" | ||
serde_json = "1.0" | ||
log4rs = "1.2" | ||
log = "0.4" | ||
once_cell = "1" | ||
|
||
userdata_defaults = { path = "crates/userdata_defaults/" } | ||
userdata_defaults = { path = "crates/userdata-defaults/" } | ||
sg-gql = { path = "crates/sg-gql" } | ||
sg-types = { path = "crates/sg-types" } | ||
jsonrpc = { path = "crates/jsonrpc" } | ||
|
||
[workspace.dependencies] | ||
anyhow = "1" | ||
mlua = { version = "0.8", features = ["luajit", "vendored", "module", "serialize", "async"] } | ||
tokio = { version = "1", features = ["full"] } | ||
|
||
serde = "1.0.125" | ||
serde_json = "1.0" | ||
|
||
graphql_client = { version = "0.13.0", features = ["reqwest", "reqwest-blocking"] } | ||
reqwest = "0.11.3" | ||
|
||
lsp-types = "0.94.0" | ||
url = "2.4.0" | ||
|
||
[lib] | ||
name = "sg" | ||
path = "lib/sg.rs" | ||
|
||
[workspace] | ||
members = [ | ||
"crates/sg-nvim/", | ||
"crates/userdata_defaults/", | ||
"crates/jsonrpc", | ||
"crates/libsg/", | ||
"crates/sg-gql/", | ||
"crates/sg-types/", | ||
"crates/userdata-defaults/", | ||
] |
Oops, something went wrong.