-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: asymc compile in lsp. 1 support async compile when vfs changes(open file and ChangeTextDocument). 2. remove scope in lsp db Signed-off-by: he1pa <[email protected]> * fix: fix unwrap() in request.rs and completion.rs Signed-off-by: he1pa <[email protected]> * test: fix ut Signed-off-by: he1pa <[email protected]> --------- Signed-off-by: he1pa <[email protected]>
- Loading branch information
Showing
9 changed files
with
290 additions
and
310 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 |
---|---|---|
@@ -1,14 +1,9 @@ | ||
use crate::db::AnalysisDatabase; | ||
use parking_lot::RwLock; | ||
use ra_ap_vfs::FileId; | ||
use std::collections::HashMap; | ||
use std::{collections::HashMap, sync::Arc}; | ||
|
||
#[derive(Default)] | ||
pub struct Analysis { | ||
pub db: HashMap<FileId, AnalysisDatabase>, | ||
} | ||
|
||
impl Analysis { | ||
pub fn set_db(&mut self, id: FileId, db: AnalysisDatabase) { | ||
self.db.insert(id, db); | ||
} | ||
pub db: Arc<RwLock<HashMap<FileId, AnalysisDatabase>>>, | ||
} |
Large diffs are not rendered by default.
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,13 +1,12 @@ | ||
use indexmap::IndexSet; | ||
use kclvm_ast::ast::Program; | ||
use kclvm_error::Diagnostic; | ||
use kclvm_sema::{core::global_state::GlobalState, resolver::scope::ProgramScope}; | ||
use kclvm_sema::core::global_state::GlobalState; | ||
|
||
/// Holds the result of the compile | ||
#[derive(Default, Clone)] | ||
pub struct AnalysisDatabase { | ||
pub prog: Program, | ||
pub scope: ProgramScope, | ||
pub diags: IndexSet<Diagnostic>, | ||
pub gs: GlobalState, | ||
} |
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
Oops, something went wrong.