blob: 628463284a46351b5a93393c43a6de3e6467733f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading;
using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
using Microsoft.CodeAnalysis.CSharp;
namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
{
internal class SwitchKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
{
public SwitchKeywordRecommender()
: base(SyntaxKind.SwitchKeyword)
{
}
protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
{
return
context.IsStatementContext ||
context.IsGlobalStatementContext;
}
}
}
|