Skip to content

Commit

Permalink
add ci (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvoth authored Feb 17, 2024
1 parent ac0da46 commit 1e66014
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Cargo Build & Test

on:
push:
branches:
- master
pull_request:
branches:
- master

env:
CARGO_TERM_COLOR: always

jobs:
build_and_test:
name: cls project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable

steps:
- uses: actions/checkout@v3
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo build --verbose
- run: cargo test --verbose

4 changes: 0 additions & 4 deletions crates/lsp/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use std::collections::HashMap;
use std::error::Error;
use std::hash::Hash;

use lsp_types::notification::{DidChangeTextDocument, DidOpenTextDocument};
use lsp_types::{
Expand Down Expand Up @@ -70,13 +69,11 @@ fn main_loop(
};

for msg in &connection.receiver {
eprintln!("got msg: {msg:?}");
match msg {
Message::Request(req) => {
if connection.handle_shutdown(&req)? {
return Ok(());
}
eprintln!("got request: {req:?}");
match cast::<GotoDefinition>(req) {
Ok((id, params)) => {
let uri = params.text_document_position_params.text_document.uri;
Expand All @@ -91,7 +88,6 @@ fn main_loop(

let range = lookup_definition(file, &ast, token.unwrap());

eprintln!("{range:?}");
let result = Some(GotoDefinitionResponse::Scalar(Location::new(
uri,
range.unwrap(),
Expand Down

0 comments on commit 1e66014

Please sign in to comment.