From f8f4663d1c3ba4887fb05c806cb364a18899c5b3 Mon Sep 17 00:00:00 2001 From: Xiaok29 <1526783667@qq.com> Date: Tue, 21 Nov 2023 13:15:55 +0800 Subject: [PATCH] style:format find_refs function Signed-off-by: Xiaok29 <1526783667@qq.com> --- kclvm/tools/src/LSP/src/find_refs.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/kclvm/tools/src/LSP/src/find_refs.rs b/kclvm/tools/src/LSP/src/find_refs.rs index 5acea12c7..476b7f9a5 100644 --- a/kclvm/tools/src/LSP/src/find_refs.rs +++ b/kclvm/tools/src/LSP/src/find_refs.rs @@ -1,5 +1,5 @@ use crate::from_lsp::kcl_pos; -use crate::goto_def::{find_def, goto_definition, find_def_with_gs}; +use crate::goto_def::{find_def, find_def_with_gs, goto_definition}; use crate::to_lsp::lsp_location; use crate::util::{parse_param_and_compile, Param}; use anyhow; @@ -23,7 +23,7 @@ pub(crate) fn find_refs Result<(), anyhow::Error>>( logger: F, gs: &GlobalState, ) -> Result, String> { - let def = find_def_with_gs(kcl_pos, &gs, true); + let def = find_def_with_gs(kcl_pos, &gs, true); match def { Some(def_ref) => match gs.get_symbols().get_symbol(def_ref) { Some(obj) => { @@ -41,10 +41,14 @@ pub(crate) fn find_refs Result<(), anyhow::Error>>( } else { Err(format!("Invalid file path: {0}", start.filename)) } - }, - None => Err(String::from("Found more than one definitions, reference not supported")), + } + None => Err(String::from( + "Found more than one definitions, reference not supported", + )), }, - None => Err(String::from("Definition item not found, result in no reference")), + None => Err(String::from( + "Definition item not found, result in no reference", + )), } }