stakwork / stakwork/stakgraph

ruby lsp testing

Open
#113 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
112
Forks
21
Avg merge
5h 55m
Merged PRs (30d)
115

Description

We need to test ruby-lsp for parsing repos. I never got it working, due to ruby or gem version mismatches

Here, you can set true for Ruby in the default_do_lsp https://github.com/stakwork/stakgraph/blob/main/lsp/src/language.rs#L142

Then you can run this test https://github.com/stakwork/stakgraph/blob/main/ast/src/testing/ruby/mod.rs

  • cargo test test_ruby (no LSP)
  • USE_LSP=1 cargo test test_ruby (to test with LSP on)
  • RUST_LOG=debug USE_LSP=1 cargo test test_ruby -- --nocapture (for full logs)

See how in the test_react test, it checks both lsp and non-lsp graph: https://github.com/stakwork/stakgraph/blob/main/ast/src/testing/react/mod.rs

So we should do that for ruby too.

The base Dockerfile that the parser uses is defined here: https://github.com/stakwork/stakgraph/blob/main/lsp/Dockerfile

So if we need more ruby-related tools installed, add them there. You can test code directly in that docker container if you want like this:

docker run --rm -it --entrypoint "/bin/bash" -v .:/root/stakgraph sphinxlightning/stakgraph-lsp

cd /root/stakgraph

cargo test test_ruby

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lsp/src/language.rs around default_do_lsp, ast/src/testing/ruby/mod.rs, and the comparable ast/src/testing/react/mod.rs; inspect lsp/Dockerfile if Ruby or gem versions prevent the test from running. Run cargo test test_ruby and USE_LSP=1 cargo test test_ruby, using debug logs or the container as needed. Done means Ruby parsing tests pass with both LSP disabled and enabled, like the React test.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, ruby, rust
Domain
devtools, testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.