Makes local record field completion respects the fields sharing one single type signature #2439
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, HLS generates wrong completion snippets for a record with some fields sharing the same type signature.
For example, consider the following:
Above,
arg1, arg2
shares the sameInt
signature and this is a completely legitimate definition.If this is defined in a local module, the current HLS generates the following record snippet for
Foo
, which lacksarg2
:The base cause of this seems as follows.
HLS handles record snippets for datatypes in a local module via parsed modules (
findRecordCompl
logic), especially from theRecCon
constructor.In
RecCon
, field information is stored as a list ofConDeclField
s, which stores field label information incd_fld_names
field.This
cd_fld_names
is a list ofLFieldOcc
s, and it seems that this nested structure reflects the signature-sharing relation.The current implementation in HLS, however, picks only the first element of
cd_fld_names
, resulting in the incomplete completion snippet.This PR aims at fixing this issue by just returning lists as-is.