diff --git a/Cargo.toml b/Cargo.toml index 886c7ef3d6..f5a7ce8269 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,8 +4,8 @@ exclude = ["ide/src/tests/mock_project"] resolver = "2" [workspace.dependencies] -rustc_plugin = "=0.7.2-nightly-2023-08-25" -rustc_utils = {version = "=0.7.2-nightly-2023-08-25", features = ["indexical"]} +rustc_plugin = "=0.7.3-nightly-2023-08-25" +rustc_utils = {version = "=0.7.3-nightly-2023-08-25", features = ["indexical"]} indexical = {version = "0.3.1", default-features = false, features = ["rustc"]} [profile.bench] diff --git a/crates/flowistry/Cargo.toml b/crates/flowistry/Cargo.toml index 446a9e465c..977b010db7 100644 --- a/crates/flowistry/Cargo.toml +++ b/crates/flowistry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flowistry" -version = "0.5.40" +version = "0.5.41" edition = "2021" authors = ["Will Crichton "] description = "Modular information flow analysis" diff --git a/crates/flowistry_ide/Cargo.toml b/crates/flowistry_ide/Cargo.toml index 31b7f5ea43..b1d234f26e 100644 --- a/crates/flowistry_ide/Cargo.toml +++ b/crates/flowistry_ide/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flowistry_ide" -version = "0.5.40" +version = "0.5.41" edition = "2021" authors = ["Will Crichton "] description = "Information Flow in the IDE for Rust" @@ -14,7 +14,7 @@ rustc_private = true decompose = ["petgraph", "rayon"] [dependencies] -flowistry = {version = "0.5.40", path = "../flowistry"} +flowistry = {version = "0.5.41", path = "../flowistry"} anyhow = "1" log = "0.4" fluid-let = "1.0" diff --git a/crates/flowistry_ifc/Cargo.toml b/crates/flowistry_ifc/Cargo.toml index 25eb4f216b..a60a106bdf 100644 --- a/crates/flowistry_ifc/Cargo.toml +++ b/crates/flowistry_ifc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flowistry_ifc" -version = "0.5.40" +version = "0.5.41" edition = "2021" publish = false @@ -8,7 +8,7 @@ publish = false rustc_private = true [dependencies] -flowistry = {version = "0.5.40", path = "../flowistry"} +flowistry = {version = "0.5.41", path = "../flowistry"} env_logger = "0.9" termcolor = "1.1" anyhow = "1" diff --git a/crates/flowistry_ifc_traits/Cargo.toml b/crates/flowistry_ifc_traits/Cargo.toml index 5c52055981..b43a17e3cd 100644 --- a/crates/flowistry_ifc_traits/Cargo.toml +++ b/crates/flowistry_ifc_traits/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flowistry_ifc_traits" -version = "0.5.40" +version = "0.5.41" edition = "2021" publish = false diff --git a/ide/package.json b/ide/package.json index 0ec6982060..c84d8c2c9b 100644 --- a/ide/package.json +++ b/ide/package.json @@ -12,7 +12,7 @@ "type": "git" }, "description": "Information Flow in the IDE for Rust", - "version": "0.5.40", + "version": "0.5.41", "engines": { "vscode": "^1.54.0" }, diff --git a/ide/src/focus.ts b/ide/src/focus.ts index 1d9cade51b..161ecd5609 100644 --- a/ide/src/focus.ts +++ b/ide/src/focus.ts @@ -59,8 +59,7 @@ class FocusBodyState { }; private find_slice_at_selection = ( - editor: vscode.TextEditor, - doc: vscode.TextDocument + editor: vscode.TextEditor ): { seeds: Range[]; slice: Range[]; direct_influence: Range[] } => { let query = this.places.selection_to_interval( this.mark || editor.selection @@ -74,6 +73,8 @@ class FocusBodyState { sliced = result.overlapping.concat(first_containing); } + console.log("query:", query, result, sliced); + let seeds = sliced.map(({ value }) => value.ranges).flat(); seeds = _.uniqWith(seeds, _.isEqual); let slice = sliced.map(({ value }) => value.slice).flat(); @@ -86,10 +87,8 @@ class FocusBodyState { render = async (editor: vscode.TextEditor, select = false) => { let doc = editor.document; - let { seeds, slice, direct_influence } = this.find_slice_at_selection( - editor, - doc - ); + let { seeds, slice, direct_influence } = + this.find_slice_at_selection(editor); if (seeds.length > 0) { if (select) { diff --git a/ide/src/range.ts b/ide/src/range.ts index e96c86054f..f9e4fdf6de 100644 --- a/ide/src/range.ts +++ b/ide/src/range.ts @@ -112,7 +112,7 @@ export class RangeTree { ["contained", "containing", "overlapping"].forEach((k) => { let final_ = final as any; - final_[k] = _.sortBy(final_[k], ({ range }) => range.end - range.start); + final_[k] = _.orderBy(final_[k], ({ range }) => [range.end.line - range.start.line, range.end.column - range.start.column]); }); console.log("Querying", query, "for result", final);