1 write to SemanticModel
Microsoft.CodeAnalysis.Workspaces (1)
Editing\DocumentEditor.cs (1)
22
SemanticModel
= model;
58 references to SemanticModel
Microsoft.Analyzers.Extra (3)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (3)
144
var sm = docEditor.
SemanticModel
;
472
var sm = docEditor.
SemanticModel
;
582
var sm = docEditor.
SemanticModel
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
509
var operation = documentEditor.
SemanticModel
.GetRequiredOperation(objectCreationExpression, cancellationToken);
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
509
var operation = documentEditor.
SemanticModel
.GetRequiredOperation(objectCreationExpression, cancellationToken);
Microsoft.CodeAnalysis.Features (2)
PullMemberUp\MembersPuller.cs (1)
372
destinationEditor.
SemanticModel
,
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
83
var symbol = documentEditor.
SemanticModel
.GetDeclaredSymbol(node, cancellationToken);
Microsoft.Interop.ComInterfaceGenerator (6)
Analyzers\AddGeneratedComClassFixer.cs (3)
29
var declaringType = editor.
SemanticModel
.GetDeclaredSymbol(node, ct) as INamedTypeSymbol;
33
var attribute = gen.Attribute(gen.TypeExpression(editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.GeneratedComClassAttribute)).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation));
47
var comVisibleAttributeType = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.System_Runtime_InteropServices_ComVisibleAttribute);
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (3)
79
var comp = editor.
SemanticModel
.Compilation;
80
var declaringType = editor.
SemanticModel
.GetDeclaredSymbol(node, ct);
129
IMethodSymbol method = (IMethodSymbol)editor.
SemanticModel
.GetDeclaredSymbol(member, ct);
Microsoft.Interop.LibraryImportGenerator (45)
Analyzers\ConvertToLibraryImportFixer.cs (14)
181
if (editor.
SemanticModel
.GetDeclaredSymbol(methodSyntax, cancellationToken) is not IMethodSymbol methodSymbol)
217
INamedTypeSymbol? dllImportAttrType = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.DllImportAttribute);
222
INamedTypeSymbol libraryImportAttrType = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.LibraryImportAttribute)!;
263
editor.Generator.TypeExpression(editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_Int32)));
416
editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(
468
ITypeSymbol stringMarshallingType = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.StringMarshalling)!;
477
ITypeSymbol stringMarshallingType = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.StringMarshalling)!;
485
generator.TypeOfExpression(generator.TypeExpression(editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.AnsiStringMarshaller)))));
589
if (editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.UnmanagedCallConvAttribute) is null)
605
CallingConvention.Cdecl => editor.
SemanticModel
.Compilation.ObjectType.ContainingAssembly.
607
CallingConvention.StdCall => editor.
SemanticModel
.Compilation.ObjectType.ContainingAssembly.
609
CallingConvention.ThisCall => editor.
SemanticModel
.Compilation.ObjectType.ContainingAssembly.
611
CallingConvention.FastCall => editor.
SemanticModel
.Compilation.ObjectType.ContainingAssembly.
632
generator.TypeExpression(editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.System_Type)),
Analyzers\CustomMarshallerAttributeFixer.cs (31)
208
var (_, methods) = StatelessMarshallerShapeHelper.GetShapeForType(marshallerType, managedType, isLinearCollectionMarshaller, editor.
SemanticModel
.Compilation);
209
INamedTypeSymbol spanOfT = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.System_Span_Metadata)!;
210
INamedTypeSymbol readOnlySpanOfT = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.System_ReadOnlySpan_Metadata)!;
228
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
240
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
248
gen.TypeExpression(editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_Int32)),
251
gen.GetAccessorDeclaration(statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) })));
267
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
283
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
298
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
314
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
330
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
345
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
382
return gen.TypeExpression(editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_IntPtr));
396
return editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_IntPtr);
404
var (_, methods) = StatefulMarshallerShapeHelper.GetShapeForType(marshallerType, managedType, isLinearCollectionMarshaller, editor.
SemanticModel
.Compilation);
405
INamedTypeSymbol spanOfT = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.System_Span_Metadata)!;
406
INamedTypeSymbol readOnlySpanOfT = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.System_ReadOnlySpan_Metadata)!;
422
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
432
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
442
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
452
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
460
gen.TypeExpression(editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_Int32)),
463
gen.GetAccessorDeclaration(statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) })));
473
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
483
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
497
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
511
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
520
statements: new[] { DefaultMethodStatement(gen, editor.
SemanticModel
.Compilation) }));
549
return gen.TypeExpression(editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_IntPtr));
563
return editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_IntPtr);