Skip to content

Conversation

@JohannesMeierSE
Copy link
Contributor

This PR is a follow-up of #1412 and #1766 and improves and extends the checks of multiple assignments (in the grammar) to the same feature/property (in the AST):

  • Validate the mixed use of ?=, = and += for the same feature: A warning (no error) is shown, if values are assigned with different operators to the same feature. This is prone to data loss, among others.
  • Contributed a new code action to replace the assignment operator = with +=.
  • Fixed bugs for the existing validation, when there are multiple assignments with = (or ?=):
    • Create validation markers for critical assignments in other documents in the currently validated document instead (a called fragment might be located in another document).
    • Validate rewrite actions as starting point in order not to validate and mark them twice (rewrite actions might be located in fragments, which might be called twice).
    • Handle circular calls of fragments
  • Wrote more test cases, in particular for the existing check for multiple assignments with ?= as assignment operator to the same feature.
  • Both validations (1st for mixing ?=, =and +=, and 2nd for multiple assignments with ?= or =) got an issue code, which is used in the 2nd case for a corresponding, new code action (for = only, see above) and which will be relevant for serializing ASTs back to text in the future.

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.

3 participants