-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hacky implementation of find implementations
- Loading branch information
1 parent
84c6215
commit c1d6f11
Showing
8 changed files
with
90 additions
and
13 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
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 +1,42 @@ | ||
use std::collections::HashSet; | ||
|
||
use gqls_fixture::{fixture, Fixture}; | ||
|
||
use crate::{Ide, Location}; | ||
|
||
fn test(fixture: Fixture) { | ||
let mut ide = Ide::default(); | ||
ide.setup_fixture(&fixture); | ||
let analysis = ide.analysis(); | ||
let expected_locations = fixture | ||
.all_ranges() | ||
.map(|(file, range)| Location::new(file, range.into())) | ||
.collect::<HashSet<_>>(); | ||
|
||
for (file, at) in fixture.all_points() { | ||
let locations = analysis.goto_implementation(file, at).into_iter().collect::<HashSet<_>>(); | ||
assert_eq!(expected_locations, locations); | ||
} | ||
} | ||
|
||
#[test] | ||
fn test_find_implementations() { | ||
let fixture = fixture!( | ||
"foo" => " | ||
interface Iface { | ||
#^^^^^ | ||
i: Int | ||
} | ||
type Foo implements Iface { | ||
#... | ||
i: Int | ||
} | ||
extend type Foo implements Iface { | ||
#... | ||
k: Int | ||
}" | ||
); | ||
test(fixture); | ||
} |
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
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
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
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
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
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