Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Have @page understand malformed directives. #1506

Merged
merged 1 commit into from
Jul 5, 2017
Merged

Conversation

NTaylorMullen
Copy link
Member

  • The @page directive will now look for malformed directives and treat a view as a Razor page based on the existence of the malformed directive.
  • Updated the PageDirective type to contain a reference to its responsible directive node.
  • Added unit tests to validate malformed directives were picked up accordingly.
  • Updated code generation test baselines to reflect the new malformed directive understanding.

#1448

/cc @rynowak @pranavkm

Copy link
Contributor

@pranavkm pranavkm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public DirectiveIntermediateNode DirectiveNode { get; private set; }
public IntermediateNode DirectiveNode { get; private set; }

public IEnumerable<DirectiveTokenIntermediateNode> DirectiveTokens { get; private set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why set this? As opposed to just doing node.DirectiveTokens at the callsite?

Copy link
Member Author

@NTaylorMullen NTaylorMullen Jul 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DirectiveNode is an IntermediateNode because it can be a malformed node or a non-malformed node.

- The `@page` directive will now look for malformed directives and treat a view as a Razor page based on the existence of the malformed directive.
- Updated the `PageDirective` type to contain a reference to its responsible directive node.
- Added unit tests to validate malformed directives were picked up accordingly.
- Updated code generation test baselines to reflect the new malformed directive understanding.

#1448
@NTaylorMullen NTaylorMullen merged commit a78202e into dev Jul 5, 2017
@NTaylorMullen NTaylorMullen deleted the nimullen/1448 branch July 5, 2017 23:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants