Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Draft: comment out some nuget packages #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions main/msbuild/ReferencesVSEditor.Windows.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.EditorFeatures.Wpf" Version="$(NuGetVersionRoslyn)" PrivateAssets="$(ReferencesVSEditorPrivateAssets)" ExcludeAssets="$(ReferencesVSEditorExcludeAssets)" />
<PackageReference Include="Microsoft.VisualStudio.Text.UI.Wpf" Version="$(NuGetVersionVSEditor)" PrivateAssets="$(ReferencesVSEditorPrivateAssets)" ExcludeAssets="$(ReferencesVSEditorExcludeAssets)" />
<PackageReference Include="Microsoft.VisualStudio.InteractiveWindow" Version="2.8.0" PrivateAssets="$(ReferencesVSEditorPrivateAssets)" ExcludeAssets="$(ReferencesVSEditorExcludeAssets)" />
<PackageReference Include="Microsoft.CodeAnalysis.InteractiveHost" Version="$(NuGetVersionRoslyn)" PrivateAssets="$(ReferencesVSEditorPrivateAssets)" ExcludeAssets="$(ReferencesVSEditorExcludeAssets)" />
<!--<PackageReference Include="Microsoft.CodeAnalysis.InteractiveHost" Version="$(NuGetVersionRoslyn)" PrivateAssets="$(ReferencesVSEditorPrivateAssets)" ExcludeAssets="$(ReferencesVSEditorExcludeAssets)" />-->
</ItemGroup>

<!-- The consolidated package is authored in a way to avoid adding it to the C# compiler (ref\net46 is empty).
Expand All @@ -25,9 +25,9 @@
<Reference Include="$(NuGetPackageRoot)Microsoft.VisualStudio.Platform.VSEditor\$(NuGetVersionVSEditor)\lib\net472\Microsoft.VisualStudio.Platform.VSEditor.dll">
<Private>false</Private>
</Reference>
<Reference Include="$(NuGetPackageRoot)Microsoft.CodeAnalysis.InteractiveHost\$(NuGetVersionRoslyn)\lib\net472\Microsoft.CodeAnalysis.InteractiveHost.dll">
<!--<Reference Include="$(NuGetPackageRoot)Microsoft.CodeAnalysis.InteractiveHost\$(NuGetVersionRoslyn)\lib\net472\Microsoft.CodeAnalysis.InteractiveHost.dll">
<Private>$(ReferencesVSEditorCopyToOutput)</Private>
</Reference>
</Reference>-->
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
using Roslyn.Utilities;
using Microsoft.CodeAnalysis.Options;
using MonoDevelop.CSharp.OptionProvider;
using Microsoft.VisualStudio.CodingConventions;
//using Microsoft.VisualStudio.CodingConventions;
using System.Linq;
using System.Collections.Immutable;
using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -143,34 +143,34 @@ protected override ITextSource FormatImplementation (PolicyContainer policyParen
var textPolicy = policyParent.Get<TextStylePolicy> (chain);
var optionSet = policy.CreateOptions (textPolicy);

if (input is IReadonlyTextDocument doc) {
/* if (input is IReadonlyTextDocument doc) {
try {
var conventions = EditorConfigService.GetEditorConfigContext (doc.FileName).WaitAndGetResult ();
if (conventions != null)
optionSet = new FormattingDocumentOptionSet (optionSet, new DocumentOptions (optionSet, conventions.CurrentConventions));
} catch (Exception e) {
LoggingService.LogError ("Error while loading coding conventions.", e);
}
}
} */

return new StringTextSource (FormatText (optionSet, input.Text, startOffset, startOffset + length));
}

sealed class DocumentOptions : IDocumentOptions
/* sealed class DocumentOptions : IDocumentOptions
{
readonly OptionSet optionSet;
readonly ICodingConventionsSnapshot codingConventionsSnapshot;
private static readonly ConditionalWeakTable<IReadOnlyDictionary<string, object>, IReadOnlyDictionary<string, string>> s_convertedDictionaryCache =
new ConditionalWeakTable<IReadOnlyDictionary<string, object>, IReadOnlyDictionary<string, string>> ();


public DocumentOptions (OptionSet optionSet, ICodingConventionsSnapshot codingConventionsSnapshot)
public DocumentOptions (OptionSet optionSet, ICodingConventionsSnapshot codingConventionsSnapshot)
{
this.optionSet = optionSet;
this.codingConventionsSnapshot = codingConventionsSnapshot;
}

public bool TryGetDocumentOption (OptionKey option, out object value)
public bool TryGetDocumentOption (OptionKey option, out object value)
{
if (codingConventionsSnapshot != null) {
var editorConfigPersistence = option.Option.StorageLocations.OfType<IEditorConfigStorageLocation> ().SingleOrDefault ();
Expand Down Expand Up @@ -198,8 +198,8 @@ public bool TryGetDocumentOption (OptionKey option, out object value)
var result = optionSet.GetOption (option);
value = result;
return true;
}
}
}
} */

sealed class FormattingDocumentOptionSet : OptionSet
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
/* using System;
using System.ComponentModel.Composition;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -54,12 +54,12 @@ async Task<IDocumentOptions> IDocumentOptionsProvider.GetOptionsForDocumentAsync

var path = GetPath (document);
ICodingConventionContext conventions = null;
try {
if (path != null)
conventions = await EditorConfigService.GetEditorConfigContext (path, cancellationToken);
} catch (Exception e) {
LoggingService.LogError("Error while loading coding conventions.", e);
}
try {
if (path != null)
//conventions = await EditorConfigService.GetEditorConfigContext (path, cancellationToken);
} catch (Exception e) {
LoggingService.LogError("Error while loading coding conventions.", e);
}
return new DocumentOptions (project?.Policies, conventions?.CurrentConventions);
}

Expand Down Expand Up @@ -155,3 +155,4 @@ public bool TryGetDocumentOption (OptionKey option, out object value)
}
}
}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
/* using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Options;
Expand All @@ -39,3 +39,4 @@ public IDocumentOptionsProvider TryCreate (Workspace workspace)
}
}
}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
using Microsoft.VisualStudio.Text.Editor.OptionsExtensionMethods;
using Microsoft.VisualStudio.Text.Utilities;

using Microsoft.VisualStudio.CodingConventions;
//using Microsoft.VisualStudio.CodingConventions;
using Microsoft.VisualStudio.Threading;
using Microsoft.VisualStudio.Utilities;

Expand All @@ -49,7 +49,7 @@
using MonoDevelop.Ide.Gui.Documents;

using AutoSave = MonoDevelop.Ide.Editor.AutoSave;
using EditorConfigService = MonoDevelop.Ide.Editor.EditorConfigService;
//using EditorConfigService = MonoDevelop.Ide.Editor.EditorConfigService;
using DefaultSourceEditorOptions = MonoDevelop.Ide.Editor.DefaultSourceEditorOptions;
using MonoDevelop.Components;
using System.Threading;
Expand Down Expand Up @@ -86,7 +86,7 @@ abstract partial class TextViewContent<TView, TImports> :
static bool settingZoomLevel;

PolicyContainer policyContainer;
ICodingConventionContext editorConfigContext;
//ICodingConventionContext editorConfigContext;
bool warnOverwrite;
IDisposable textBufferRegistration;

Expand Down Expand Up @@ -161,7 +161,7 @@ protected override async Task<Control> OnGetViewControlAsync (CancellationToken
EditorOperations = (EditorOperationsInterface)Imports.EditorOperationsProvider.GetEditorOperations (TextView);
EditorOptions = Imports.EditorOptionsFactoryService.GetOptions (TextView);
TextBufferOptions = Imports.EditorOptionsFactoryService.GetOptions (TextView.TextBuffer);
UpdateTextEditorOptions (this, EventArgs.Empty);
//UpdateTextEditorOptions (this, EventArgs.Empty);
contentProviders = new List<IEditorContentProvider> (Imports.EditorContentProviderService.GetContentProvidersForView (TextView));

TextView.Properties [typeof (DocumentController)] = this;
Expand Down Expand Up @@ -199,7 +199,7 @@ protected override async Task<Control> OnGetViewControlAsync (CancellationToken
// Content providers can provide additional content
NotifyContentChanged ();

await Load (false);
////await Load (false);

return control;
}
Expand Down Expand Up @@ -249,11 +249,11 @@ protected override void OnFileNameChanged ()

warnOverwrite = false;

if (editorConfigContext != null) {
/* if (editorConfigContext != null) {
editorConfigContext.CodingConventionsChangedAsync -= UpdateOptionsFromEditorConfigAsync;
EditorConfigService.RemoveEditConfigContext (TextDocument.FilePath).Ignore ();
editorConfigContext = null;
}
} */

if (FilePath != TextDocument.FilePath && !string.IsNullOrEmpty (TextDocument.FilePath))
AutoSave.RemoveAutoSaveFile (TextDocument.FilePath);
Expand All @@ -272,15 +272,15 @@ protected override void OnFileNameChanged ()

UpdateTextBufferRegistration ();

UpdateTextEditorOptions (null, null);
//UpdateTextEditorOptions (null, null);
}

protected override void OnOwnerChanged ()
{
base.OnOwnerChanged ();

if (TextDocument != null) {
UpdateTextEditorOptions (null, null);
//UpdateTextEditorOptions (null, null);
UpdateTextBufferRegistration ();
}
}
Expand Down Expand Up @@ -312,28 +312,28 @@ protected override void OnDispose ()

UnsubscribeFromEvents ();

if (policyContainer != null)
/* if (policyContainer != null)
policyContainer.PolicyChanged -= PolicyChanged;
if (editorConfigContext != null) {
editorConfigContext.CodingConventionsChangedAsync -= UpdateOptionsFromEditorConfigAsync;
EditorConfigService.RemoveEditConfigContext (FilePath).Ignore ();
}
} */

base.OnDispose ();
}

protected virtual void SubscribeToEvents ()
{
sourceEditorOptions.Changed += UpdateTextEditorOptions;
//sourceEditorOptions.Changed += UpdateTextEditorOptions;
TextDocument.DirtyStateChanged += HandleTextDocumentDirtyStateChanged;
TextBuffer.Changed += HandleTextBufferChanged;
TextView.Options.OptionChanged += TextBufferOptionsChanged;
}

protected virtual void UnsubscribeFromEvents ()
{
if (sourceEditorOptions != null)
sourceEditorOptions.Changed -= UpdateTextEditorOptions;
// if (sourceEditorOptions != null)
// sourceEditorOptions.Changed -= UpdateTextEditorOptions;

if (TextDocument != null)
TextDocument.DirtyStateChanged -= HandleTextDocumentDirtyStateChanged;
Expand Down Expand Up @@ -362,7 +362,7 @@ void UpdateLineNumberMarginOption ()
sourceEditorOptions.ShowLineNumberMargin);
}

void UpdateTextEditorOptions (object sender, EventArgs e)
/* void UpdateTextEditorOptions (object sender, EventArgs e)
{
UpdateTextEditorOptionsAsync ().Forget ();
}
Expand Down Expand Up @@ -393,7 +393,7 @@ async Task UpdateTextEditorOptionsAsync ()
editorConfigContext.CodingConventionsChangedAsync += UpdateOptionsFromEditorConfigAsync;

await UpdateOptionsFromEditorConfigAsync (null, null);
}
} */

void ClearOptionValue(string optionName)
{
Expand Down Expand Up @@ -438,7 +438,7 @@ private void UpdateOptionsFromPolicy()
#endif
}

private Task UpdateOptionsFromEditorConfigAsync (object sender, CodingConventionsChangedEventArgs args)
/* private Task UpdateOptionsFromEditorConfigAsync (object sender, CodingConventionsChangedEventArgs args)
{
// Set base options first, then override with editorconfig values
UpdateOptionsFromPolicy ();
Expand Down Expand Up @@ -610,7 +610,7 @@ void UseOriginalFile ()
}

return Task.CompletedTask;
}
} */

/// <summary>
/// Replace document content with new content. This marks the document as dirty.
Expand Down Expand Up @@ -779,7 +779,7 @@ void ReloadFromDisk ()
if (IsDisposed || !File.Exists (FilePath))
return;

Load (true);
////Load (true);
ShowNotification = false;
} catch (Exception ex) {
MessageService.ShowError ("Could not reload the file.", ex);
Expand Down
6 changes: 3 additions & 3 deletions main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<PackageReference Include="Microsoft.Build.Locator" Version="1.6.10" PrivateAssets="runtime" />
<PackageReference Include="Microsoft.CodeAnalysis.EditorFeatures" Version="$(NuGetVersionRoslyn)" PrivateAssets="runtime" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="$(NuGetVersionRoslyn)" PrivateAssets="runtime" />
<PackageReference Include="Microsoft.VisualStudio.CodingConventions" Version="1.1.20180503.2" PrivateAssets="runtime" />
<!--<PackageReference Include="Microsoft.VisualStudio.CodingConventions" Version="1.1.20180503.2" PrivateAssets="runtime" />-->
<!-- <PackageReference Include="Microsoft.VisualStudio.Composition" Version="$(NuGetVersionVSComposition)" ExcludeAssets="all" />-->
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="$(NuGetVersionVSComposition)" PrivateAssets="runtime" />
<!-- Need the net45 version, see https://github.com/mono/mono/issues/12461 -->
Expand Down Expand Up @@ -127,7 +127,7 @@
<IncludeCopyLocal Include="Microsoft.CodeAnalysis.ExternalAccess.MonoDevelop.dll" />
<IncludeCopyLocal Include="Microsoft.CodeAnalysis.Features.dll" />
<IncludeCopyLocal Include="Microsoft.CodeAnalysis.FlowAnalysis.Utilities.dll" />
<IncludeCopyLocal Include="Microsoft.CodeAnalysis.InteractiveHost.dll" />
<!--<IncludeCopyLocal Include="Microsoft.CodeAnalysis.InteractiveHost.dll" />-->
<IncludeCopyLocal Include="Microsoft.CodeAnalysis.Scripting.dll" />
<IncludeCopyLocal Include="Microsoft.CodeAnalysis.VisualBasic.dll" />
<IncludeCopyLocal Include="Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.dll" />
Expand All @@ -137,7 +137,7 @@
<IncludeCopyLocal Include="Microsoft.CodeAnalysis.Workspaces.MSBuild.dll" />
<IncludeCopyLocal Include="Microsoft.DiaSymReader.dll" />
<IncludeCopyLocal Include="Microsoft.Extensions.ObjectPool.dll" />
<IncludeCopyLocal Include="Microsoft.VisualStudio.CodingConventions.dll" />
<!--<IncludeCopyLocal Include="Microsoft.VisualStudio.CodingConventions.dll" />-->
<IncludeCopyLocal Include="Microsoft.VisualStudio.Composition.dll" />
<IncludeCopyLocal Include="Microsoft.VisualStudio.Composition.NetFxAttributes.dll" />
<IncludeCopyLocal Include="Microsoft.VisualStudio.CoreUtility.dll" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ExtensionModel>
<Runtime>
<Import assembly="Microsoft.VisualStudio.CodingConventions.dll" />
<!--<Import assembly="Microsoft.VisualStudio.CodingConventions.dll" />-->
<Import assembly="Microsoft.VisualStudio.Composition.dll" />
<Import assembly="Microsoft.VisualStudio.CoreUtility.dll" />
<Import assembly="Microsoft.VisualStudio.Language.dll" />
Expand Down Expand Up @@ -431,7 +431,7 @@
<Assembly file="Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll" />
<Assembly file="Microsoft.CodeAnalysis.Workspaces.dll" />
<Assembly file="Microsoft.CodeAnalysis.Workspaces.MSBuild.dll" />
<Assembly file="Microsoft.VisualStudio.CodingConventions.dll" />
<!--<Assembly file="Microsoft.VisualStudio.CodingConventions.dll" />-->
<Assembly file="Microsoft.VisualStudio.Language.dll" />
<Assembly file="Microsoft.VisualStudio.Language.StandardClassification.dll"/>
<Assembly file="Microsoft.VisualStudio.Text.Logic.dll"/>
Expand Down
Loading