Table of Contents

Class RoslynRepository

Namespace
Alternet.Syntax.Parsers.Roslyn.CodeCompletion
Assembly
Alternet.Syntax.Parsers.Roslyn.v9.dll

Represents properties and methods to perform code completion functionality intended to use for Roslyn supported languages.

public class RoslynRepository : CodeCompletionRepository, IRoslynRepository, ICodeCompletionRepository, IDisposable, IUpdate
Inheritance
RoslynRepository
Implements
Derived

Constructors

RoslynRepository(ISyntaxParser, IRoslynSolution, bool)

Initializes a new instance of the RoslynRepository class with specified settings.

Properties

AlphaImages

Represents collection of alpha images used for code completion.

AlphaImagesHighDpi

Gets Alpha ImageList attached to this CodeCompletionRepository for high DPI.

Document

Represents a Microsoft.CodeAnalysis.Document contains code text.

DocumentId

Represents a Microsoft.CodeAnalysis.DocumentId contains code text.

Images

Represents collection of images used for code completion.

ImagesHighDpi

Gets ImageList attached to this CodeCompletionRepository for high DPI.

LexerColors
Model

Represents a Microsoft.CodeAnalysis.SemanticModel describes code text.

Owner
ProjectId

Represents a Microsoft.CodeAnalysis.ProjectId that contains document.

ProjectName

Gets or sets Project name containing document.

ShowItemsFromUnimportedNamespaces
Solution

Gets RoslynSolution associated with this Repository.

Text

Represents a Microsoft.CodeAnalysis.SourceText describes code text.

Tree

Represents a Microsoft.CodeAnalysis.SyntaxTree represents parsed code text.

UpdateCount

Keeps track of calls to BeginUpdate and EndUpdate so that they can be nested.

UseFormattService
UseIndentService

Methods

AddCodeFix(CodeAction, Document, bool, IList<ICodeFix>)
AddCodeRefactor(CodeAction, Document, bool, IList<ICodeRefactor>)
AddDocument(string, SourceText)

Adds a new document or replaces existing document with specified settings.

AddDocument(string, string)

Adds a new document or replaces existing document with specified settings.

AddFileReference(string)

Adds metadata reference to the project

AddImageReference(byte[])

Adds metadata reference to the project

AddReference(MetadataReference)

Adds metadata reference to the project

BeginUpdate()

WPrevents object state updating until calling EndUpdate method.

CanEvaluateSymbol(ISymbol)
CanProvideCodeCompletion(SyntaxNode, int)
CanUseIndentService(int)
CloseDocument()

Closes document which was opened in roslyn workspace.

CodeCompletionAsync(Point, CodeCompletionArgs, CancellationToken)

Performs code completion for the specified text representing language element.

CodeCompletionFocusMode(CompletionList, int)
CreateFormattedDocument(Document, SyntaxNode, TextSpan, bool, int)
DisableUpdate()

Prevents object state updating until calling EnableUpdate method.

Dispose(bool)
EnableUpdate()

Re-enables object state updating, that was turn of by calling DisableUpdate method. Using DisableUpdate/EnableUpdate to prevent notifying about updating the object state.

EndUpdate()

Re-enables object state updating, that was turn of by calling BeginUpdate method.

FillCodeFixes(IEnumerable<ICodeFix>, ICodeActionItems)
FillCodeRefactors(IEnumerable<ICodeRefactor>, ICodeActionItems)
FillMembers(Document, IReadOnlyList<CompletionItem>, IListMembers, out int)
FillParameterInfo(ISignatureHelpItems, IListMembers)
FindDeclaration(SemanticModel, SyntaxNode, bool, int)
FindDeclaration(SemanticModel, Point, bool)

When implemented by a class, finds the declaration node at given position.

FindImplementations(ISymbol, CancellationToken)

Finds the symbols that implement an interface or interface member.

FindNodeAt(SyntaxTree, Point, out SyntaxNode, out int)
FindReferencesAsync(ISymbol, bool, CancellationToken)

Locates all references to the symbol in the text.

FindTokenAt(SyntaxTree, Point, out SyntaxToken, out int)
FormatChanges(Document, SyntaxTree, ref SourceText, TextSpan, bool, int)
GetBlockNode(SyntaxNode)
GetBreakpointStatementAtPosition(Point)

Gets breakpoint statement range at pecified position.

GetChildActions(CodeAction)
GetCodeFixesAsync(ISyntaxError, bool, CancellationToken)

Retrieves all code fixes available for the given syntax error in async mode.

GetCodeFixesAsync(Document, ISyntaxError, bool, CancellationToken)
GetCodeRefactorsAsync(Document, TextSpan, bool, CancellationToken)
GetCodeRefactorsAsync(Point, Point, bool, CancellationToken)

Retrieves all applicable refactors at given range in async mode.

GetCodeSnippets(string)

Returns code snippets for the given language.

GetCustomFormattingOptions(OptionSet)
GetDeclarationAt(Point)

Gets IRange that corresponds to declaration at the specified position.

GetDiagnostics()

Get all the errors within the syntax tree associated with this object.

GetDocumentTextAndTree(out Document, out SourceText, out SyntaxTree)
GetFormatOptions(OptionSet, SyntaxNode, bool, int)
GetMatchingBlocksAt(SourceText, SyntaxNode, int, IList<IRange>)
GetModel(out SemanticModel, out SyntaxTree)

Gets the semantic model and syntax tree for this document.

GetNodeAt(Point)

Gets Microsoft.CodeAnalysis.SyntaxNode at specified position.

GetNodeAt(int)

Gets Microsoft.CodeAnalysis.SyntaxNode at specified line.

GetNodeName(SyntaxNode)
GetPointFromLinePos(LinePosition)
GetPosFromPosition(SourceText, Point)

Converts given position into absolute text coordinate.

GetPositionFromPos(SourceText, int)

Converts given pos into Point coordinate.

GetQuickInfoName(SyntaxNode)
GetRangeAt(Point)

Gets IRange that contains given position.

GetRangeAt(Point, IList<IRange>)

Gets IRange that contains given position.

GetSmartIndent(IIndentationProvider, int, bool, int)
GetSmartIndent(int, bool, bool, int)

Returns indentation string for specified line.

GetSyntaxTree(Document, out SyntaxTree)
GetTextChanges(CodeAction, DocumentId, bool, CancellationToken)
GetXmlComment()

Represents beginning of XML comment.

HasCodeFixesAsync(ISyntaxError, bool, CancellationToken)

Determines if any code fixes are available for the given syntax error in async mode.

HasCodeFixesAsync(Document, ISyntaxError, bool, CancellationToken)
HasCodeRefactorsAsync(Document, TextSpan, bool, CancellationToken)
HasCodeRefactorsAsync(Point, Point, bool, CancellationToken)

Determines if any code refactors are available at the given range in async mode.

HasSnippetMembers(string)
IsBlockNode(SyntaxNode, int)
IsBlockSyntax(SyntaxNode)
IsCloseToken(SyntaxToken, int)
IsCollapsible(SyntaxNode, out string, out TextSpan, bool)

Indicates whether specified Microsoft.CodeAnalysis.SyntaxNode can be outlined.

IsCollapsible(IEnumerable<SyntaxTrivia>, out string, out TextSpan)

Indicates whether specified Microsoft.CodeAnalysis.SyntaxTrivia list can be outlined.

IsContentDivider(SyntaxNode)
IsContentDivider(SyntaxNode, out TextSpan)

Gets boolean value indicating whether text content is divided at given line.

IsDeclarationNode(ref SyntaxNode)
IsIndentNode(SyntaxNode, int)
IsIndentToken(SyntaxToken, int)
IsStructureGuideNode(SyntaxNode, out TextSpan)

Indicates whether specified Microsoft.CodeAnalysis.SyntaxNode is guide node.

IsSyntaxBlockNode(SyntaxNode)
IsValidChange(FileLinePositionSpan, TextSpan)
IsValidChange(FileLinePositionSpan, Point, Point)
IsValidChange(SyntaxTree, TextChange)
IsValidReferenceToken(SyntaxToken)
IsValidSmartFormatNode(SyntaxNode)
LoadImages()
MergeChanges(SourceText, IEnumerable<TextChange>, IEnumerable<TextChange>)
PreProcessFormatChanges(Document, SyntaxTree, SourceText, TextSpan)
ProcessAutoComplete(string, Point, out string)

Checks whether end-of-block code needs inserting.

ProcessSnippetBody(string, Point, out string)

Checks whether snippet body code needs inserting.

QuickInfo(int)
RegisterAssemblies(string[])

Registers assemblies in the project.

RegisterAssembly(string)

Registers assembly in the project.

RegisterCode(string, string)

Makes types declared in given source file accessible for code analysis.

RegisterCodeFiles(string[])

Makes types declared in given source files accessible for code analysis.

RegisterDefaultAssemblies(TechnologyEnvironment, bool, bool)

Registers default assemblies in the project.

RegisterDefaultNamespaces(TechnologyEnvironment)

Registers default namespaces in the project.

RegisterNamespaces(string[], string)

Registers global namespaces in the project.

RemoveDocument()

Removes document from document collection.

RemoveDocument(DocumentId)

Removes current document from document collection.

RemoveDocument(string)

Removes document from document collection.

ReplaceDocument(DocumentId, SourceText)

Adds a new document or replaces existing document with specified settings.

ReplaceDocument(DocumentId, string)

Adds a new document or replaces existing document with specified settings.

ShouldShowCompletionItem(CompletionItem)
SmartCapitalize(Point, Point, ITextUndoList)

Capitalizes block of text.

SmartFormat(Document, SyntaxTree, ref SourceText, TextSpan, bool, int)
SmartFormat(ref Point, bool, int, ITextUndoList)

Formats block of text according to the parser rules.

SmartFormat(ref Point, ref Point, bool, int, bool, ITextUndoList)

Formats block of text according to the parser rules.

TryGetBreakpointSpan(SyntaxTree, int, CancellationToken, out TextSpan)
UnregisterAssemblies(string[])

Unregisters assemblies from the project.

UnregisterAssembly(string)

Unregisters assembly from the project.

UnregisterCode(string)

Removes types declared in given source file from being accessible for code analysis.

UnregisterCodeFiles(string[])

Removes types declared in given source files from being accessible for code analysis.

Update()

Updates an object state.

Events

CustomFormattingOptions

Occurs when text document is being formatted to provide custom formatting options.