Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use cody-agent as the backend #30

Merged
merged 49 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
47ffd76
add basic support for cody agent stuff
tjdevries Jun 29, 2023
56eaa4e
back to no warnings and all gql in one crate
tjdevries Jun 29, 2023
da661b5
work on easier install instructions
tjdevries Jun 30, 2023
7a3099a
update build script to build correctly haha
tjdevries Jun 30, 2023
e4f7378
actually wait for both jobs
tjdevries Jun 30, 2023
12d44b6
renames
tjdevries Jun 30, 2023
1b3fac2
this is broken
tjdevries Jul 1, 2023
9ac9c80
checkpoint
tjdevries Jul 1, 2023
83e2660
switch to json rpc approach, it's working
tjdevries Jul 1, 2023
f3290d7
start working on generating documentation
tjdevries Jul 6, 2023
f923a46
add a way to automatically accept tos
tjdevries Jul 6, 2023
829c63e
attempt to use build.lua instead
tjdevries Jul 6, 2023
4e28eba
add nvim to path
tjdevries Jul 6, 2023
1640340
use -l instead
tjdevries Jul 6, 2023
bd68df0
don't try and load right away
tjdevries Jul 6, 2023
71b24d8
start adding much more help documentation
tjdevries Jul 6, 2023
4818913
friday night hacking
tjdevries Jul 8, 2023
b24b1e7
[docgen] Update doc/telescope.txt
Jul 8, 2023
451aaa7
better testing env setup
tjdevries Jul 9, 2023
4fbd94d
vendor rpc client so we can do async server requests
tjdevries Jul 10, 2023
6a315bd
vendor vim system for now
tjdevries Jul 10, 2023
f1d8f4b
copy pasta system
tjdevries Jul 10, 2023
99efe67
dont use vim.uv
tjdevries Jul 10, 2023
4e19ee5
make note clearer
tjdevries Jul 10, 2023
8d14ecf
fixup: add minified cody agent
tjdevries Jul 11, 2023
ce92a91
many fixups for debugging and handling messages
tjdevries Jul 11, 2023
0eacbd2
add test for sending filenames when opening file
tjdevries Jul 11, 2023
e7895e9
more tests for buffer lifecycle
tjdevries Jul 11, 2023
e7b239b
add test for sending buffer updates
tjdevries Jul 12, 2023
c5a7125
wip: for thorsten
tjdevries Jul 12, 2023
c6b53a3
add CR in normal mode
tjdevries Jul 12, 2023
597f36b
fix: start using correct rpc for sg nvim stuff
tjdevries Jul 12, 2023
1b88f0d
rename file, since cody has moved to separate agent
tjdevries Jul 12, 2023
0aceddf
add back embeddings and context queries
tjdevries Jul 12, 2023
9267dc8
doc
tjdevries Jul 12, 2023
e975f35
give more time for tests
tjdevries Jul 12, 2023
8ae8ce9
move debounce to vendored to be clear
tjdevries Jul 12, 2023
ebba634
work on adding linters
tjdevries Jul 12, 2023
b7218f5
remove makefile, move to scripts
tjdevries Jul 13, 2023
8a00ab8
add macos to unit test matrix
tjdevries Jul 13, 2023
6a68e5d
add macos to unit test matrix
tjdevries Jul 13, 2023
98103cb
make login more reliable
tjdevries Jul 13, 2023
9a5cc06
documentation
tjdevries Jul 13, 2023
c247954
use more reliable way of finding artifacts
tjdevries Jul 13, 2023
29094c7
sort libs by time as well
tjdevries Jul 13, 2023
374c005
start working on adding keymap handling for cody chat
tjdevries Jul 13, 2023
280b2af
better check for node
tjdevries Jul 14, 2023
7a3e1c8
error when failing execution
tjdevries Jul 14, 2023
de54fc7
add :SourcegraphBuild
tjdevries Jul 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/cody-agent.js binary
83 changes: 83 additions & 0 deletions .github/workflows/docgen.yml
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})
19 changes: 10 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ jobs:
include:
- os: ubuntu-22.04
rev: nightly/nvim-linux64.tar.gz
# manager: sudo apt-get
# packages: -y ripgrep
- os: ubuntu-22.04
rev: v0.9.0/nvim-linux64.tar.gz
# manager: sudo apt-get
# packages: -y ripgrep
- os: macos-latest
rev: nightly/nvim-macos.tar.gz
steps:
- uses: actions/checkout@v3
- run: date +%F > todays-date
Expand All @@ -42,10 +40,6 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build rust items
run: |
cargo build --workspace --bins

- name: Prepare
run: |
# ${{ matrix.manager }} update
Expand All @@ -58,9 +52,16 @@ jobs:
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
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: Run tests
run: |
export PATH="${PWD}/_neovim/bin:${PATH}"
export VIM="${PWD}/_neovim/share/nvim/runtime"
nvim --version
make test
nvim -l scripts/test.lua
39 changes: 37 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 26 additions & 11 deletions Cargo.toml
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/",
]
3 changes: 0 additions & 3 deletions Makefile

This file was deleted.

Loading