48 references to NamespaceImportDeclaration
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
101
.
NamespaceImportDeclaration
(namespaceSymbol.ToDisplayString(SymbolDisplayFormats.NameFormat))
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (22)
CodeGeneration\SyntaxGeneratorTests.cs (22)
1740
Generator.
NamespaceImportDeclaration
("n"),
1744
Generator.
NamespaceImportDeclaration
("n.m"),
1761
Generator.
NamespaceImportDeclaration
("m")),
1767
Generator.
NamespaceImportDeclaration
("m")),
1785
Generator.
NamespaceImportDeclaration
("n")),
1791
Generator.
NamespaceImportDeclaration
("m")),
1796
Generator.
NamespaceImportDeclaration
("n"),
1798
Generator.
NamespaceImportDeclaration
("m"),
2625
AssertNamesEqual("x.y", Generator.GetNamespaceImports(Generator.AddNamespaceImports(Generator.CompilationUnit(), Generator.
NamespaceImportDeclaration
("x.y"))));
2626
AssertNamesEqual(new[] { "x.y", "z" }, Generator.GetNamespaceImports(Generator.AddNamespaceImports(Generator.CompilationUnit(), Generator.
NamespaceImportDeclaration
("x.y"), Generator.IdentifierName("z"))));
2634
TestRemoveAllNamespaceImports(Generator.CompilationUnit(Generator.
NamespaceImportDeclaration
("x")));
2635
TestRemoveAllNamespaceImports(Generator.CompilationUnit(Generator.
NamespaceImportDeclaration
("x"), Generator.IdentifierName("y")));
2637
TestRemoveNamespaceImport(Generator.CompilationUnit(Generator.
NamespaceImportDeclaration
("x")), "x", []);
2638
TestRemoveNamespaceImport(Generator.CompilationUnit(Generator.
NamespaceImportDeclaration
("x"), Generator.IdentifierName("y")), "x", ["y"]);
2639
TestRemoveNamespaceImport(Generator.CompilationUnit(Generator.
NamespaceImportDeclaration
("x"), Generator.IdentifierName("y")), "y", ["x"]);
2889
Assert.Equal(DeclarationKind.NamespaceImport, Generator.GetDeclarationKind(Generator.
NamespaceImportDeclaration
("u")));
2912
Assert.Equal("u", Generator.GetName(Generator.
NamespaceImportDeclaration
("u")));
2935
Assert.Equal("u", Generator.GetName(Generator.WithName(Generator.
NamespaceImportDeclaration
("x"), "u")));
2958
Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.
NamespaceImportDeclaration
("u")));
2982
Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.
NamespaceImportDeclaration
("u"), Accessibility.Private)));
3006
Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.
NamespaceImportDeclaration
("u")));
3029
Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.WithModifiers(Generator.
NamespaceImportDeclaration
("u"), DeclarationModifiers.Abstract)));
Microsoft.CodeAnalysis.Features (2)
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
412
var import = syntaxGenerator.
NamespaceImportDeclaration
(name);
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
243
return syntaxGenerator.
NamespaceImportDeclaration
(namespaceName).WithAdditionalAnnotations(Formatter.Annotation);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicAddImportsService.vb (1)
56
result.Add(generator.
NamespaceImportDeclaration
(import.ToDisplayString()))
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicAddImportsService.vb (1)
56
result.Add(generator.
NamespaceImportDeclaration
(import.ToDisplayString()))
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (20)
CodeGeneration\SyntaxGeneratorTests.vb (20)
1663
Generator.
NamespaceImportDeclaration
("n"),
1667
Generator.
NamespaceImportDeclaration
("n.m"),
1685
Generator.
NamespaceImportDeclaration
("m")),
1694
Generator.
NamespaceImportDeclaration
("m")),
1719
Generator.
NamespaceImportDeclaration
("n")),
1726
Generator.
NamespaceImportDeclaration
("m")),
1735
Generator.
NamespaceImportDeclaration
("n"),
1737
Generator.
NamespaceImportDeclaration
("m"),
2584
Assert.Equal(DeclarationKind.NamespaceImport, Generator.GetDeclarationKind(Generator.
NamespaceImportDeclaration
("u")))
2609
Assert.Equal("u", Generator.GetName(Generator.
NamespaceImportDeclaration
("u")))
2634
Assert.Equal("u", Generator.GetName(Generator.WithName(Generator.
NamespaceImportDeclaration
("x"), "u")))
2656
Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.
NamespaceImportDeclaration
("u")))
2684
Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.
NamespaceImportDeclaration
("u"), Accessibility.Private)))
2711
Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.
NamespaceImportDeclaration
("u")))
2733
Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.WithModifiers(Generator.
NamespaceImportDeclaration
("u"), DeclarationModifiers.Abstract)))
3875
Generator.InsertNamespaceImports(declCU, 0, Generator.
NamespaceImportDeclaration
("N")),
3882
Generator.InsertNamespaceImports(declCU, 1, Generator.
NamespaceImportDeclaration
("N")),
3890
Generator.InsertNamespaceImports(declCU, 2, Generator.
NamespaceImportDeclaration
("N")),
3898
Generator.InsertNamespaceImports(declCU, 3, Generator.
NamespaceImportDeclaration
("N")),
3906
Generator.ReplaceNode(declCU, declX, Generator.
NamespaceImportDeclaration
("N")),
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
101
.
NamespaceImportDeclaration
(namespaceSymbol.ToDisplayString(SymbolDisplayFormats.NameFormat))