Skip to content

Commit

Permalink
assign correct semantics to struct expression name accounting for `Se…
Browse files Browse the repository at this point in the history
…lf` (FuelLabs#4860)

## Description

closes FuelLabs#4859
  • Loading branch information
JoshuaBatty authored Jul 25, 2023
1 parent 5670dea commit a1d5622
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sway-lsp/src/traverse/parsed_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,14 @@ impl Parse for StructExpression {
);
}
let name = &self.call_path_binding.inner.suffix;
let symbol_kind = if name.as_str() == "Self" {
SymbolKind::SelfKeyword
} else {
SymbolKind::Struct
};
ctx.tokens.insert(
to_ident_key(name),
Token::from_parsed(AstToken::StructExpression(self.clone()), SymbolKind::Struct),
Token::from_parsed(AstToken::StructExpression(self.clone()), symbol_kind),
);
let type_arguments = &self.call_path_binding.type_arguments.to_vec();
type_arguments.iter().for_each(|type_arg| {
Expand Down

0 comments on commit a1d5622

Please sign in to comment.