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

Fix LV code generation so that it honors source version of the project #380

Merged
merged 2 commits into from
Sep 13, 2024
Merged

Fix LV code generation so that it honors source version of the project #380

merged 2 commits into from
Sep 13, 2024

Conversation

jasonmreding
Copy link
Collaborator

Description

This PR fixes the following issues with LV code generation from a .proto file:

  • The generated converter VIs for oneofs (i.e. FlatToRich and RichToFlat variants) were not getting saved as source only. Because of this, the VIs must be saved in the editor version rather honoring the source version specified in the project in which the VIs are being added. This then results in a mix of source versions for the generated VIs since all of the other VIs are marked as source only.
  • Library icons are not consistently applied to generated client VIs.

Implementation

  • Added new Set Source Only.vi for scripting. This is then used when creating new oneof conversion VIs from a template. I'm not certain why we don't have similar issues with creating new VIs from template using the New VI node. I suspect it might be a bug with using a .vim template rather than a .vi template.
  • Updated Save Library.vi so that it applies the library icon to all members before saving. This ensures newly created VIs during the generation process receive the icon as well. Without this, the members of the library were mixed in which ones displayed the icon and which ones didn't.
  • Updated all template VIs so that they are source only. This is the first thing I tried, but it didn't end up fixing the generated VIs not being marked as source only. Never the less, this seems like a good idea so I kept the changes.

Testing

I manually tested generation using proto files used by this repo which is where these issue were originally encountered.

jasonmreding and others added 2 commits September 5, 2024 11:44
…ce only VIs. This allows the generated VIs to be saved in the correct source version for the project when using that feature with LV 2024 Q3 and later. Otherwise, you end up with a mix of VIs saved at the editor version and the source version specified by the project.

- Updating template VIs that were not marked as source only. All template VIs should now be marked as source only.
- Updating Save Library.vi so that it will automatically apply the library icon to all members of the library before saving. This ensures generated VIs that are added to the library have the correct icon when using a prototype library for the generation.
@jasonmreding jasonmreding merged commit d4b952a into ni:master Sep 13, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants