CSharpSyntaxTree.Create Method

Definition

Overloads

Create(CSharpSyntaxNode, CSharpParseOptions, String, Encoding)

Creates a new syntax tree from a syntax node.

Create(CSharpSyntaxNode, CSharpParseOptions, String, Encoding, ImmutableDictionary<String,ReportDiagnostic>)
Obsolete.

Creates a new syntax tree from a syntax node.

Create(CSharpSyntaxNode, CSharpParseOptions, String, Encoding, ImmutableDictionary<String,ReportDiagnostic>, Nullable<Boolean>)
Obsolete.

Creates a new syntax tree from a syntax node.

Create(CSharpSyntaxNode, CSharpParseOptions, String, Encoding)

Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs

Creates a new syntax tree from a syntax node.

public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options = default, string path = "", System.Text.Encoding encoding = default);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options, string path, System.Text.Encoding encoding);
public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options = default, string path = "", System.Text.Encoding? encoding = default);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options, string path, System.Text.Encoding? encoding);
public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options = default, string? path = "", System.Text.Encoding? encoding = default);
static member Create : Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions * string * System.Text.Encoding -> Microsoft.CodeAnalysis.SyntaxTree
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
static member Create : Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions * string * System.Text.Encoding -> Microsoft.CodeAnalysis.SyntaxTree
Public Shared Function Create (root As CSharpSyntaxNode, Optional options As CSharpParseOptions = Nothing, Optional path As String = "", Optional encoding As Encoding = Nothing) As SyntaxTree
Public Shared Function Create (root As CSharpSyntaxNode, options As CSharpParseOptions, path As String, encoding As Encoding) As SyntaxTree

Parameters

path
String
encoding
Encoding

Returns

Attributes

Applies to

Create(CSharpSyntaxNode, CSharpParseOptions, String, Encoding, ImmutableDictionary<String,ReportDiagnostic>)

Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs

Caution

The diagnosticOptions parameter is obsolete due to performance problems, if you are passing non-null use CompilationOptions.SyntaxTreeOptionsProvider instead

Creates a new syntax tree from a syntax node.

public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options = default, string path = "", System.Text.Encoding encoding = default, System.Collections.Immutable.ImmutableDictionary<string,Microsoft.CodeAnalysis.ReportDiagnostic> diagnosticOptions = default);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[System.Obsolete("The diagnosticOptions parameter is obsolete due to performance problems, if you are passing non-null use CompilationOptions.SyntaxTreeOptionsProvider instead", false)]
public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options, string path, System.Text.Encoding? encoding, System.Collections.Immutable.ImmutableDictionary<string,Microsoft.CodeAnalysis.ReportDiagnostic>? diagnosticOptions);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options, string path, System.Text.Encoding encoding, System.Collections.Immutable.ImmutableDictionary<string,Microsoft.CodeAnalysis.ReportDiagnostic> diagnosticOptions);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options, string path, System.Text.Encoding? encoding, System.Collections.Immutable.ImmutableDictionary<string,Microsoft.CodeAnalysis.ReportDiagnostic>? diagnosticOptions);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[System.Obsolete("The diagnosticOptions parameter is obsolete due to performance problems, if you are passing non-null use CompilationOptions.SyntaxTreeOptionsProvider instead", false)]
public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options, string? path, System.Text.Encoding? encoding, System.Collections.Immutable.ImmutableDictionary<string,Microsoft.CodeAnalysis.ReportDiagnostic>? diagnosticOptions);
static member Create : Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions * string * System.Text.Encoding * System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic> -> Microsoft.CodeAnalysis.SyntaxTree
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
[<System.Obsolete("The diagnosticOptions parameter is obsolete due to performance problems, if you are passing non-null use CompilationOptions.SyntaxTreeOptionsProvider instead", false)>]
static member Create : Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions * string * System.Text.Encoding * System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic> -> Microsoft.CodeAnalysis.SyntaxTree
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
static member Create : Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions * string * System.Text.Encoding * System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic> -> Microsoft.CodeAnalysis.SyntaxTree
Public Shared Function Create (root As CSharpSyntaxNode, Optional options As CSharpParseOptions = Nothing, Optional path As String = "", Optional encoding As Encoding = Nothing, Optional diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) = Nothing) As SyntaxTree
Public Shared Function Create (root As CSharpSyntaxNode, options As CSharpParseOptions, path As String, encoding As Encoding, diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic)) As SyntaxTree

Parameters

path
String
encoding
Encoding

Returns

Attributes

Applies to

Create(CSharpSyntaxNode, CSharpParseOptions, String, Encoding, ImmutableDictionary<String,ReportDiagnostic>, Nullable<Boolean>)

Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs
Source:
CSharpSyntaxTree.cs

Caution

The diagnosticOptions and isGeneratedCode parameters are obsolete due to performance problems, if you are using them use CompilationOptions.SyntaxTreeOptionsProvider instead

Creates a new syntax tree from a syntax node.

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[System.Obsolete("The diagnosticOptions and isGeneratedCode parameters are obsolete due to performance problems, if you are using them use CompilationOptions.SyntaxTreeOptionsProvider instead", false)]
public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options, string path, System.Text.Encoding? encoding, System.Collections.Immutable.ImmutableDictionary<string,Microsoft.CodeAnalysis.ReportDiagnostic>? diagnosticOptions, bool? isGeneratedCode);
public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options = default, string path = "", System.Text.Encoding encoding = default, System.Collections.Immutable.ImmutableDictionary<string,Microsoft.CodeAnalysis.ReportDiagnostic> diagnosticOptions = default, bool? isGeneratedCode = default);
public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options = default, string path = "", System.Text.Encoding? encoding = default, System.Collections.Immutable.ImmutableDictionary<string,Microsoft.CodeAnalysis.ReportDiagnostic>? diagnosticOptions = default, bool? isGeneratedCode = default);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[System.Obsolete("The diagnosticOptions and isGeneratedCode parameters are obsolete due to performance problems, if you are using them use CompilationOptions.SyntaxTreeOptionsProvider instead", false)]
public static Microsoft.CodeAnalysis.SyntaxTree Create (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode root, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options, string? path, System.Text.Encoding? encoding, System.Collections.Immutable.ImmutableDictionary<string,Microsoft.CodeAnalysis.ReportDiagnostic>? diagnosticOptions, bool? isGeneratedCode);
static member Create : Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions * string * System.Text.Encoding * System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic> * Nullable<bool> -> Microsoft.CodeAnalysis.SyntaxTree
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
[<System.Obsolete("The diagnosticOptions and isGeneratedCode parameters are obsolete due to performance problems, if you are using them use CompilationOptions.SyntaxTreeOptionsProvider instead", false)>]
static member Create : Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions * string * System.Text.Encoding * System.Collections.Immutable.ImmutableDictionary<string, Microsoft.CodeAnalysis.ReportDiagnostic> * Nullable<bool> -> Microsoft.CodeAnalysis.SyntaxTree
Public Shared Function Create (root As CSharpSyntaxNode, options As CSharpParseOptions, path As String, encoding As Encoding, diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic), isGeneratedCode As Nullable(Of Boolean)) As SyntaxTree
Public Shared Function Create (root As CSharpSyntaxNode, Optional options As CSharpParseOptions = Nothing, Optional path As String = "", Optional encoding As Encoding = Nothing, Optional diagnosticOptions As ImmutableDictionary(Of String, ReportDiagnostic) = Nothing, Optional isGeneratedCode As Nullable(Of Boolean) = Nothing) As SyntaxTree

Parameters

path
String
encoding
Encoding
diagnosticOptions
ImmutableDictionary<String,ReportDiagnostic>

An obsolete parameter. Diagnostic options should now be passed with SyntaxTreeOptionsProvider

isGeneratedCode
Nullable<Boolean>

An obsolete parameter. It is unused.

Returns

Attributes

Applies to