CodeModel\AbstractCodeModelObject_CodeGen.cs (18)
37var destination = CodeModelService.GetDestination(containerNode);
41accessibility: CodeModelService.GetAccessibility(access, SymbolKind.Method, destination),
54var destination = CodeModelService.GetDestination(containerNode);
68var destination = CodeModelService.GetDestination(containerNode);
72accessibility: CodeModelService.GetAccessibility(access, SymbolKind.NamedType, destination),
85var destination = CodeModelService.GetDestination(containerNode);
117accessibility: CodeModelService.GetAccessibility(access, SymbolKind.Event, destination),
131var destination = CodeModelService.GetDestination(containerNode);
135accessibility: CodeModelService.GetAccessibility(access, SymbolKind.Field, destination),
136modifiers: new DeclarationModifiers(isWithEvents: CodeModelService.GetWithEvents(access)),
146var destination = CodeModelService.GetDestination(containerNode);
150accessibility: CodeModelService.GetAccessibility(access, SymbolKind.Method, destination),
181var destination = CodeModelService.GetDestination(containerNode);
196statements: [CodeModelService.CreateReturnDefaultValueStatement(type)]);
216accessibility: CodeModelService.GetAccessibility(access, SymbolKind.Field, destination),
232var destination = CodeModelService.GetDestination(containerNode);
248var destination = CodeModelService.GetDestination(containerNode);
252accessibility: CodeModelService.GetAccessibility(access, SymbolKind.NamedType, destination),
CodeModel\Collections\NamespaceCollection.cs (23)
72CodeModelService.GetOptionNameAndOrdinal(parentNode, node, out var name, out var ordinal);
79var name = CodeModelService.GetImportNamespaceOrType(node);
86CodeModelService.GetAttributeNameAndOrdinal(parentNode, node, out var name, out var ordinal);
99.. CodeModelService.GetOptionNodes(node),
100.. CodeModelService.GetImportNodes(node),
101.. CodeModelService.GetAttributeNodes(node),
102.. CodeModelService.GetLogicalSupportedMemberNodes(node),
116var optionNodes = CodeModelService.GetOptionNodes(node);
128var importNodes = CodeModelService.GetImportNodes(node);
140var attributeNodes = CodeModelService.GetAttributeNodes(node);
152var memberNodes = CodeModelService.GetLogicalSupportedMemberNodes(node);
173foreach (var child in CodeModelService.GetOptionNodes(node))
175CodeModelService.GetOptionNameAndOrdinal(node, child, out var childName, out var ordinal);
184foreach (var child in CodeModelService.GetImportNodes(node))
186var childName = CodeModelService.GetImportNamespaceOrType(child);
195foreach (var child in CodeModelService.GetAttributeNodes(node))
197CodeModelService.GetAttributeNameAndOrdinal(node, child, out var childName, out var ordinal);
206foreach (var child in CodeModelService.GetLogicalSupportedMemberNodes(node))
208var childName = CodeModelService.GetName(child);
226CodeModelService.GetOptionNodes(node).Count() +
227CodeModelService.GetImportNodes(node).Count() +
228CodeModelService.GetAttributeNodes(node).Count() +
229CodeModelService.GetLogicalSupportedMemberNodes(node).Count();
CodeModel\FileCodeModel.cs (11)
130CodeModelService.DetachFormatTrackingToBuffer(_invisibleEditor.TextBuffer);
240var nodeKey = CodeModelService.TryGetNodeKey(node);
268return (T)CodeModelService.CreateInternalCodeElement(this.State, this, node);
288CodeModelService.AttachFormatTrackingToBuffer(_invisibleEditor.TextBuffer);
300CodeModelService.DetachFormatTrackingToBuffer(_invisibleEditor.TextBuffer);
460=> CodeModelService.LookupNode(nodeKey, GetSyntaxTree());
466return AddAttribute(GetSyntaxRoot(), name, value, position, target: CodeModelService.AssemblyAttributeString);
607var node = parent?.AncestorsAndSelf().FirstOrDefault(n => CodeModelService.MatchesScope(n, scope));
620(scope == EnvDTE.vsCMElement.vsCMElementFunction && CodeModelService.IsAccessorNode(node)))
625return CodeModelService.CreateInternalCodeElement(State, this, node);
714CodeModelService.EnsureBufferFormatted(_invisibleEditor.TextBuffer);
CodeModel\FileCodeModel_CodeGen.cs (105)
27var resultNode = CodeModelService.InsertAttribute(
38var resultNode = CodeModelService.InsertAttributeArgument(
49var resultNode = CodeModelService.InsertImport(
60var resultNode = CodeModelService.InsertMember(
71var resultNode = CodeModelService.InsertParameter(
80var element = CodeModelService.CreateInternalCodeElement(state, fileCodeModel, node);
97return CodeModelService.UpdateNode(document, node, updatedNode, CancellationToken.None);
145var attributeArgumentNode = CodeModelService.CreateAttributeArgumentNode(CodeModelService.GetUnescapedName(name), value);
146var insertionIndex = CodeModelService.PositionVariantToAttributeArgumentInsertionIndex(position, containerNode, fileCodeModel: this);
150return (EnvDTE80.CodeAttributeArgument)CodeModelService.CreateInternalCodeElement(this.State, fileCodeModel: this, node: newNode);
155containerNode = CodeModelService.GetNodeWithAttributes(containerNode);
156var attributeNode = CodeModelService.CreateAttributeNode(CodeModelService.GetUnescapedName(name), value, target);
157var insertionIndex = CodeModelService.PositionVariantToAttributeInsertionIndex(position, containerNode, fileCodeModel: this);
161return (EnvDTE.CodeAttribute)CodeModelService.CreateInternalCodeElement(this.State, fileCodeModel: this, node: newNode);
166var typeSymbol = CodeModelService.GetTypeSymbol(type, this.GetSemanticModel(), containerNode.SpanStart);
169var parameterNode = CodeModelService.CreateParameterNode(CodeModelService.GetUnescapedName(name), typeName);
170var insertionIndex = CodeModelService.PositionVariantToParameterInsertionIndex(position, containerNode, fileCodeModel: this);
186return CodeParameter.Create(this.State, parentObj, CodeModelService.GetParameterName(newNode));
199? (INamedTypeSymbol?)CodeModelService.GetTypeSymbol(baseArray[0], semanticModel, containerNodePosition)
205i => (INamedTypeSymbol)CodeModelService.GetTypeSymbol(i, semanticModel, containerNodePosition));
210CodeModelService.GetUnescapedName(name),
216var insertionIndex = CodeModelService.PositionVariantToMemberInsertionIndex(position, containerNode, fileCodeModel: this);
229var returnType = (INamedTypeSymbol)CodeModelService.GetTypeSymbol(type, semanticModel, containerNodePosition);
231var newType = CreateDelegateTypeDeclaration(containerNode, CodeModelService.GetUnescapedName(name), access, returnType, options);
232var insertionIndex = CodeModelService.PositionVariantToMemberInsertionIndex(position, containerNode, fileCodeModel: this);
246var insertionIndex = CodeModelService.PositionVariantToMemberInsertionIndex(position, containerNode, fileCodeModel: this);
269var newField = CreateFieldDeclaration(containerNode, CodeModelService.GetUnescapedName(name), EnvDTE.vsCMAccess.vsCMAccessPublic, type, options);
272newField = CodeModelService.AddInitExpression(newField, (string)value);
275var insertionIndex = CodeModelService.PositionVariantToMemberInsertionIndex(position, containerNode, fileCodeModel: this);
288var eventType = (INamedTypeSymbol)CodeModelService.GetTypeSymbol(fullDelegateName, semanticModel, containerNodePosition);
290var newEvent = CreateEventDeclaration(containerNode, CodeModelService.GetUnescapedName(name), access, eventType, options, createPropertyStyleEvent);
291var insertionIndex = CodeModelService.PositionVariantToMemberInsertionIndex(position, containerNode, fileCodeModel: this);
301kind = CodeModelService.ValidateFunctionKind(containerNode, kind, name);
311? CodeModelService.GetTypeSymbol(type, semanticModel, containerNodePosition)
314newMember = CreateMethodDeclaration(containerNode, CodeModelService.GetUnescapedName(name), access, returnType, options);
318newMember = CreateConstructorDeclaration(containerNode, CodeModelService.GetUnescapedName(name), access, options);
322newMember = CreateDestructorDeclaration(containerNode, CodeModelService.GetUnescapedName(name), options);
325var insertionIndex = CodeModelService.PositionVariantToMemberInsertionIndex(position, containerNode, fileCodeModel: this);
334var importNode = CodeModelService.CreateImportNode(CodeModelService.GetUnescapedName(name), alias);
335var insertionIndex = CodeModelService.PositionVariantToImportInsertionIndex(position, containerNode, fileCodeModel: this);
339return (EnvDTE80.CodeImport)CodeModelService.CreateInternalCodeElement(this.State, fileCodeModel: this, node: newNode);
351i => (INamedTypeSymbol)CodeModelService.GetTypeSymbol(i, semanticModel, containerNodePosition));
356CodeModelService.GetUnescapedName(name),
361var insertionIndex = CodeModelService.PositionVariantToMemberInsertionIndex(position, containerNode, fileCodeModel: this);
372var insertionIndex = CodeModelService.PositionVariantToMemberInsertionIndex(position, containerNode, fileCodeModel: this);
394var propertyType = CodeModelService.GetTypeSymbol(type, semanticModel, containerNodePosition);
397CodeModelService.GetUnescapedName(isGetterPresent ? getterName : putterName),
403var insertionIndex = CodeModelService.PositionVariantToMemberInsertionIndex(position, containerNode, fileCodeModel: this);
421i => (INamedTypeSymbol)CodeModelService.GetTypeSymbol(i, semanticModel, containerNodePosition));
426CodeModelService.GetUnescapedName(name),
431var insertionIndex = CodeModelService.PositionVariantToMemberInsertionIndex(position, containerNode, fileCodeModel: this);
444var fieldType = CodeModelService.GetTypeSymbol(type, semanticModel, containerNodePosition);
445var newField = CreateFieldDeclaration(containerNode, CodeModelService.GetUnescapedName(name), access, fieldType, options);
446var insertionIndex = CodeModelService.PositionVariantToMemberInsertionIndex(position, containerNode, fileCodeModel: this);
455node = CodeModelService.GetNodeWithModifiers(node);
456var updatedNode = CodeModelService.SetAccess(node, access);
466node = CodeModelService.GetAttributeTargetNode(node);
467var updatedNode = CodeModelService.SetAttributeTarget(node, value);
477var updatedNode = CodeModelService.SetAttributeValue(node, value);
487node = CodeModelService.GetNodeWithModifiers(node);
488var updatedNode = CodeModelService.SetCanOverride(node, value);
498node = CodeModelService.GetNodeWithModifiers(node);
499var updatedNode = CodeModelService.SetClassKind(node, kind);
509node = CodeModelService.GetNodeWithModifiers(node);
510var updatedNode = CodeModelService.SetComment(node, value);
520node = CodeModelService.GetNodeWithModifiers(node);
521var updatedNode = CodeModelService.SetConstKind(node, kind);
531node = CodeModelService.GetNodeWithModifiers(node);
532var updatedNode = CodeModelService.SetDataTypeKind(node, kind);
542node = CodeModelService.GetNodeWithModifiers(node);
543var updatedNode = CodeModelService.SetDocComment(node, value);
553node = CodeModelService.GetNodeWithModifiers(node);
554var updatedNode = CodeModelService.SetInheritanceKind(node, kind);
564node = CodeModelService.GetNodeWithModifiers(node);
565var updatedNode = CodeModelService.SetIsConstant(node, value);
575node = CodeModelService.GetNodeWithModifiers(node);
576var updatedNode = CodeModelService.SetIsDefault(node, value);
586node = CodeModelService.GetNodeWithModifiers(node);
587var updatedNode = CodeModelService.SetIsShared(node, value);
597node = CodeModelService.GetNodeWithModifiers(node);
598var updatedNode = CodeModelService.SetMustImplement(node, value);
608node = CodeModelService.GetNodeWithName(node);
609var updatedNode = CodeModelService.SetName(node, name);
619node = CodeModelService.GetNodeWithModifiers(node);
620var updatedNode = CodeModelService.SetOverrideKind(node, kind);
630var updatedNode = CodeModelService.SetParameterKind(node, kind);
640node = CodeModelService.GetNodeWithInitializer(node);
641var updatedNode = CodeModelService.AddInitExpression(node, initExpression);
651node = CodeModelService.GetNodeWithType(node);
653? CodeModelService.GetTypeSymbolFromFullName(codeTypeRef.AsFullName, GetCompilation())
656var updatedNode = CodeModelService.SetType(node, typeSymbol);
697var typeSymbol = CodeModelService.GetTypeSymbol(@base, semanticModel, node.SpanStart);
702!CodeModelService.IsValidBaseType(node, typeSymbol))
709var updatedNode = CodeModelService.AddBase(node, typeSymbol, semanticModel, realPosition);
720var typeSymbol = CodeModelService.GetTypeSymbol(element, semanticModel, node.SpanStart);
722var updatedNode = CodeModelService.RemoveBase(node, typeSymbol, semanticModel);
733var typeSymbol = CodeModelService.GetTypeSymbol(@base, semanticModel, node.SpanStart);
738!CodeModelService.IsValidInterfaceType(node, typeSymbol))
745var updatedNode = CodeModelService.AddImplementedInterface(node, typeSymbol, semanticModel, realPosition);
758var typeSymbol = CodeModelService.GetTypeSymbol(element, semanticModel, node.SpanStart);
760var updatedNode = CodeModelService.RemoveImplementedInterface(node, typeSymbol, semanticModel);
CodeModel\InternalElements\AbstractCodeElement.cs (9)
102return CodeModelService.GetName(node);
118return CodeModelService.GetFullName(node, semanticModel);
149var point = CodeModelService.GetStartPoint(LookupNode(), options);
164var point = CodeModelService.GetEndPoint(LookupNode(), options);
177var point = CodeModelService.GetStartPoint(LookupNode(), options, part);
189var point = CodeModelService.GetEndPoint(LookupNode(), options, part);
248CodeModelService.Rename(LookupSymbol(), newName, this.Workspace, this.State.ProjectCodeModelFactory);
254return CodeModelService.Delete(document, node);
270=> CodeModelService.GetPrototype(LookupNode(), LookupSymbol(), (PrototypeFlags)flags);