Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong class for self in methods #421

Closed
ZLOY5 opened this issue Feb 24, 2021 · 0 comments
Closed

Wrong class for self in methods #421

ZLOY5 opened this issue Feb 24, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@ZLOY5
Copy link

ZLOY5 commented Feb 24, 2021

Describe the bug
Self variable show wrong class on hover

To Reproduce
Open code in editor and hover self var, sometimes it show random parent class instead of defined in method

---@class CEntityInstance
CEntityInstance = {}
---@class CBaseEntity:CEntityInstance
CBaseEntity = {}
---@class CBaseModelEntity:CBaseEntity
CBaseModelEntity = {}
---@class CBaseAnimating:CBaseModelEntity
CBaseAnimating = {}
---@class CBaseFlex:CBaseAnimating
CBaseFlex = {}
---@class CDOTA_BaseNPC:CBaseFlex
CDOTA_BaseNPC = {}
---@class CDOTA_BaseNPC_Hero:CDOTA_BaseNPC
CDOTA_BaseNPC_Hero = {}

function CEntityInstance:IsNull() end

function CDOTA_BaseNPC_Hero:FindAbilityByName(abilityName) end

function CDOTA_BaseNPC_Hero:HasTalent(talentName)
	if self and not self:IsNull() then
		local talent = self:FindAbilityByName(talentName)
		if talent and talent:GetLevel() > 0 then return true end
	end
	return false
end

Screenshots
image

Environment

  • OS: Windows 10
  • Client: VSCode
@sumneko sumneko added the bug Something isn't working label Feb 25, 2021
@sumneko sumneko closed this as completed in 916820f Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants