papyrus-lang icon indicating copy to clipboard operation
papyrus-lang copied to clipboard

Papyrus events and functions do not respect the member doc string on hovers.

Open Scrivener07 opened this issue 4 years ago • 0 comments

Describe the bug Papyrus events and functions do not respect the member doc string on hovers. For properties, the doc string is shown on hovering.

To Reproduce Steps to reproduce the behavior:

These doc strings are displayed for hovers

Group Assembly
	string Property FileName Hidden
		{The data file plugin name.}
		string Function Get()
			return GetFileName()
		EndFunction
	EndProperty
	string Property FileExtension Hidden
		{The data file plugin name.}
		string Function Get()
			return GetFileExtension()
		EndFunction
	EndProperty
	string Property File Hidden
		{The data file plugin.}
		string Function Get()
			return GetFile()
		EndFunction
	EndProperty
EndGroup

These doc strings are NOT displayed.

; @virtual
string Function GetFileName()
	{The data file plugin name.}
	return "Fallout4"
EndFunction

; @virtual
string Function GetFileExtension()
	{The data file plugin extension.}
	return "esm"
EndFunction

; @virtual
string Function GetFile()
	{The data file plugin.}
	return FileName+"."+FileExtension
EndFunction

The documentation string for members is the ideal value for reading comments.

A strong argument for this is that Papyrus comments are tossed out on compilation while a doc string is preserved in the assembly. If only the standard comments are supported for Intellisense then this may encourage people to stop using the doc string resulting in more undocumented papyrus scripts, in cases where source is not available.

An example of function member doc strings preserved in Papyrus assembly.

.info
  .source "E:\\Games\\Steam\\steamapps\\common\\Fallout 4\\Data\\Scripts\\Source\\System\\System\\Collections\\List.psc"
  .modifyTime 1563066640
  .compileTime 1563329531
  .user "Scrivener07"
  .computer "KS07"
.endInfo
.userFlagsRef
  .flag mandatory 5
  .flag conditional 1
  .flag default 2
  .flag collapsedonbase 4
  .flag hidden 0
  .flag collapsedonref 3
.endUserFlagsRef
.objectTable
  .object System:Collections:List System:Collections:Collection 
    .userFlags 4
    .docString "Represents a list of objects that can be accessed by index.\nhttps://msdn.microsoft.com/en-us/library/6sh2ey19(v=vs.110).aspx"
    .autoState 
    .structTable
    .endStructTable
    .variableTable
      .variable Items var[] 
        .userFlags 0
        .initialValue None
      .endVariable
    .endVariableTable
    .propertyTable
	  .property Count int
	    .userFlags 1
	    .docString ""
	    .function Get 
	      .userFlags 0
	      .docString "Gets the number of elements contained in the collection."
	      .return int
	      .paramTable
	      .endParamTable
	      .localTable
	        .local ::temp9 int
	      .endLocalTable
	      .code
	        ARRAYLENGTH ::temp9 Items ;@line 90
	        RETURN ::temp9 ;@line 90
	      .endCode
	    .endFunction
	  .endProperty
    .endPropertyTable
    .propertyGroupTable
      .propertyGroup Collection
        .userFlags 0
        .docString ""
        .property Count
      .endPropertyGroup
    .endPropertyGroupTable
    .stateTable
      .state
        .function Type static
          .userFlags 0
          .docString ""
          .return system:collections:list
          .paramTable
          .endParamTable
          .localTable
            .local ::temp0 system:activator
            .local ::temp1 var
            .local ::temp2 system:collections:list
          .endLocalTable
          .code
            CALLSTATIC system:activator This ::temp0  ;@line 15
            CALLMETHOD Type ::temp0 ::temp1 2106 ;@line 15
            CAST ::temp2 ::temp1 ;@line 15
            RETURN ::temp2 ;@line 15
          .endCode
        .endFunction
        .function OnInit 
          .userFlags 0
          .docString ""
          .return NONE
          .paramTable
          .endParamTable
          .localTable
            .local ::temp3 var[]
          .endLocalTable
          .code
            ARRAYCREATE ::temp3 0 ;@line 23
            ASSIGN Items ::temp3 ;@line 23

          .endCode
        .endFunction
        .function IndexOf 
          .userFlags 0
          .docString "Determines the index of a specific item in the IList."
          .return int
          .paramTable
            .param value var
          .endParamTable
          .localTable
            .local ::temp4 int
          .endLocalTable
          .code
            JUMPF value label1 ;@line 32
            ARRAYFINDELEMENT Items ::temp4 value 0 ;@line 33
            RETURN ::temp4 ;@line 33
            JUMP label0
            label1:
            PROPGET Invalid self ::temp4 ;@line 35
            RETURN ::temp4 ;@line 35
            label0:
          .endCode
        .endFunction
        .function Contains 
          .userFlags 0
          .docString "Determines whether an element is in the IList."
          .return bool
          .paramTable
            .param value var
          .endParamTable
          .localTable
            .local ::temp5 int
            .local ::temp6 int
            .local ::temp7 bool
          .endLocalTable
          .code
            CALLMETHOD IndexOf self ::temp5 value ;@line 42
            PROPGET Invalid self ::temp6 ;@line 42
            COMPAREGT ::temp7 ::temp5 ::temp6 ;@line 42
            RETURN ::temp7 ;@line 42
          .endCode
        .endFunction
        .function Add 
          .userFlags 0
          .docString "Calling this method always throws a NotSupportedException exception."
          .return NONE
          .paramTable
            .param value var
          .endParamTable
          .localTable
            .local ::nonevar none
          .endLocalTable
          .code
            ARRAYADDELEMENTS Items value 1 ;@line 48
          .endCode
        .endFunction
        .function Insert 
          .userFlags 0
          .docString "Inserts an item to the IList at the specified index."
          .return NONE
          .paramTable
            .param index int
            .param value var
          .endParamTable
          .localTable
            .local ::nonevar none
          .endLocalTable
          .code
            ARRAYINSERTELEMENT Items value index ;@line 54
          .endCode
        .endFunction
        .function Remove 
          .userFlags 0
          .docString "Removes the first occurrence of a specific value from the IList."
          .return NONE
          .paramTable
            .param value var
          .endParamTable
          .localTable
            .local ::temp8 int
            .local ::nonevar none
            .local index int
          .endLocalTable
          .code
            CALLMETHOD IndexOf self ::temp8 value ;@line 60
            ASSIGN index ::temp8 ;@line 60
            ARRAYREMOVEELEMENTS Items index 1 ;@line 61
          .endCode
        .endFunction
        .function RemoveAt 
          .userFlags 0
          .docString "Removes the IList item at the specified index."
          .return NONE
          .paramTable
            .param index int
          .endParamTable
          .localTable
            .local ::nonevar none
          .endLocalTable
          .code
            ARRAYREMOVEELEMENTS Items index 1 ;@line 67
          .endCode
        .endFunction
        .function Clear 
          .userFlags 0
          .docString "Removes all items from the IList."
          .return NONE
          .paramTable
          .endParamTable
          .localTable
            .local ::nonevar none
          .endLocalTable
          .code
            ARRAYCLEARELEMENTS Items  ;@line 73
          .endCode
        .endFunction
      .endState
    .endStateTable
  .endObject
.endObjectTable

Scrivener07 avatar Jul 17 '19 02:07 Scrivener07