Skip to content

Commit

Permalink
Re-introduced doc string check against outer def
Browse files Browse the repository at this point in the history
  • Loading branch information
awelc committed Jun 25, 2024
1 parent 8e7cd76 commit 5ff8d65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
5 changes: 2 additions & 3 deletions external-crates/move/crates/move-analyzer/src/inlay_hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use crate::{
};
use lsp_server::Request;
use lsp_types::{
InlayHint, InlayHintKind, InlayHintLabel, InlayHintLabelPart, InlayHintParams,
InlayHintTooltip, Position,
InlayHint, InlayHintKind, InlayHintLabel, InlayHintLabelPart, InlayHintParams, InlayHintTooltip,
};

use move_compiler::{naming::ast as N, shared::Identifier};
Expand All @@ -30,7 +29,7 @@ pub fn on_inlay_hint_request(context: &Context, request: &Request, symbols: &Sym
for mod_defs in file_defs {
for untyped_def_loc in mod_defs.untyped_defs() {
let start_position = symbols.files.start_position(untyped_def_loc);
if let Some(DefInfo::Local(n, t, _, _)) = symbols.def_info(untyped_def_loc) {
if let Some(DefInfo::Local(_, t, _, _)) = symbols.def_info(untyped_def_loc) {
let colon_label = InlayHintLabelPart {
value: ": ".to_string(),
tooltip: None,
Expand Down
12 changes: 4 additions & 8 deletions external-crates/move/crates/move-analyzer/src/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2812,9 +2812,9 @@ fn extract_doc_string(
let start_position = files.start_position_opt(loc)?;
let file_lines = file_id_to_lines.get(&file_id)?;

/*
if let Some(outer_line) = outer_def_line {
if outer_line == name_start.line {
if let Some(outer_loc) = outer_def_loc {
if let Some(outer_pos) = files.start_position_opt(&outer_loc) {
if outer_pos.line_offset() == start_position.line_offset() {
// It's a bit of a hack but due to the way we extract doc strings
// we should not do it for a definition if this definition is placed
// on the same line as another (outer) one as this way we'd pick
Expand All @@ -2826,11 +2826,7 @@ fn extract_doc_string(
return None;
}
}
let Some(file_id) = file_id_mapping.get(file_hash) else {
return None;
};
*/
}

if start_position.line_offset() == 0 {
return None;
Expand Down

0 comments on commit 5ff8d65

Please sign in to comment.