Skip to content

Commit 69e2423

Browse files
committed
Don't show self on inlay hints
1 parent 138518b commit 69e2423

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- Fixed `self` being showed as the first inlay hint incorrectly
12+
913
## [1.8.0] - 2022-07-30
1014

1115
### Added

src/operations/InlayHints.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,13 @@ struct InlayHintVisitor : public Luau::AstVisitor
144144
if (auto ftv = Luau::get<Luau::FunctionTypeVar>(followedTy))
145145
{
146146
auto namesIt = ftv->argNames.begin();
147+
auto idx = 0;
147148
for (auto param : call->args)
148149
{
150+
// Skip first item if it is self
151+
if (idx == 0 && ftv->hasSelf && call->self)
152+
continue;
153+
149154
if (namesIt == ftv->argNames.end())
150155
break;
151156
if (!namesIt->has_value())
@@ -171,6 +176,7 @@ struct InlayHintVisitor : public Luau::AstVisitor
171176
hints.emplace_back(hint);
172177

173178
namesIt++;
179+
idx++;
174180
}
175181
}
176182

0 commit comments

Comments
 (0)