joelday / papyrus-lang

📜Advanced language tools for the Papyrus scripting language.
Other
105 stars 19 forks source link

Types are suggested on the class level but not local method bodies. #76

Closed Scrivener07 closed 5 years ago

Scrivener07 commented 5 years ago

Describe the bug Types are suggested on the class level but not local method bodies. That usually makes sense except for global methods which are called through a type. Structs also seem like a good suggestion in method bodies.

The idea is to populate any script type which exposes a Global into the suggestion widget for method bodies.

To Reproduce Steps to reproduce the behavior: vscode

Scriptname ChildType extends ScriptObject

; Types ARE suggested on the class level.

Event OnInit()
    ; Types are not suggested in local method bodies.
    GlobalType.GlobalGet()
    GlobalType.GlobalMethod()
    GlobalType.GlobalSet()

EndEvent
Scriptname GlobalType Native Const Hidden

Function GlobalMethod() Global
    ; code
EndFunction

Function GlobalGet() Global
    ; code
EndFunction

Function GlobalSet() Global
    ; code
EndFunction
minkir014 commented 5 years ago

Do you mean that completing class works in the global scope but not inside events?

Another question Do you intend to fix all the issues you have opened as soon as possible or it's a memory for the far feature?????

Scrivener07 commented 5 years ago

Do you mean that completing class works in the global scope but not inside events?

Global is like static in CSharp. Its a member which is accessed through the class type rather than a reference to an instance. The completion suggestions work for the global functions, but within a function or event body the needed type is not suggested. In the GIF above I manually type out GlobalType (which should be suggested) and once I press . the global functions are suggested as normal.

Another question Do you intend to fix all the issues you have opened as soon as possible or it's a memory for the far feature?????

That is ultimately up to Joel but in general "bugs" are considered top priorities. As far as I know, any feature that is planned but not actively developed is integrated unit testing for papyrus scripts and scaleform debug information for papyrus/actionscript interoperation.

joelday commented 5 years ago

The bug was that once you've typed anything, you're no longer directly under a statement block, you're inside of an identifier expression that isn't believed to be a type identifier yet. Let me know if you now see any scripts as suggestions that shouldn't be, though.