Skip to content

Commit

Permalink
merge: dev into main
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmemorygrinder committed May 14, 2024
2 parents 9184d81 + 20d058f commit ec457fb
Show file tree
Hide file tree
Showing 24 changed files with 470 additions and 317 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ jobs:
pre-release: ${{ github.event.inputs.pre-release }}
secrets:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}

VSCE_PAT: ${{ secrets.VSCE_PAT }}
18 changes: 16 additions & 2 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion libs/foundry-wrapper/src/compiler.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
error::Error,
output::get_files_from_foundry_output,
output::{get_files_from_foundry_output, remove_previous_outputs},
types::ProjectCompileOutput,
utils::{check_executable_argument, find_forge_executable, find_projects_paths},
FoundryJsonFile,
Expand Down Expand Up @@ -80,6 +80,8 @@ impl Compiler {
let workspace_path = self
.find_closest_workspace(file_path)
.ok_or_else(|| Error::InvalidFilePath(file_path.to_string()))?;

remove_previous_outputs(&workspace_path)?;
//info!("Workspace to compile: {}", workspace_path);
let _ = Command::new(&self.inner.executable_path)
.current_dir(&workspace_path)
Expand Down
3 changes: 3 additions & 0 deletions libs/foundry-wrapper/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ pub enum Error {

#[error("Cannot read build info file")]
ReadBuildInfo(#[from] std::io::Error),

#[error("filesystem error: {0}")]
FileSystemError(std::io::Error),
}
14 changes: 13 additions & 1 deletion libs/foundry-wrapper/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@ use crate::error::Error;
use crate::types::FoundryJsonFile;
use osmium_libs_solidity_path_utils::join_path;

use std::fs::{read_dir, DirEntry};
use std::fs::{remove_dir_all, read_dir, DirEntry};
use std::io;
use std::path::PathBuf;

pub fn remove_previous_outputs(base_path: &str) -> Result<(), Error> {
let build_info_path = format!("{}/out/build-info", base_path);

let res = remove_dir_all(&build_info_path);
if let Err(e) = res {
if e.kind() != io::ErrorKind::NotFound {
return Err(Error::FileSystemError(e));
}
}
Ok(())
}

pub fn get_files_from_foundry_output(base_path: &str) -> Result<Vec<FoundryJsonFile>, Error> {
let mut files = Vec::new();

Expand Down
2 changes: 1 addition & 1 deletion libs/lsp-server-wrapper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2021"

[dependencies]
lsp-server = "0.7.4"
lsp-types = "0.94.1"
lsp-types = "0.95.1"
serde = "1.0.188"
serde_json = "1.0.107"
tracing = "0.1.37"
2 changes: 1 addition & 1 deletion libs/lsp-server-wrapper/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl Client {
if !value.is_null() && !value.is_array() && !value.is_object() {
value = Value::Array(vec![value]);
}
self.send_notification_unchecked::<TelemetryEvent>(value);
self.send_notification_unchecked::<TelemetryEvent>(OneOf::Right(vec![value]));
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions libs/solidhunter/src/linter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,12 @@ impl SolidLinter {

self._add_file(filepath, res, content);
let mut res: Vec<_> = vec![];
let file = self.files.iter().find(|x| x.path == filepath).unwrap();

for rule in &self.rules {
let mut diags = rule.diagnose(&self.files[self.files.len() - 1], &self.files);
let mut diags = rule.diagnose(file, &self.files);
for diag in &mut diags {
if !self._check_is_diag_ignored(diag, &self.files[self.files.len() - 1]) {
if !self._check_is_diag_ignored(diag, file) {
res.push(diag.clone());
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"sidebar"
],
"devDependencies": {
"turbo": "^1.12.4"
"turbo": "^1.13.3"
},
"scripts": {
"build": "turbo build && node ./scripts/copy-servers.js && node ./scripts/copy-front.js",
Expand Down
Loading

0 comments on commit ec457fb

Please sign in to comment.