Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1a2bd02
changes to add the formatter to the Sdk
Oct 19, 2021
53a155c
exclude pdbs from sdk
Oct 19, 2021
01351c5
just moving the target
Oct 19, 2021
ad4d1aa
Version parsing ignores suffix
ScottCarda-MS Oct 19, 2021
2cdb049
fixing the formatter file paths
Oct 20, 2021
3188d82
adding formatting with a todo for the implementation
Oct 21, 2021
35e466a
formatting is enabled and works
Oct 21, 2021
d5fbb2e
... and the corresponding code action.
Oct 21, 2021
a31adc9
additional formatting
Oct 22, 2021
1598f2f
added a test
Oct 22, 2021
c4f4b00
some clean up
Oct 22, 2021
0f04849
getting updates from main
Oct 22, 2021
ee47cdf
adjusting the command
Oct 22, 2021
869e3f3
fixing style
Oct 22, 2021
98bc206
need to disable test until I have a set of packages
Oct 22, 2021
2dd8675
adding an update-and-format verb
Oct 23, 2021
2156f07
fixing formatting
Oct 23, 2021
aaf534e
reenabling the test now that I have the package
Oct 23, 2021
c83b406
introducing a proper ProjectProperties class
Oct 26, 2021
411d5c3
adding a test that uses the source code version of the formatter
Oct 26, 2021
4d078aa
Merge branch 'main' into beheim/formatting
bettinaheim Oct 26, 2021
dad64f5
style and additional warning codes to trigger code actions
Oct 26, 2021
667d3f7
adding some logging
Oct 26, 2021
72a0c66
forgot to update some things
Oct 26, 2021
b1b25c3
additional logs
Oct 26, 2021
75ecb42
... and one more
Oct 26, 2021
1f8b8c1
typo
Oct 26, 2021
8ea3c21
checking for time out
Oct 26, 2021
efa02cc
printing exit code
Oct 26, 2021
f15e9ea
printing output and error stream
Oct 26, 2021
95a95ae
Updating the Microsoft.NET.Test.Sdk since it looks like that might be…
Oct 26, 2021
e6c4c8a
need to publish the formatter for testing
Oct 27, 2021
0e7721c
cleaning up
Oct 27, 2021
4b96fe0
removing temporary project
Oct 27, 2021
20f2c33
fixing incorrect detection of nullable
Oct 27, 2021
0fe7cc2
Revert "removing temporary project"
Oct 27, 2021
8badee9
minor tweak
Oct 27, 2021
b847c09
getting updates from main
Oct 27, 2021
31b5e3e
resolving merge conflict
Oct 27, 2021
4522416
Merge branch 'main' into beheim/formatting
bettinaheim Nov 2, 2021
efdd0e4
Merge branch 'main' into beheim/formatting
bettinaheim Nov 4, 2021
6e1a3f7
updating formatter readme
Nov 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions QsCompiler.sln
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Tests.CSharpGeneration", "s
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeGeneration", "CodeGeneration", "{160AABCE-2317-4695-815C-D3B3F88BE780}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Formatter", "Formatter", "{755A6971-AD80-4519-A64E-0333B89C1E9D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Parser", "src\QsFmt\Parser\Parser.csproj", "{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Formatter", "src\QsFmt\Formatter\Formatter.fsproj", "{4D1F507F-7382-4F5B-9923-58398A565D8B}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "App", "src\QsFmt\App\App.fsproj", "{AD350766-EE10-4DE3-A834-129D026487FB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -387,6 +395,42 @@ Global
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F}.Release|x64.Build.0 = Release|Any CPU
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F}.Release|x86.ActiveCfg = Release|Any CPU
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F}.Release|x86.Build.0 = Release|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x64.ActiveCfg = Debug|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x64.Build.0 = Debug|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x86.ActiveCfg = Debug|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x86.Build.0 = Debug|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|Any CPU.Build.0 = Release|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x64.ActiveCfg = Release|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x64.Build.0 = Release|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x86.ActiveCfg = Release|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x86.Build.0 = Release|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x64.ActiveCfg = Debug|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x64.Build.0 = Debug|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x86.ActiveCfg = Debug|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x86.Build.0 = Debug|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|Any CPU.Build.0 = Release|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x64.ActiveCfg = Release|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x64.Build.0 = Release|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x86.ActiveCfg = Release|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x86.Build.0 = Release|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x64.ActiveCfg = Debug|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x64.Build.0 = Debug|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x86.ActiveCfg = Debug|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x86.Build.0 = Debug|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|Any CPU.Build.0 = Release|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x64.ActiveCfg = Release|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x64.Build.0 = Release|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x86.ActiveCfg = Release|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -407,6 +451,9 @@ Global
{2BCE252C-DCE8-48A6-B08C-E5DDD753506C} = {160AABCE-2317-4695-815C-D3B3F88BE780}
{B08BB875-89AF-4194-AC13-D8FB8290B54E} = {B4A9484D-31FC-4A27-9E26-4C8DE3E02D77}
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F} = {B4A9484D-31FC-4A27-9E26-4C8DE3E02D77}
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5} = {755A6971-AD80-4519-A64E-0333B89C1E9D}
{4D1F507F-7382-4F5B-9923-58398A565D8B} = {755A6971-AD80-4519-A64E-0333B89C1E9D}
{AD350766-EE10-4DE3-A834-129D026487FB} = {755A6971-AD80-4519-A64E-0333B89C1E9D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B921C36B-4574-4025-8FE3-E5BD2D3D2B81}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ If you edit the [Microsoft.Quantum.Sdk](./src/QuantumSdk) as part of your change
```
dotnet publish src/QuantumSdk/Tools/Tools.sln -c Debug
dotnet publish src/QsCompiler/CommandLineTool/CommandLineTool.csproj -c Debug
dotnet publish src/QsFmt/App/App.fsproj -c Debug
nuget.exe pack src/QuantumSdk/QuantumSdk.nuspec -Version 1.0.0 -Properties Configuration=Debug
```
Move the created .nupkg file into your [local NuGet folder](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds). You can now use the package to build any Q# project by opening the project file in a text editor, and editing the Sdk version number in the first line to be
Expand Down
1 change: 1 addition & 0 deletions build/manifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ $artifacts = @{
".\src\QsCompiler\LlvmBindings\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.LlvmBindings.dll",
".\src\QsCompiler\Transformations\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QsTransformations.dll",
".\src\QsCompiler\CommandLineTool\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\qsc.dll",
".\src\QsFmt\App\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\qsfmt.dll",
".\src\QuantumSdk\Tools\BuildConfiguration\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.Sdk.BuildConfiguration.dll",
".\src\QuantumSdk\Tools\DefaultEntryPoint\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.Sdk.DefaultEntryPoint.Generation.dll"
) | ForEach-Object { Join-Path $PSScriptRoot (Join-Path ".." $_) };
Expand Down
1 change: 1 addition & 0 deletions build/pack.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Publish-One '../src/QsCompiler/CommandLineTool/CommandLineTool.csproj'
Publish-One '../src/QsCompiler/LlvmBindings/LlvmBindings.csproj'
Publish-One '../src/QuantumSdk/Tools/BuildConfiguration/BuildConfiguration.csproj'
Publish-One '../src/QuantumSdk/Tools/DefaultEntryPoint/DefaultEntryPoint.csproj'
Publish-One '../src/QsFmt/App/App.fsproj'

Pack-One '../src/QsCompiler/Compiler/Compiler.csproj' '-IncludeReferencedProjects'
Pack-One '../src/QsCompiler/QirGeneration/QirGeneration.csproj'
Expand Down
27 changes: 12 additions & 15 deletions src/QsCompiler/CompilationManager/CompilationUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,18 +315,14 @@ public class CompilationUnit : IReaderWriterLock, IDisposable

internal NamespaceManager GlobalSymbols { get; private set; }

internal ProjectProperties BuildProperties { get; }

private readonly Dictionary<QsQualifiedName, QsCallable> compiledCallables;
private readonly Dictionary<QsQualifiedName, QsCustomType> compiledTypes;

private readonly ReaderWriterLockSlim syncRoot;
private readonly HashSet<ReaderWriterLockSlim> dependentLocks;

internal RuntimeCapability RuntimeCapability { get; }

internal bool IsExecutable { get; }

internal string ProcessorArchitecture { get; }

/// <inheritdoc/>
public void Dispose()
{
Expand All @@ -338,9 +334,7 @@ public void Dispose()
/// with <paramref name="dependentLocks"/> registered as dependent locks if not null.
/// </summary>
internal CompilationUnit(
RuntimeCapability capability,
bool isExecutable,
string processorArchitecture,
ProjectProperties projectProperties,
References? externals = null,
IEnumerable<ReaderWriterLockSlim>? dependentLocks = null)
{
Expand All @@ -350,16 +344,19 @@ internal CompilationUnit(
this.syncRoot = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
this.dependentLocks = new HashSet<ReaderWriterLockSlim>(dependentLocks);

this.RuntimeCapability = capability;
this.IsExecutable = isExecutable;
this.ProcessorArchitecture = processorArchitecture;

this.compiledCallables = new Dictionary<QsQualifiedName, QsCallable>();
this.compiledTypes = new Dictionary<QsQualifiedName, QsCustomType>();
this.Externals = externals;
this.BuildProperties = projectProperties;
this.GlobalSymbols = this.CreateGlobalSymbols();
}

/// <inheritdoc cref="CompilationUnit(ProjectProperties, References?, IEnumerable{ReaderWriterLockSlim}?)" />
internal CompilationUnit(CompilationUnit compilationUnit, IEnumerable<ReaderWriterLockSlim>? dependentLocks = null)
: this(compilationUnit.BuildProperties, compilationUnit.Externals, dependentLocks ?? compilationUnit.dependentLocks)
{
}

/// <summary>
/// Creates a new instance of the namespace manager for global symbols.
/// </summary>
Expand All @@ -369,8 +366,8 @@ internal CompilationUnit(
this.Externals.Declarations.Values.SelectMany(h =>
h.Specializations.Select(t => Tuple.Create(t.Item1, t.Item2))),
this.Externals.Declarations.Values.SelectMany(h => h.Types),
this.RuntimeCapability,
this.IsExecutable);
this.BuildProperties.RuntimeCapability,
this.BuildProperties.IsExecutable);

/// <summary>
/// Replaces <see cref="GlobalSymbols"/> to match <paramref name="externals"/>.
Expand Down
125 changes: 114 additions & 11 deletions src/QsCompiler/CompilationManager/CompilationUnitManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Quantum.QsCompiler.CompilationBuilder.DataStructures;
using Microsoft.Quantum.QsCompiler.ReservedKeywords;
using Microsoft.Quantum.QsCompiler.SyntaxProcessing;
using Microsoft.Quantum.QsCompiler.SyntaxTokens;
using Microsoft.Quantum.QsCompiler.SyntaxTree;
Expand Down Expand Up @@ -50,6 +52,11 @@ public class CompilationUnitManager : IDisposable
/// </summary>
public Action<PublishDiagnosticParams> PublishDiagnostics { get; }

/// <summary>
/// General purpose logging routine.
/// </summary>
public Action<string, MessageType> Log { get; }

/// <summary>
/// Null if a global type checking has been queued but is not yet running.
/// If not null, then a global type checking may be running and can be cancelled via this token source.
Expand All @@ -73,23 +80,44 @@ public class CompilationUnitManager : IDisposable
/// If provided, called whenever diagnostics within a file have changed and are ready for publishing.
/// </param>
public CompilationUnitManager(
ProjectProperties buildProperties,
Action<Exception>? exceptionLogger = null,
Action<string, MessageType>? log = null,
Action<PublishDiagnosticParams>? publishDiagnostics = null,
bool syntaxCheckOnly = false,
RuntimeCapability? capability = null,
bool isExecutable = false,
string processorArchitecture = "Unspecified")
bool syntaxCheckOnly = false)
{
this.EnableVerification = !syntaxCheckOnly;
this.compilationUnit = new CompilationUnit(capability ?? RuntimeCapability.FullComputation, isExecutable, processorArchitecture);
this.compilationUnit = new CompilationUnit(buildProperties);
this.fileContentManagers = new ConcurrentDictionary<string, FileContentManager>();
this.changedFiles = new ManagedHashSet<string>(new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion));
this.PublishDiagnostics = publishDiagnostics ?? (_ => { });
this.Log = log ?? ((_, __) => { });
this.LogException = exceptionLogger ?? Console.Error.WriteLine;
this.Processing = new ProcessingQueue(this.LogException);
this.waitForTypeCheck = new CancellationTokenSource();
}

[Obsolete("Use CompilationUnitManager(ProjectProperties, Action{Exception}?, Action{PublishDiagnosticParams}?, bool) instead.")]
public CompilationUnitManager(
Action<Exception>? exceptionLogger = null,
Action<PublishDiagnosticParams>? publishDiagnostics = null,
bool syntaxCheckOnly = false,
RuntimeCapability? capability = null,
bool isExecutable = false,
string? processorArchitecture = null)
: this(
new ProjectProperties(ImmutableDictionary.CreateRange(new[]
{
new KeyValuePair<string, string?>(MSBuildProperties.ResolvedRuntimeCapabilities, capability?.Name),
new KeyValuePair<string, string?>(MSBuildProperties.ResolvedProcessorArchitecture, processorArchitecture),
new KeyValuePair<string, string?>(MSBuildProperties.ResolvedQsharpOutputType, isExecutable ? AssemblyConstants.QsharpExe : AssemblyConstants.QsharpLibrary),
})),
exceptionLogger,
null,
publishDiagnostics)
{
}

/// <summary>
/// Cancels any asynchronously running ongoing global type checking. After all currently queued tasks
/// have finished, locks all processing, flushes the unprocessed changes in each source file,
Expand Down Expand Up @@ -581,12 +609,7 @@ private Task SpawnGlobalTypeCheckingAsync(bool runSynchronously = false)
// work with a separate compilation unit instance such that processing of all further edits can go on in parallel
var sourceFiles = this.fileContentManagers.Values.OrderBy(m => m.FileName);
this.changedFiles.RemoveAll(f => sourceFiles.Any(m => m.FileName == f));
var compilation = new CompilationUnit(
this.compilationUnit.RuntimeCapability,
this.compilationUnit.IsExecutable,
this.compilationUnit.ProcessorArchitecture,
this.compilationUnit.Externals,
sourceFiles.Select(file => file.SyncRoot));
var compilation = new CompilationUnit(this.compilationUnit, sourceFiles.Select(file => file.SyncRoot));
var content = compilation.UpdateGlobalSymbolsFor(sourceFiles);
foreach (var file in sourceFiles)
{
Expand Down Expand Up @@ -781,6 +804,86 @@ private void TypeCheckFile(string fileId, CancellationToken cancellationToken)
return success ? edit : null;
}

/// <summary>
/// Returns the edits to format the file according to the specified settings.
/// </summary>
/// <remarks>
/// Returns null if some parameters are unspecified (null),
/// or if the specified file is not listed as source file
/// </remarks>
public TextEdit[]? Formatting(TextDocumentIdentifier? textDocument, bool format = true, bool update = true, int timeout = 3000)
{
var verb =
update && format ? "update-and-format" :
update ? "update" :
format ? "format" :
null;

var qsFmtExe = this.compilationUnit.BuildProperties.QsFmtExe;
var sdkPath = this.compilationUnit.BuildProperties.SdkPath;

var fmtCommand = qsFmtExe?.Split();
(string command, string dllPath) = fmtCommand != null && fmtCommand.Length > 0
? (fmtCommand[0], string.Join(" ", fmtCommand[1..]))
: ("dotnet", Path.Combine(sdkPath ?? "", "tools", "qsfmt", "qsfmt.dll"));

// It is possible for File.Exists/Directory.Exists to return false for both dllPath and sdkPath
// despite that the command can indeed be successfully executed.
if (verb == null)
{
return null;
}

TextEdit[]? FormatFile(FileContentManager file)
{
var tempFile = Path.ChangeExtension(Path.GetTempFileName(), ".qs");
var currentContent = file.GetFileContent();
File.WriteAllText(tempFile, currentContent);

// The exit code is selected looking at this: https://tldp.org/LDP/abs/html/exitcodes.html
// Code 130 usually indicates "Script terminated by Control-C", and seem appropriate in this case.
var exitCodeOnTimeout = 130;
var commandArgs = $"{dllPath} {verb} --input {tempFile}";
this.Log($"Invoking {verb} command: {command} {commandArgs}", MessageType.Info);
var succeeded =
ProcessRunner.Run(command, commandArgs, out var _, out var errstream, out var exitCode, out var ex, timeout: timeout, exitCodeOnTimeOut: exitCodeOnTimeout)
&& exitCode == 0 && ex == null;

if (succeeded)
{
var range = DataTypes.Range.Create(DataTypes.Position.Zero, file.End());
var edit = new TextEdit { Range = range.ToLsp(), NewText = File.ReadAllText(tempFile) };
File.Delete(tempFile);
return new[] { edit };
}
else if (exitCode == exitCodeOnTimeout)
{
this.Log($"{verb} command timed out.", MessageType.Info);
}
else if (ex != null)
{
if (qsFmtExe == null && this.compilationUnit.BuildProperties.SdkVersion > new Version(0, 21))
{
this.LogException(ex);
}
}
else
{
this.Log($"Unknown error during {verb} (exit code {exitCode}): \n{errstream}", MessageType.Error);
}

return null;
}

var succeeded = this.Processing.QueueForExecution(
() => this.FileQuery(
textDocument,
(file, _) => FormatFile(file),
suppressExceptionLogging: false), // since the operation is blocking, no exceptions should occur
out var edits);
return succeeded ? edits : null;
}

// routines related to providing information for non-blocking editor commands
// -> these commands need to be responsive and therefore won't wait for any processing to finish
// -> if the query cannot be processed immediately, they simply return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal static class SuggestedEdits
/// <summary>
/// Returns <paramref name="edits"/> for <paramref name="file"/> as a <see cref="WorkspaceEdit"/>.
/// </summary>
private static WorkspaceEdit GetWorkspaceEdit(this FileContentManager file, params TextEdit[] edits)
internal static WorkspaceEdit GetWorkspaceEdit(this FileContentManager file, params TextEdit[] edits)
{
var versionedFileId = new VersionedTextDocumentIdentifier { Uri = file.Uri, Version = file.Version ?? 1 };
return new WorkspaceEdit
Expand Down
Loading