1 write to SemanticModel
Microsoft.CodeAnalysis.Workspaces (1)
Editing\DocumentEditor.cs (1)
22
SemanticModel
= model;
67 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.CSharp.NetAnalyzers (11)
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.FixAllProvider.cs (3)
42
IBlockOperation? block = editor.
SemanticModel
.GetOperation(node, fixAllContext.CancellationToken).GetFirstParentBlock();
46
identifierGenerator = new IdentifierGenerator(editor.
SemanticModel
, node.SpanStart);
50
identifierGenerator = scopeMap[block] = new IdentifierGenerator(editor.
SemanticModel
, block);
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.Fixer.cs (5)
76
var identifierGenerator = new IdentifierGenerator(editor.
SemanticModel
, node.SpanStart);
89
var operation = (IInvocationOperation)editor.
SemanticModel
.GetOperation(node, ct)!;
114
(ExpressionSyntax)editor.Generator.CastExpression(editor.
SemanticModel
.Compilation.CreatePointerTypeSymbol(operation.Arguments[0].Value.Type!),
161
editor.
SemanticModel
.Compilation.CreatePointerTypeSymbol(underlyingType),
179
editor.
SemanticModel
.Compilation.CreatePointerTypeSymbol(type),
Microsoft.NetCore.Analyzers\InteropServices\CSharpDynamicInterfaceCastableImplementation.Fixer.cs (3)
174
var defaultMethodBodyStatements = generator.DefaultMethodBody(editor.
SemanticModel
.Compilation).ToArray();
176
var symbol = editor.
SemanticModel
.GetDeclaredSymbol(declaration, cancellationToken);
187
SymbolInfo introducedThisParamInfo = editor.
SemanticModel
.GetSpeculativeSymbolInfo(
Microsoft.CodeAnalysis.Features (2)
PullMemberUp\MembersPuller.cs (1)
372
destinationEditor.
SemanticModel
.Compilation,
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
83
var symbol = documentEditor.
SemanticModel
.GetDeclaredSymbol(node, cancellationToken);
Microsoft.Interop.ComInterfaceGenerator (4)
Analyzers\AddGeneratedComClassFixer.cs (1)
28
var attribute = gen.Attribute(gen.TypeExpression(editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.GeneratedComClassAttribute)).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation));
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (3)
75
var comp = editor.
SemanticModel
.Compilation;
76
var declaringType = editor.
SemanticModel
.GetDeclaredSymbol(node, ct);
125
IMethodSymbol method = (IMethodSymbol)editor.
SemanticModel
.GetDeclaredSymbol(member, ct);
Microsoft.Interop.LibraryImportGenerator (45)
Analyzers\ConvertToLibraryImportFixer.cs (14)
169
if (editor.
SemanticModel
.GetDeclaredSymbol(methodSyntax, cancellationToken) is not IMethodSymbol methodSymbol)
205
INamedTypeSymbol? dllImportAttrType = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.DllImportAttribute);
210
INamedTypeSymbol libraryImportAttrType = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.LibraryImportAttribute)!;
251
editor.Generator.TypeExpression(editor.
SemanticModel
.Compilation.GetSpecialType(SpecialType.System_Int32)));
404
editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(
456
ITypeSymbol stringMarshallingType = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.StringMarshalling)!;
465
ITypeSymbol stringMarshallingType = editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.StringMarshalling)!;
473
generator.TypeOfExpression(generator.TypeExpression(editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.AnsiStringMarshaller)))));
577
if (editor.
SemanticModel
.Compilation.GetBestTypeByMetadataName(TypeNames.UnmanagedCallConvAttribute) is null)
593
CallingConvention.Cdecl => editor.
SemanticModel
.Compilation.ObjectType.ContainingAssembly.
595
CallingConvention.StdCall => editor.
SemanticModel
.Compilation.ObjectType.ContainingAssembly.
597
CallingConvention.ThisCall => editor.
SemanticModel
.Compilation.ObjectType.ContainingAssembly.
599
CallingConvention.FastCall => editor.
SemanticModel
.Compilation.ObjectType.ContainingAssembly.
620
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);