Skip to content

Commit d277801

Browse files
ndmitchellfacebook-github-bot
authored andcommitted
Remove a redundant argument from LocationFinder
Summary: It just gives you back what you gave it. I can't see how this would ever be useful. Reviewed By: milend Differential Revision: D47190447 fbshipit-source-id: 2315669ff2c7426400c41f1578cf6ada57ef70e0
1 parent 0a7f648 commit d277801

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

starlark/src/lsp/server.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ impl TryFrom<&LspUrl> for Url {
214214
pub struct StringLiteralResult {
215215
/// The path that a string literal resolves to.
216216
pub url: LspUrl,
217-
/// A function that takes the AstModule at path specified by `url` and that same url, and
217+
/// A function that takes the AstModule at path specified by `url`, and
218218
/// allows resolving a location to jump to within the specific URL if desired.
219219
///
220220
/// If `None`, then just jump to the URL. Do not attempt to load the file.
221221
#[derivative(Debug = "ignore")]
222222
pub location_finder:
223-
Option<Box<dyn FnOnce(&AstModule, &LspUrl) -> anyhow::Result<Option<Range>> + Send>>,
223+
Option<Box<dyn FnOnce(&AstModule) -> anyhow::Result<Option<Range>> + Send>>,
224224
}
225225

226226
fn _assert_string_literal_result_is_send() {
@@ -498,7 +498,7 @@ impl<T: LspContext> Backend<T> {
498498
let result =
499499
self.get_ast_or_load_from_disk(&url)
500500
.and_then(|ast| match ast {
501-
Some(module) => location_finder(&module.ast, &url),
501+
Some(module) => location_finder(&module.ast),
502502
None => Ok(None),
503503
});
504504
if let Err(e) = &result {

starlark/src/lsp/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl LspContext for TestServerContext {
193193
LspUrl::File(u) => match u.extension() {
194194
Some(e) if e == "star" => Some(StringLiteralResult {
195195
url,
196-
location_finder: Some(Box::new(move |_ast, _url| Ok(range))),
196+
location_finder: Some(Box::new(move |_ast| Ok(range))),
197197
}),
198198
_ => Some(StringLiteralResult {
199199
url,

0 commit comments

Comments
 (0)