Skip to content

Commit

Permalink
Fix ILanguageService (#1442)
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt committed Apr 15, 2024
1 parent bf35875 commit 38481fb
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 30 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Fix analyzer [RCS1077](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1077) ([PR](https://github.com/dotnet/roslynator/pull/1428))
- Fix export of `ILanguageService` ([PR](https://github.com/dotnet/roslynator/pull/1442))

## [4.12.0] - 2024-03-19

Expand Down
7 changes: 2 additions & 5 deletions src/CSharp.Workspaces/CSharp/CSharpSyntaxFactsService.cs
@@ -1,16 +1,13 @@
// Copyright (c) .NET Foundation and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Composition;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
using Roslynator.CSharp;

namespace Roslynator.CSharp;

[Export(typeof(ILanguageService))]
[ExportMetadata("Language", LanguageNames.CSharp)]
[ExportMetadata("ServiceType", "Roslynator.ISyntaxFactsService")]
[ExportLanguageService(typeof(ISyntaxFactsService), LanguageNames.CSharp)]
internal sealed class CSharpSyntaxFactsService : ISyntaxFactsService
{
public static CSharpSyntaxFactsService Instance { get; } = new();
Expand Down
@@ -1,17 +1,14 @@
// Copyright (c) .NET Foundation and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Composition;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Text;
using Roslynator.CodeMetrics;

namespace Roslynator.CSharp.CodeMetrics;

[Export(typeof(ILanguageService))]
[ExportMetadata("Language", LanguageNames.CSharp)]
[ExportMetadata("ServiceType", "Roslynator.CodeMetrics.ICodeMetricsService")]
[ExportLanguageService(typeof(ICodeMetricsService), LanguageNames.CSharp)]
internal class CSharpCodeMetricsService : CodeMetricsService
{
public override ISyntaxFactsService SyntaxFacts => CSharpSyntaxFactsService.Instance;
Expand Down
@@ -1,18 +1,15 @@
// Copyright (c) .NET Foundation and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Collections.Immutable;
using System.Composition;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
using Roslynator.FindSymbols;

namespace Roslynator.CSharp.FindSymbols;

[Export(typeof(ILanguageService))]
[ExportMetadata("Language", LanguageNames.CSharp)]
[ExportMetadata("ServiceType", "Roslynator.FindSymbols.IFindSymbolService")]
[ExportLanguageService(typeof(IFindSymbolService), LanguageNames.CSharp)]
internal class CSharpFindSymbolService : FindSymbolService
{
public override ISyntaxFactsService SyntaxFacts => CSharpSyntaxFactsService.Instance;
Expand Down
Expand Up @@ -3,21 +3,18 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Composition;
using System.Diagnostics;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Text;
using Roslynator.Spelling;

namespace Roslynator.CSharp.Spelling;

[Export(typeof(ILanguageService))]
[ExportMetadata("Language", LanguageNames.CSharp)]
[ExportMetadata("ServiceType", "Roslynator.Spelling.ISpellingService")]
[ExportLanguageService(typeof(ISpellingService), LanguageNames.CSharp)]
internal partial class CSharpSpellingService : SpellingService
{
public override ISyntaxFactsService SyntaxFacts => CSharpSyntaxFactsService.Instance;
Expand Down
@@ -1,17 +1,14 @@
// Copyright (c) .NET Foundation and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Composition;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Text;
using Roslynator.CodeMetrics;

namespace Roslynator.VisualBasic.CodeMetrics;

[Export(typeof(ILanguageService))]
[ExportMetadata("Language", LanguageNames.VisualBasic)]
[ExportMetadata("ServiceType", "Roslynator.CodeMetrics.ICodeMetricsService")]
[ExportLanguageService(typeof(ICodeMetricsService), LanguageNames.VisualBasic)]
internal class VisualBasicCodeMetricsService : CodeMetricsService
{
public override ISyntaxFactsService SyntaxFacts => VisualBasicSyntaxFactsService.Instance;
Expand Down
@@ -1,16 +1,13 @@
// Copyright (c) .NET Foundation and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Composition;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.VisualBasic;

namespace Roslynator.VisualBasic;

[Export(typeof(ILanguageService))]
[ExportMetadata("Language", LanguageNames.VisualBasic)]
[ExportMetadata("ServiceType", "Roslynator.ISyntaxFactsService")]
[ExportLanguageService(typeof(ISyntaxFactsService), LanguageNames.VisualBasic)]
internal sealed class VisualBasicSyntaxFactsService : ISyntaxFactsService
{
public static VisualBasicSyntaxFactsService Instance { get; } = new();
Expand Down

0 comments on commit 38481fb

Please sign in to comment.