-
-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
037be39
commit d4c87d0
Showing
17 changed files
with
1,159 additions
and
11 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
.../tests/snapshots/gleam_core__language_server__tests__rename__rename_aliased_constant.snap
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
source: compiler-core/src/language_server/tests/rename.rs | ||
expression: "\npub const something = 10\n\npub fn main() {\n something + { 4 * something }\n}\n" | ||
--- | ||
----- BEFORE RENAME | ||
-- mod.gleam | ||
|
||
import app.{something as some_constant} | ||
|
||
fn wibble() { | ||
some_constant | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
pub const something = 10 | ||
↑ | ||
|
||
pub fn main() { | ||
something + { 4 * something } | ||
} | ||
|
||
|
||
----- AFTER RENAME | ||
-- mod.gleam | ||
|
||
import app.{ten as some_constant} | ||
|
||
fn wibble() { | ||
some_constant | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
pub const ten = 10 | ||
|
||
pub fn main() { | ||
ten + { 4 * ten } | ||
} |
45 changes: 45 additions & 0 deletions
45
.../tests/snapshots/gleam_core__language_server__tests__rename__rename_aliased_function.snap
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
source: compiler-core/src/language_server/tests/rename.rs | ||
expression: "\npub fn something() {\n something()\n}\n\nfn something_else() {\n something()\n}\n" | ||
--- | ||
----- BEFORE RENAME | ||
-- mod.gleam | ||
|
||
import app.{something as something_else} | ||
|
||
fn wibble() { | ||
something_else() | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
pub fn something() { | ||
↑ | ||
something() | ||
} | ||
|
||
fn something_else() { | ||
something() | ||
} | ||
|
||
|
||
----- AFTER RENAME | ||
-- mod.gleam | ||
|
||
import app.{some_function as something_else} | ||
|
||
fn wibble() { | ||
something_else() | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
pub fn some_function() { | ||
some_function() | ||
} | ||
|
||
fn something_else() { | ||
some_function() | ||
} |
45 changes: 45 additions & 0 deletions
45
...ts/snapshots/gleam_core__language_server__tests__rename__rename_aliased_type_variant.snap
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
source: compiler-core/src/language_server/tests/rename.rs | ||
expression: "\npub type Wibble {\n Constructor(Int)\n}\n\npub fn main() {\n Constructor(42)\n}\n" | ||
--- | ||
----- BEFORE RENAME | ||
-- mod.gleam | ||
|
||
import app.{Constructor as ValueConstructor} | ||
|
||
fn wibble() { | ||
ValueConstructor(172) | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
pub type Wibble { | ||
Constructor(Int) | ||
↑ | ||
} | ||
|
||
pub fn main() { | ||
Constructor(42) | ||
} | ||
|
||
|
||
----- AFTER RENAME | ||
-- mod.gleam | ||
|
||
import app.{MakeAWibble as ValueConstructor} | ||
|
||
fn wibble() { | ||
ValueConstructor(172) | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
pub type Wibble { | ||
MakeAWibble(Int) | ||
} | ||
|
||
pub fn main() { | ||
MakeAWibble(42) | ||
} |
41 changes: 41 additions & 0 deletions
41
...napshots/gleam_core__language_server__tests__rename__rename_constant_from_definition.snap
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
source: compiler-core/src/language_server/tests/rename.rs | ||
expression: "\npub const something = 10\n\npub fn main() {\n something + { 4 * something }\n}\n" | ||
--- | ||
----- BEFORE RENAME | ||
-- mod.gleam | ||
|
||
import app | ||
|
||
fn wibble() { | ||
app.something | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
pub const something = 10 | ||
↑ | ||
|
||
pub fn main() { | ||
something + { 4 * something } | ||
} | ||
|
||
|
||
----- AFTER RENAME | ||
-- mod.gleam | ||
|
||
import app | ||
|
||
fn wibble() { | ||
app.ten | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
pub const ten = 10 | ||
|
||
pub fn main() { | ||
ten + { 4 * ten } | ||
} |
41 changes: 41 additions & 0 deletions
41
...gleam_core__language_server__tests__rename__rename_constant_from_qualified_reference.snap
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
source: compiler-core/src/language_server/tests/rename.rs | ||
expression: "\nimport mod\n\npub fn main() {\n mod.something\n}\n" | ||
--- | ||
----- BEFORE RENAME | ||
-- mod.gleam | ||
|
||
pub const something = 10 | ||
|
||
fn wibble() { | ||
something | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
import mod | ||
|
||
pub fn main() { | ||
mod.something | ||
↑ | ||
} | ||
|
||
|
||
----- AFTER RENAME | ||
-- mod.gleam | ||
|
||
pub const ten = 10 | ||
|
||
fn wibble() { | ||
ten | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
import mod | ||
|
||
pub fn main() { | ||
mod.ten | ||
} |
41 changes: 41 additions & 0 deletions
41
...snapshots/gleam_core__language_server__tests__rename__rename_constant_from_reference.snap
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
source: compiler-core/src/language_server/tests/rename.rs | ||
expression: "\npub const something = 10\n\npub fn main() {\n something + { 4 * something }\n}\n" | ||
--- | ||
----- BEFORE RENAME | ||
-- mod.gleam | ||
|
||
import app | ||
|
||
fn wibble() { | ||
app.something | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
pub const something = 10 | ||
|
||
pub fn main() { | ||
something + { 4 * something } | ||
↑ | ||
} | ||
|
||
|
||
----- AFTER RENAME | ||
-- mod.gleam | ||
|
||
import app | ||
|
||
fn wibble() { | ||
app.ten | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
pub const ten = 10 | ||
|
||
pub fn main() { | ||
ten + { 4 * ten } | ||
} |
41 changes: 41 additions & 0 deletions
41
...eam_core__language_server__tests__rename__rename_constant_from_unqualified_reference.snap
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
source: compiler-core/src/language_server/tests/rename.rs | ||
expression: "\nimport mod.{something}\n\npub fn main() {\n something + mod.something\n}\n" | ||
--- | ||
----- BEFORE RENAME | ||
-- mod.gleam | ||
|
||
pub const something = 10 | ||
|
||
fn wibble() { | ||
something | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
import mod.{something} | ||
|
||
pub fn main() { | ||
something + mod.something | ||
↑ | ||
} | ||
|
||
|
||
----- AFTER RENAME | ||
-- mod.gleam | ||
|
||
pub const ten = 10 | ||
|
||
fn wibble() { | ||
ten | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
import mod.{ten} | ||
|
||
pub fn main() { | ||
ten + mod.ten | ||
} |
28 changes: 28 additions & 0 deletions
28
...apshots/gleam_core__language_server__tests__rename__rename_constant_shadowing_module.snap
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
source: compiler-core/src/language_server/tests/rename.rs | ||
expression: "\nimport gleam/list\n\nconst list = []\n\npub fn main() {\n list.map(todo, todo)\n}\n " | ||
--- | ||
----- BEFORE RENAME | ||
-- app.gleam | ||
|
||
import gleam/list | ||
|
||
const list = [] | ||
↑ | ||
|
||
pub fn main() { | ||
list.map(todo, todo) | ||
} | ||
|
||
|
||
|
||
----- AFTER RENAME | ||
-- app.gleam | ||
|
||
import gleam/list | ||
|
||
const empty_list = [] | ||
|
||
pub fn main() { | ||
list.map(todo, todo) | ||
} |
45 changes: 45 additions & 0 deletions
45
...napshots/gleam_core__language_server__tests__rename__rename_function_from_definition.snap
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
source: compiler-core/src/language_server/tests/rename.rs | ||
expression: "\npub fn something() {\n something()\n}\n\nfn something_else() {\n something()\n}\n" | ||
--- | ||
----- BEFORE RENAME | ||
-- mod.gleam | ||
|
||
import app | ||
|
||
fn wibble() { | ||
app.something() | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
pub fn something() { | ||
↑ | ||
something() | ||
} | ||
|
||
fn something_else() { | ||
something() | ||
} | ||
|
||
|
||
----- AFTER RENAME | ||
-- mod.gleam | ||
|
||
import app | ||
|
||
fn wibble() { | ||
app.some_function() | ||
} | ||
|
||
|
||
-- app.gleam | ||
|
||
pub fn some_function() { | ||
some_function() | ||
} | ||
|
||
fn something_else() { | ||
some_function() | ||
} |
Oops, something went wrong.