summaryrefslogtreecommitdiff
path: root/external/aspnetwebstack/src/System.Web.Razor/PartialParseResult.cs
blob: 4663a8cad6c344ce8115d8d44f3f4f7acca31a03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.

using System.Diagnostics.CodeAnalysis;

namespace System.Web.Razor
{
    // Flags:
    //  Provisional, ContextChanged, Accepted, Rejected
    //  000001 1  - Rejected,
    //  000010 2  - Accepted
    //  000100 4  - Provisional
    //  001000 8  - Context Changed
    //  010000 16 - Auto Complete Block

    /// <summary>
    /// The result of attempting an incremental parse
    /// </summary>
    /// <remarks>
    /// Either the Accepted or Rejected flag is ALWAYS set.  
    /// Additionally, Provisional may be set with Accepted and SpanContextChanged may be set with Rejected.
    /// Provisional may NOT be set with Rejected and SpanContextChanged may NOT be set with Accepted.
    /// </remarks>
    [Flags]
    [SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames", Justification = "The singular name is more appropriate here")]
    public enum PartialParseResult
    {
        /// <summary>
        /// Indicates that the edit could not be accepted and that a reparse is underway.
        /// </summary>
        Rejected = 1,

        /// <summary>
        /// Indicates that the edit was accepted and has been added to the parse tree
        /// </summary>
        Accepted = 2,

        /// <summary>
        /// Indicates that the edit was accepted, but that a reparse should be forced when idle time is available
        /// since the edit may be misclassified
        /// </summary>
        /// <remarks>
        /// This generally occurs when a "." is typed in an Implicit Expression, since editors require that this
        /// be assigned to Code in order to properly support features like IntelliSense.  However, if no further edits
        /// occur following the ".", it should be treated as Markup.
        /// </remarks>
        Provisional = 4,

        /// <summary>
        /// Indicates that the edit caused a change in the span's context and that if any statement completions were active prior to starting this
        /// partial parse, they should be reinitialized.
        /// </summary>
        SpanContextChanged = 8,

        /// <summary>
        /// Indicates that the edit requires an auto completion to occur
        /// </summary>
        AutoCompleteBlock = 16
    }
}