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

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

Closed
Scrivener07 opened this issue Jul 17, 2019 · 2 comments
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists language service

Comments

@Scrivener07
Copy link
Collaborator

Scrivener07 commented Jul 17, 2019

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
@joelday
Copy link
Owner

joelday commented Sep 27, 2023

{The data file plugin name.} above a statement like a return isn't viable, but I think it's reasonable to include both doc comments and (contiguous) ; comments on any symbol declaration for language service features. (Useful in code, bad in CK, for example.)

@joelday
Copy link
Owner

joelday commented Sep 27, 2023

Closed in favor of #87

@joelday joelday closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2023
@joelday joelday added the duplicate This issue or pull request already exists label Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists language service
Projects
None yet
Development

No branches or pull requests

2 participants