├── .editorconfig
├── .gitattributes
├── .github
└── workflows
│ ├── build.yml
│ ├── main.yml
│ └── pull_request.yml
├── .gitignore
├── .gitmodules
├── .vscode
├── extensions.json
├── launch.json
├── settings.json
└── tasks.json
├── Directory.Build.props
├── Directory.Packages.props
├── LICENSE
├── MSBuildLanguageServer.Tests
├── .editorconfig
├── Completion
│ ├── CompletionTests.cs
│ └── MSBuildCompletionTests.cs
├── Extensions
│ ├── CompletionListExtensions.cs
│ └── TestServerExtensions.cs
├── HoverTests.cs
├── Import
│ ├── AbstractLanguageServerProtocolTests.Edited.cs
│ ├── AbstractLanguageServerProtocolTests.cs
│ ├── ServerInitializationTests.cs
│ ├── Stubs.cs
│ └── UseExportProviderAttribute.cs
└── MSBuildLanguageServer.Tests.csproj
├── MSBuildLanguageServer
├── .editorconfig
├── DisplayElementRenderer.cs
├── GlobalSuppressions.cs
├── Handler
│ ├── CodeActions
│ │ ├── CodeActionHandler.cs
│ │ ├── CodeActionKindExtensions.cs
│ │ ├── CodeActionResolveData.cs
│ │ ├── CodeActionResolveHandler.cs
│ │ ├── UnsupportedCodeActionOperationException.cs
│ │ └── WorkspaceEditExtensions.cs
│ ├── Completion
│ │ ├── CompletionClientCapabilities.cs
│ │ ├── CompletionHandler.cs
│ │ ├── CompletionItems
│ │ │ ├── MSBuildCompletionItem.cs
│ │ │ ├── MSBuildCultureCompletionItem.cs
│ │ │ ├── MSBuildLcidCompletionItem.cs
│ │ │ ├── MSBuildNewGuidCompletionItem.cs
│ │ │ ├── MSBuildReferenceExpressionCompletionItem.cs
│ │ │ ├── MSBuildSdkCompletionItem.cs
│ │ │ ├── OrderedPackageVersionCompletionItem.cs
│ │ │ ├── PackageCompletionItem.cs
│ │ │ ├── XmlClosingTagCompletionItem.cs
│ │ │ ├── XmlCompletionItem.cs
│ │ │ └── XmlEntityCompletionItem.cs
│ │ ├── CompletionRenderSettings.cs
│ │ ├── CompletionRenderer.cs
│ │ ├── CompletionResolveHandler.cs
│ │ ├── ILspCompletionItem.cs
│ │ ├── MSBuildCompletionDocsProvider.cs
│ │ ├── MSBuildCompletionItemKind.cs
│ │ ├── MSBuildXmlCompletionDataSource.cs
│ │ ├── PackageCompletionDocsProvider.cs
│ │ ├── XmlCommitKind.cs
│ │ ├── XmlCompletionDataSource.cs
│ │ └── XmlToLspCompletionItemKind.cs
│ ├── DocumentDiagnosticsHandler.cs
│ ├── HoverHandler.cs
│ ├── LocationHelpers.cs
│ ├── Navigation
│ │ ├── FindAllReferencesHandler.cs
│ │ └── GoToDefinitionHandler.cs
│ └── WorkDoneProgressExtensions.cs
├── Import
│ ├── ExportProviderBuilder.cs
│ ├── Extensions.cs
│ ├── LspWorkspaceManager.cs
│ ├── LspWorkspaceManagerFactory.cs
│ ├── MSBuildLanguageServer.cs
│ ├── MefLanguageServices.cs
│ ├── Program.cs
│ ├── ProtocolConversions.cs
│ ├── RequestContext.cs
│ ├── Stubs.cs
│ └── VisualStudioMefHostServices.cs
├── InternalsVisibleTo.cs
├── KnownVSCodeImages.cs
├── LspLoggerExtensions.cs
├── MSBuildCapabilitiesProvider.cs
├── MSBuildGlyph.cs
├── MSBuildLanguageServer.csproj
├── MSBuildLanguageServerFactory.cs
├── MSBuildWorkspace.cs.WIP
├── NuGetSearchExports.cs
├── Parser
│ ├── LspMSBuildParser.cs
│ ├── LspMSBuildParserService.cs
│ ├── LspMSBuildParserServiceFactory.cs
│ ├── LspTextExtensions.cs
│ ├── LspXmlParser.cs
│ ├── LspXmlParserService.cs
│ ├── LspXmlParserServiceFactory.cs
│ ├── NullBackgroundParseService.cs
│ └── TextPositionConversionExtensions.cs
├── Program.cs
├── Services
│ ├── CodeActionCacheFactory.cs
│ ├── CompletionListCacheFactory.cs
│ ├── FunctionTypeProviderServiceFactory.cs
│ ├── LspNavigationService.FindReferencesSearchJob.cs
│ ├── LspNavigationService.cs
│ ├── LspNavigationServiceFactory.cs
│ └── MSBuildRuntimeServiceFactory.cs
└── Workspace
│ ├── EditorDocumentState.cs
│ ├── LspEditorDocument.cs
│ ├── LspEditorWorkspace.cs
│ └── LspEditorWorkspaceFactory.cs
├── MonoDevelop.MSBuild.Editor.Common
├── CodeActions
│ ├── EditTextActionOperationExtensions.cs
│ ├── MSBuildChangeAnnotation.cs
│ ├── MSBuildCodeAction.cs
│ ├── MSBuildCodeActionContext.cs
│ ├── MSBuildCodeActionKind.cs
│ ├── MSBuildCodeActionKindExtensions.cs
│ ├── MSBuildCodeActionProvider.cs
│ ├── MSBuildCodeActionService.cs
│ ├── MSBuildDocumentCreate.cs
│ ├── MSBuildDocumentDelete.cs
│ ├── MSBuildDocumentEdit.cs
│ ├── MSBuildDocumentEditBuilder.Edit.cs
│ ├── MSBuildDocumentEditBuilder.cs
│ ├── MSBuildDocumentEditBuilderCodeAction.cs
│ ├── MSBuildDocumentRename.cs
│ ├── MSBuildSpellChecker.cs
│ ├── MSBuildWorkspaceEdit.cs
│ ├── MSBuildWorkspaceEditOperation.cs
│ └── SourceTextExtensions.cs
├── CodeFixes
│ ├── AppendNoWarnFixProvider.cs
│ ├── ChangeMisspelledNameFixProvider.cs
│ ├── FixMultitargetingPluralizationFixProvider.cs
│ ├── RemoveMSBuildAllProjectsAssignmentFixProvider.cs
│ └── RemovePropertyOrMetadataWithDefaultValueFixProvider.cs
├── Completion
│ ├── CompletionHelpers.cs
│ ├── MSBuildCompletionTrigger.cs
│ ├── PackageCompletion.cs
│ └── SdkCompletion.cs
├── InternalsVisibleTo.cs
├── MonoDevelop.MSBuild.Editor.Common.csproj
├── Navigation
│ └── MSBuildNavigationHelpers.cs
├── Refactorings
│ ├── ElementInsertionSpanExtensions.cs
│ ├── ExtractExpression
│ │ ├── ExpressionNodeExtraction.cs
│ │ ├── ExtractExpressionRefactoringProvider.ExtractExpressionAction.cs
│ │ └── ExtractExpressionRefactoringProvider.cs
│ ├── MSBuildElementExtensions.cs
│ ├── SplitGroupRefactoringProvider.cs
│ └── UseAttributesForMetadataRefactoringProvider.cs
└── Roslyn
│ ├── IRoslynCompilationProvider.cs
│ ├── RoslynFunctionInfo.cs
│ ├── RoslynFunctionTypeProvider.cs
│ ├── RoslynHelpers.cs
│ └── RoslynTaskMetadataBuilder.cs
├── MonoDevelop.MSBuild.Editor.VisualStudio
├── Analysis
│ ├── IWpfDifferenceViewerExtensions.cs
│ ├── WpfDifferenceViewElementFactory.cs
│ └── WpfMSBuildSuggestedAction.cs
├── Logging
│ ├── JsonSettingsStorage.cs
│ ├── MSBuildEditorExtensionTelemetry.cs
│ ├── MSBuildEditorLogger.cs
│ ├── MSBuildEditorLoggerProvider.cs
│ ├── MSBuildEditorSettingsStorage.cs
│ ├── MSBuildEditorTelemetrySettings.cs
│ ├── MSBuildExtensionLogger.cs
│ ├── MSBuildOutputPaneWriter.cs
│ ├── UserIdentifiableValueHasher.cs
│ └── UserIdentifiableValueSanitizer.cs
├── MSBuildEditorFactory.cs
├── MSBuildEditorVisualStudioPackage.cs
├── MSBuildLanguageService.cs
├── MSBuildTaskCenterProgressReporter.cs
├── MonoDevelop.MSBuild.Editor.VisualStudio.csproj
├── Options
│ ├── MSBuildTelemetryOptions.cs
│ ├── MSBuildTelemetryOptionsPage.cs
│ ├── MSBuildTelemetryOptionsUIElement.xaml
│ ├── MSBuildTelemetryOptionsUIElement.xaml.cs
│ └── OptionsResources.xaml
├── PackageConsts.cs
├── PackageFeedRegistryProvider.cs
├── Properties
│ ├── AssemblyInfo.cs
│ └── DesignTimeResources.xaml
├── Resources.resx
├── RoslynFindReferences
│ ├── AbstractFindUsagesCustomColumnDefinition.cs
│ ├── Contexts
│ │ └── TableDataSourceFindUsagesContext.cs
│ ├── DependencyObjectExtensions.cs
│ ├── Entries
│ │ ├── Entry.cs
│ │ ├── FoundReferenceEntry.cs
│ │ └── SimpleMessageEntry.cs
│ ├── FindUsagesValueUsageInfoColumnDefinition.cs
│ ├── IFindAllReferencesWindowExtensions.cs
│ ├── ISupportNavigation.cs
│ ├── NameMetadata.cs
│ ├── Placeholders.cs
│ ├── ReferenceEqualityComparer.cs
│ ├── StreamingFindUsagesPresenter.cs
│ ├── TableEntriesSnapshot.cs
│ └── WpfClassificationExtensions.cs
├── RoslynImport
│ ├── Interop
│ │ ├── ComAggregate.cs
│ │ ├── ComEventSink.cs
│ │ ├── IComWrapperFixed.cs
│ │ └── WrapperPolicy.cs
│ └── LanguageService
│ │ ├── AbstractEditorFactory.cs
│ │ ├── AbstractLanguageService.IVsAutoOutliningClient.cs.cs
│ │ ├── AbstractLanguageService`2.IVsLanguageInfo.cs
│ │ ├── AbstractLanguageService`2.VsCodeWindowManager.cs
│ │ ├── AbstractLanguageService`2.cs
│ │ ├── AbstractPackage.cs
│ │ ├── AbstractPackage`2.cs
│ │ └── LanguageService.cs
├── SetRegistrationOptionAttribute.cs
├── VSPackage.resx
├── VisualStudioCompilationProvider.cs
├── VisualStudioMSBuildEditorHost.cs
├── WpfMarkdown
│ ├── WpfMarkdownExtensions.cs
│ ├── WpfMarkdownHelper.cs
│ ├── WpfMarkdownListScope.cs
│ ├── WpfMarkdownStyles.cs
│ ├── WpfMarkdownTextBlock.cs
│ └── WpfTextMarkdownRenderer.cs
├── languages.pkgdef
└── source.extension.vsixmanifest
├── MonoDevelop.MSBuild.Editor
├── Analysis
│ ├── IMSBuildSuggestedActionFactory.cs
│ ├── MSBuildSuggestedActionSource.cs
│ ├── MSBuildSuggestedActionsSourceProvider.cs
│ ├── MSBuildWorkspaceEditExtensions.cs
│ └── PreviewChangesService.cs
├── Commands
│ ├── MSBuildCachingResolver.cs
│ ├── MSBuildFindReferencesCommandHandler .cs
│ ├── MSBuildGoToDefinitionCommandHandler.cs
│ └── MSBuildHelpCommandHandler.cs
├── Completion
│ ├── MSBuildCompletionCommitManager.cs
│ ├── MSBuildCompletionCommitManagerProvider.cs
│ ├── MSBuildCompletionContext.cs
│ ├── MSBuildCompletionDocumentationProvider.cs
│ ├── MSBuildCompletionItemManager.cs
│ ├── MSBuildCompletionSource.NuGetSearchInfo.cs
│ ├── MSBuildCompletionSource.cs
│ └── MSBuildCompletionSourceProvider.cs
├── DisplayElementFactory.cs
├── ExportedRoslynFunctionTypeProvider.cs
├── Exports
│ ├── .editorconfig
│ ├── ExportedFileSystem.cs
│ ├── ExportedNuGetDiskFeedFactory.cs
│ ├── ExportedNuGetV3ServiceFeedFactory.cs
│ ├── ExportedPackageFeedFactorySelector.cs
│ ├── ExportedPackageSearchManager.cs
│ └── ExportedWebRequestFactory.cs
├── GlobalSuppressions.cs
├── HighlightReferences
│ ├── MSBuildHighlightReferencesTagger.cs
│ └── MSBuildHighlightReferencesTaggerProvider.cs
├── Host
│ ├── FindReferencesContext.cs
│ ├── FoundReference.cs
│ ├── IMSBuildEditorHost.cs
│ └── IStreamingFindReferencesPresenter.cs
├── InternalsVisibleTo.cs
├── MSBuildBackgroundParser.cs
├── MSBuildBraceCompletion.cs
├── MSBuildContentType.cs
├── MSBuildContentTypeProvider.cs
├── MSBuildDiagnosticTag.cs
├── MSBuildEnvironmentLogger.cs
├── MSBuildParseResult.cs
├── MSBuildParserProvider.cs
├── MSBuildTextMateTagger.cs
├── MSBuildValidationTagger.cs
├── MSBuildValidationTaggerProvider.cs
├── MonoDevelop.MSBuild.Editor.csproj
├── Navigation
│ ├── MSBuildNavigableSymbol.cs
│ ├── MSBuildNavigableSymbolSource.cs
│ ├── MSBuildNavigableSymbolSourceProvider.cs
│ └── MSBuildNavigationService.cs
├── QuickInfo
│ ├── MSBuildDiagnosticQuickInfoSource.cs
│ ├── MSBuildDiagnosticQuickInfoSourceProvider.cs
│ ├── MSBuildQuickInfoSource.cs
│ └── MSBuildQuickInfoSourceProvider.cs
├── RoslynShims.cs
├── TextStructure
│ ├── MSBuildTextStructureNavigator.cs
│ └── MSBuildTextStructureNavigatorProvider.cs
└── VSEditorOptionsReader.cs
├── MonoDevelop.MSBuild.Tests.Editor
├── CodeFixes
│ ├── AppendNoWarnCodeFixTest.cs
│ └── FixMultitargetingPluralizationCodeFixTests.cs
├── Completion
│ ├── MSBuildCommitTests.cs
│ ├── MSBuildCompletionTests.cs
│ ├── TestCompilationProvider.cs
│ ├── TestFileSystem.cs
│ └── TestSchemaProvider.cs
├── DisplayElementTests.cs
├── MSBuildEditorCatalog.cs
├── MSBuildEditorTest.cs
├── MSBuildExpandSelectionTests.cs
├── MSBuildFindReferencesTests.cs
├── MSBuildQuickInfoTests.cs
├── MSBuildResolverTests.cs
├── MSBuildTestEnvironment.cs
├── Mocks
│ ├── TestMSBuildEditorHost.cs
│ ├── TestMSBuildEnvironment.cs
│ └── TestPackageFeedRegistry.cs
├── MonoDevelop.MSBuild.Tests.Editor.csproj
├── Refactorings
│ ├── ExtractExpressionTests.cs
│ └── MSBuildEditorTestExtensions.cs
└── TestLoggers.cs
├── MonoDevelop.MSBuild.Tests
├── Analyzers
│ ├── AppendNoWarnAnalyzerTest.cs
│ ├── CoreDiagnosticTests.cs
│ ├── DoNotAssignMSBuildAllProjectsAnalyzerTest.cs
│ ├── IncompleteDocumentTests.cs
│ └── TaskDiagnosticTests.cs
├── Completion
│ ├── ExxpressionCompletionTests.cs
│ └── MSBuildExpressionCompletionTest.cs
├── CultureHelperTests.cs
├── DescriptionTests.cs
├── ExpressionCompletionTests.cs
├── FrameworkInfoTests.cs
├── Helpers
│ ├── MSBuildDocumentTest.Diagnostics.cs
│ ├── MSBuildDocumentTest.Parsing.cs
│ ├── MSBuildDocumentTest.Text.cs
│ ├── MSBuildDocumentTest.cs
│ ├── MSBuildTestHelpers.cs
│ ├── MSBuildTestLogHelpers.cs
│ ├── NUnitExtensions.cs
│ └── TestSchemaProvider.cs
├── InternalsVisibleTo.cs
├── MSBuildConditionTests.cs
├── MSBuildExpressionTests.cs
├── MSBuildIdentifierTests.cs
├── MSBuildImportEvaluationTests.cs
├── MonoDevelop.MSBuild.Tests.csproj
├── PackageSearch
│ ├── .editorconfig
│ ├── Mocks
│ │ ├── MockFileSystem.cs
│ │ └── MockWebRequestFactory.cs
│ ├── NuGetV2ServiceFeedTests.cs
│ └── TestFiles
│ │ ├── GetPackageInfo.CommonLogging.xml
│ │ ├── GetPackageNames.CommonLogging.xml
│ │ └── GetPackageVersions.CommonLogging.xml
├── SchemaTests.cs
└── XmlEscapingTests.cs
├── MonoDevelop.MSBuild
├── Analysis
│ ├── AttributeDiagnosticContext.cs
│ ├── ElementDiagnosticContext.cs
│ ├── MSBuildAnalysisContext.cs
│ ├── MSBuildAnalysisContextImpl.cs
│ ├── MSBuildAnalysisSession.cs
│ ├── MSBuildAnalyzer.cs
│ ├── MSBuildAnalyzerAttribute.cs
│ ├── MSBuildAnalyzerDriver.cs
│ ├── MSBuildDiagnostic.cs
│ ├── MSBuildDiagnosticDescriptor.cs
│ ├── MSBuildDiagnosticExtensions.cs
│ ├── MSBuildDiagnosticSeverity.cs
│ └── PropertyWriteDiagnosticContext.cs
├── Analyzers
│ ├── AppendNoWarnAnalyzer.cs
│ ├── DoNotAssignMSBuildAllProjectsAnalyzer.cs
│ ├── PackageReferenceConditionAnalyzer.cs
│ ├── RuntimeIdentifierOrRuntimeIdentifiersAnalyzer.cs
│ └── TargetFrameworksOrTargetFrameworkAnalyzer.cs
├── CurrentProcessMSBuildEnvironment.cs
├── DisplayText.cs
├── Dom
│ ├── MSBuildAttribute.cs
│ ├── MSBuildDomExtensions.cs
│ ├── MSBuildElement.cs
│ └── MSBuildObject.cs
├── Evaluation
│ ├── EvaluatedValue.cs
│ ├── IMSBuildEvaluationContext.cs
│ ├── IMSBuildEvaluator.cs
│ ├── Imported
│ │ ├── .editorconfig
│ │ ├── AssemblyResources.cs
│ │ ├── AssemblyUtilities.cs
│ │ ├── CommunicationsUtilities.cs
│ │ ├── Constants.cs
│ │ ├── DebugUtils.cs
│ │ ├── ErrorUtilities.cs
│ │ ├── EscapingUtilities.cs
│ │ ├── ExceptionHandling.cs
│ │ ├── Expander.Ported.cs
│ │ ├── Expander.cs
│ │ ├── FileUtilities.cs
│ │ ├── FileUtilitiesRegex.cs
│ │ ├── IConstrainedEqualityComparer.cs
│ │ ├── InternalErrorException.cs
│ │ ├── IntrinsicFunctions.Override.cs
│ │ ├── IntrinsicFunctions.cs
│ │ ├── MSBuildNameIgnoreCaseComparer.cs
│ │ ├── NativeMethodsShared.cs
│ │ ├── NuGetFrameworkWrapper.cs
│ │ ├── ResourceUtilities.cs
│ │ ├── Resources
│ │ │ ├── Strings.resx
│ │ │ └── Strings.shared.resx
│ │ ├── SimpleVersion.cs
│ │ ├── StringBuilderCache.cs
│ │ └── Stubs.cs
│ ├── MSBuildCollectedValuesEvaluationContext.cs
│ ├── MSBuildEvaluatorExtensions.cs
│ ├── MSBuildFileEvaluationContext.cs
│ └── MSBuildProjectEvaluationContext.cs
├── IMSBuildEnvironment.cs
├── IMSBuildFileSystem.cs
├── ITaskMetadataBuilder.cs
├── InternalsVisibleTo.cs
├── Language
│ ├── AnnotationTable.cs
│ ├── Annotations.cs
│ ├── CoreDiagnosticProperty.cs
│ ├── CoreDiagnostics.cs
│ ├── CultureHelper.cs
│ ├── ExpressionCompletion.cs
│ ├── ExpressionDiagnostics.cs
│ ├── Expressions
│ │ ├── ExpressionComparison.cs
│ │ ├── ExpressionError.cs
│ │ ├── ExpressionExtensions.cs
│ │ ├── ExpressionFunctions.cs
│ │ ├── ExpressionItem.cs
│ │ ├── ExpressionItemNode.cs
│ │ ├── ExpressionList.cs
│ │ ├── ExpressionMetadata.cs
│ │ ├── ExpressionNode.cs
│ │ ├── ExpressionOptions.cs
│ │ ├── ExpressionParser.Conditions.cs
│ │ ├── ExpressionParser.cs
│ │ ├── ExpressionProperty.cs
│ │ ├── ExpressionPropertyNode.cs
│ │ ├── ExpressionText.cs
│ │ ├── IContainerExpression.cs
│ │ └── ListExpression.cs
│ ├── IFunctionTypeProvider.cs
│ ├── ISymbol.cs
│ ├── IVersionableSymbol.cs
│ ├── Import.cs
│ ├── KnownCulture.cs
│ ├── MSBuildDocument.cs
│ ├── MSBuildDocumentValidator.cs
│ ├── MSBuildDocumentVisitor.cs
│ ├── MSBuildIdentifier.cs
│ ├── MSBuildImportResolver.cs
│ ├── MSBuildInferredSchema.cs
│ ├── MSBuildNavigation.cs
│ ├── MSBuildParserContext.cs
│ ├── MSBuildReferenceCollector.cs
│ ├── MSBuildReferenceKind.cs
│ ├── MSBuildResolveResult.cs
│ ├── MSBuildResolver.cs
│ ├── MSBuildRootDocument.cs
│ ├── MSBuildSymbolExtensions.cs
│ ├── MSBuildToolsVersion.cs
│ ├── PropertyValueCollector.cs
│ ├── References
│ │ └── MSBuildKnownValueReferenceCollector.cs
│ ├── Syntax
│ │ ├── MSBuildAttributeName.cs
│ │ ├── MSBuildAttributeSyntax.cs
│ │ ├── MSBuildElementName.cs
│ │ ├── MSBuildElementSyntax.cs
│ │ ├── MSBuildSyntax.cs
│ │ └── MSBuildSyntaxKind.cs
│ ├── TimeMetrics.cs
│ ├── TypeNameValidation.cs
│ ├── Typesystem
│ │ ├── BaseSymbol.cs
│ │ ├── ConstantSymbol.cs
│ │ ├── CustomTypeInfo.cs
│ │ ├── CustomTypeValue.cs
│ │ ├── DotNetTypeMap.cs
│ │ ├── FileOrFolderInfo.cs
│ │ ├── FrameworkInfo.cs
│ │ ├── FunctionInfo.cs
│ │ ├── FunctionInfoExtensions.cs
│ │ ├── IntrinsicFunctions.cs
│ │ ├── ItemInfo.cs
│ │ ├── MSBuildValueKind.cs
│ │ ├── MetadataInfo.cs
│ │ ├── PropertyInfo.cs
│ │ ├── TargetInfo.cs
│ │ ├── TaskInfo.cs
│ │ ├── ValueKindExtensions.cs
│ │ ├── ValueKindInfo.cs
│ │ └── VariableInfo.cs
│ └── WellKnownTaskFactory.cs
├── MSBuildSdkReference.cs
├── MonoDevelop.MSBuild.csproj
├── NoopTaskMetadataBuilder.cs
├── NullMSBuildEnvironment.cs
├── OneOrMany.cs
├── Options
│ ├── MSBuildCompletionOptions.cs
│ └── MSBuildEditorOptions.cs
├── PackageSearch
│ ├── .editorconfig
│ ├── Contracts
│ │ ├── IDependencyManager.cs
│ │ ├── IPackageFeed.cs
│ │ ├── IPackageFeedFactory.cs
│ │ ├── IPackageFeedFactorySelector.cs
│ │ ├── IPackageFeedRegistryProvider.cs
│ │ ├── IPackageFeedSearchJob.cs
│ │ ├── IPackageFeedSearcher.cs
│ │ ├── IPackageInfo.cs
│ │ ├── IPackageNameSearchResult.cs
│ │ ├── IPackageQueryConfiguration.cs
│ │ ├── IPackageSearchManager.cs
│ │ ├── IPackageVersionSearchResult.cs
│ │ └── PackageType.cs
│ ├── Feeds
│ │ ├── Disk
│ │ │ ├── NuGetDiskFeedFactory.cs
│ │ │ ├── NuGetPackageMatcher.cs
│ │ │ ├── NuGetV2DiskFeed.cs
│ │ │ └── NuGetV3DiskFeed.cs
│ │ ├── FeedKind.cs
│ │ ├── NuSpecReader.cs
│ │ ├── PackageFeedFactoryBase.cs
│ │ ├── PackageFeedFactorySelector.cs
│ │ ├── PackageInfo.cs
│ │ ├── PackageQueryConfiguration.cs
│ │ └── Web
│ │ │ ├── NuGetV2ServiceFeed.cs
│ │ │ └── NuGetV3ServiceFeed.cs
│ ├── IO
│ │ ├── FileSystem.cs
│ │ ├── IFileSystem.cs
│ │ ├── IWebRequestFactory.cs
│ │ ├── WebRequestFactory.cs
│ │ └── WebRequestFactoryExtensions.cs
│ ├── PackageSearchHelpers.cs
│ ├── Search
│ │ ├── PackageFeedSearchJob.cs
│ │ ├── PackageNameSearchResult.cs
│ │ ├── PackageSearchManager.cs
│ │ └── PackageVersionSearchResult.cs
│ └── SemanticVersion.cs
├── Resources
│ ├── ElementDescriptions.resx
│ ├── HelpDescriptions.resx
│ └── HelpUrls.resx
├── Schema
│ ├── BuiltInSchema.cs
│ ├── BuiltInSchemaId.cs
│ ├── DescriptionFormatter.cs
│ ├── FrameworkInfoProvider.PlatformId.cs
│ ├── FrameworkInfoProvider.cs
│ ├── IMSBuildSchema.cs
│ ├── MSBuildCompletionExtensions.cs
│ ├── MSBuildIntrinsics.cs
│ ├── MSBuildSchema.SchemaLoadState.cs
│ ├── MSBuildSchema.TypeInfoLoader.cs
│ ├── MSBuildSchema.cs
│ ├── MSBuildSchemaExtensions.cs
│ ├── MSBuildSchemaLoadError.cs
│ ├── MSBuildSchemaProvider.cs
│ └── MSBuildSchemaWriter.cs
├── Schemas
│ ├── AnalyzerWarningCodes.buildschema.json
│ ├── Android.buildschema.json
│ ├── Appx.buildschema.json
│ ├── AspNetCore.buildschema.json
│ ├── AspireAppHost.buildschema.json
│ ├── AspireDashboardSdk.buildschema.json
│ ├── AspireHostingOrchestration.buildschema.json
│ ├── AspireHostingSdk.buildschema.json
│ ├── CSharp.buildschema.json
│ ├── CSharpWarningCodes.buildschema.json
│ ├── CodeAnalysis.buildschema.json
│ ├── CommonTargets.buildschema.json
│ ├── Cpp.buildschema.json
│ ├── GenerateAssemblyInfo.buildschema.json
│ ├── GrpcProtobuf.buildschema.json
│ ├── ILCompiler.buildschema.json
│ ├── ILLink.buildschema.json
│ ├── JavaScript.buildschema.json
│ ├── NetSdk.buildschema.json
│ ├── NuGet.buildschema.json
│ ├── NuGetPack.buildschema.json
│ ├── ProjectSystemCps.buildschema.json
│ ├── ProjectSystemMps.buildschema.json
│ ├── RazorSdk.buildschema.json
│ ├── Roslyn.buildschema.json
│ ├── StyleRuleCodes.buildschema.json
│ ├── ValidatePackage.buildschema.json
│ ├── VisualBasic.buildschema.json
│ ├── WindowsDesktop.buildschema.json
│ └── buildschema.json
├── SdkResolution
│ ├── DefaultSdkResolver.cs
│ ├── Imported
│ │ ├── .editorconfig
│ │ ├── CoreCLRAssemblyLoader.cs
│ │ ├── MSBuildLoadContext.cs
│ │ ├── MSBuildSdkResolver.cs
│ │ └── SdkResolverManifest.cs
│ ├── MSBuildSdkResolver.SdkLoggerImpl.cs
│ ├── MSBuildSdkResolver.SdkResolverContextImpl.cs
│ ├── MSBuildSdkResolver.SdkResultFactoryImpl.cs
│ ├── MSBuildSdkResolver.SdkResultImpl.cs
│ ├── MSBuildSdkResolver.cs
│ └── SdkInfo.cs
├── Util
│ ├── CollectionExtensions.cs
│ ├── FilePathUtils.cs
│ ├── MSBuildEscaping.cs
│ ├── MSBuildLoggerExtensions.cs
│ ├── Platform.cs
│ └── XmlEscaping.cs
├── WellKnownProperties.cs
└── Workspace
│ ├── MSBuildFileExtension.cs
│ ├── MSBuildFileKind.cs
│ └── MSBuildFileKindExtensions.cs
├── MonoDevelop.MSBuildEditor.sln
├── MonoDevelop.MSBuildEditor
├── Analysis
│ ├── CocoaDifferenceViewElementFactory.cs
│ ├── CocoaMSBuildSuggestedAction.cs
│ └── ICocoaDifferenceViewerExtensions.cs
├── MSBuildCommandHandler.cs
├── MSBuildCommands.cs
├── MonoDevelop.MSBuildEditor.csproj
├── MonoDevelopCompilationProvider.cs
├── MonoDevelopMSBuildEditorHost.cs
├── MonoDevelopMSBuildEnvironment.cs
├── MonoDevelopSdkResolver.cs
├── MonoDevelopStreamingFindReferencesPresenter.cs
├── PackageSearch
│ └── MonoDevelopPackageFeedRegistry.cs
├── Pads
│ ├── DocumentWithMimeTypeTracker.cs
│ ├── MSBuildImportNavigator.cs
│ └── MSBuildImportNavigatorPad.cs
├── Properties
│ ├── AddinInfo.cs
│ └── Manifest.addin.xml
├── Templates
│ ├── Project.xft.xml
│ └── Project.xml
└── Tests
│ └── MonoDevelop.MSBuildEditor.Tests.csproj
├── NoVSEditor.slnf
├── NuGet.Config
├── README.md
├── RELEASES.md
├── TODO.md
├── XsdSchemaImporter
├── .editorconfig
├── ConstrainedXmlResolver.cs
├── DownloadCache.cs
├── MSBuildSchemaUtils.cs
├── MSBuildXsdSchemaReader.cs
├── Program.cs
├── XElementExtensions.cs
└── XsdSchemaImporter.csproj
├── art
├── icon-128.png
├── icon-32.png
├── icon-32.svg
├── icon.png
└── icon.svg
├── docs
└── PrivacyStatement.md
├── images
├── completion.gif
├── condition-completion.png
├── find-references.png
├── import-tooltip.png
├── property-function-completion.png
├── tooltip.png
├── validation.png
├── vs-code-fixes.png
├── vs-condition-completion.png
├── vs-expression-completion.png
├── vs-find-references-cropped.png
├── vs-find-references.png
├── vs-packageref-completion.gif
├── vs-quick-info-cropped.png
├── vs-quick-info.png
├── vs-schema.png
└── vs-validation.png
├── msbuild-editor-vscode
├── .editorconfig
├── .eslintrc.json
├── .vscode-test.mjs
├── .vscodeignore
├── CHANGELOG.md
├── README.md
├── esbuild.js
├── images
│ ├── vscode-code-fix.png
│ ├── vscode-condition-completion.png
│ ├── vscode-expression-completion.png
│ ├── vscode-find-references.png
│ ├── vscode-nowarn-completion.png
│ ├── vscode-packageref-completion.png
│ ├── vscode-quick-info.png
│ ├── vscode-schema.png
│ └── vscode-validation.png
├── language-configuration.json
├── package-lock.json
├── package.json
├── package.nls.json
├── src
│ ├── completionItemMiddleware.ts
│ ├── extension.ts
│ ├── hoverMiddleware.ts
│ ├── options.ts
│ ├── roslynImport
│ │ ├── common.ts
│ │ ├── compositeDisposable.ts
│ │ ├── coreclrDebug
│ │ │ └── util.ts
│ │ ├── disposable.ts
│ │ ├── eventStream.ts
│ │ ├── lsptoolshost
│ │ │ ├── commands.ts
│ │ │ ├── dotnetRuntimeExtensionResolver.ts
│ │ │ ├── optionChanges.ts
│ │ │ ├── roslynLanguageClient.ts
│ │ │ ├── roslynLanguageServer.ts
│ │ │ ├── roslynProtocol.ts
│ │ │ ├── showToastNotification.ts
│ │ │ └── uriConverter.ts
│ │ ├── main.ts
│ │ ├── omnisharp
│ │ │ ├── eventType.ts
│ │ │ └── loggingEvents.ts
│ │ ├── packageManager
│ │ │ └── absolutePath.ts
│ │ └── shared
│ │ │ ├── constants
│ │ │ ├── IHostExecutableResolver.ts
│ │ │ └── hostExecutableInformation.ts
│ │ │ ├── observables
│ │ │ └── createOptionStream.ts
│ │ │ ├── observers
│ │ │ └── optionChangeObserver.ts
│ │ │ ├── options.ts
│ │ │ ├── platform.ts
│ │ │ ├── reportIssue.ts
│ │ │ └── utils
│ │ │ ├── dotnetInfo.ts
│ │ │ └── getDotnetInfo.ts
│ └── test
│ │ └── extension.test.ts
├── syntaxes
│ ├── OSSREADME.json
│ └── msbuild.tmLanguage.json
└── tsconfig.json
├── private.snk
├── sample
└── todo.csproj
└── version.json
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.sln eol=crlf
3 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: Main
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | concurrency:
9 | group: ci-main-${{ github.ref }}-1
10 | cancel-in-progress: true
11 |
12 | jobs:
13 | build:
14 | uses: ./.github/workflows/build.yml
--------------------------------------------------------------------------------
/.github/workflows/pull_request.yml:
--------------------------------------------------------------------------------
1 | name: Pull Request
2 |
3 | on:
4 | pull_request:
5 | branches:
6 | - main
7 |
8 | concurrency:
9 | group: ci-pr-${{ github.ref }}-1
10 | cancel-in-progress: true
11 |
12 | jobs:
13 | build:
14 | uses: ./.github/workflows/build.yml
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.userprefs
2 | bin
3 | obj
4 | packages
5 | *.suo
6 | .DS_Store
7 | .vs
8 | *.user
9 | *.binlog
10 | out
11 | node_modules
12 | .vscode-test
13 | dist
14 |
15 | # these are copied during vsix packaging
16 | /msbuild-editor-vscode/LICENSE
17 | /msbuild-editor-vscode/server
18 | /msbuild-editor-vscode/*.vsix
19 | /msbuild-editor-vscode/icon.png
20 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "MonoDevelop.Xml"]
2 | path = MonoDevelop.Xml
3 | url = https://github.com/mhutch/MonoDevelop.Xml.git
4 | [submodule "external/NuGet.Client"]
5 | path = external/NuGet.Client
6 | url = https://github.com/NuGet/NuGet.Client.git
7 | [submodule "external/roslyn"]
8 | path = external/roslyn
9 | url = https://github.com/dotnet/roslyn.git
10 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | // See http://go.microsoft.com/fwlink/?LinkId=827846
3 | // for the documentation about the extensions.json format
4 | "recommendations": [
5 | "dbaeumer.vscode-eslint",
6 | "amodio.tsl-problem-matcher",
7 | "ms-vscode.extension-test-runner",
8 | "ms-dotnettools.csharp",
9 | "streetsidesoftware.code-spell-checker",
10 | "editorconfig.editorconfig",
11 | "connor4312.esbuild-problem-matchers",
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // A launch configuration that compiles the extension and then opens it inside a new window
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | {
6 | "version": "0.2.0",
7 | "configurations": [
8 | {
9 | "name": "Run VS Code Extension",
10 | "type": "extensionHost",
11 | "request": "launch",
12 | "runtimeExecutable": "${execPath}",
13 | "args": [
14 | "--extensionDevelopmentPath=${workspaceFolder}/msbuild-editor-vscode",
15 | ],
16 | "env": {
17 | "MSBUILD_LANGUAGE_SERVER_PATH": "${workspaceFolder}/artifacts/bin/MSBuildLanguageServer/debug/MSBuildLanguageServer.dll",
18 | },
19 | "outFiles": [
20 | "${workspaceFolder}/msbuild-editor-vscode/dist/**/*.js"
21 | ],
22 | "sourceMaps": true,
23 | "preLaunchTask": "Build VS Code Extension in Background",
24 | }
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 | $(MSBuildThisFileDirectory)private.snk
6 | latest
7 | embedded
8 | $(MSBuildProjectName)
9 | true
10 | true
11 |
12 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer.Tests/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: http://EditorConfig.org
2 |
3 | [*.cs]
4 |
5 | # revert settings to match roslyn style better
6 | indent_style = space
7 | trim_trailing_whitespace = false
8 | csharp_space_between_method_declaration_name_and_open_parenthesis = false
9 | csharp_space_between_method_call_name_and_opening_parenthesis = false
10 | csharp_space_after_keywords_in_control_flow_statements = false
11 |
12 | # Newline settings
13 | csharp_new_line_before_open_brace = methods, properties, control_blocks, types
14 | csharp_new_line_before_else = false
15 | csharp_new_line_before_catch = false
16 | csharp_new_line_before_finally = false
17 |
18 | # VS threading analyzer triggers on imported roslyn code
19 | dotnet_diagnostic.VSTHRD002.severity = none
20 | dotnet_diagnostic.VSTHRD003.severity = none
21 | dotnet_diagnostic.VSTHRD103.severity = none
22 | dotnet_diagnostic.VSTHRD110.severity = none
--------------------------------------------------------------------------------
/MSBuildLanguageServer.Tests/Extensions/CompletionListExtensions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System.Diagnostics.CodeAnalysis;
5 |
6 | using LSP = Roslyn.LanguageServer.Protocol;
7 |
8 | namespace MonoDevelop.MSBuild.LanguageServer.Tests;
9 |
10 | static class CompletionListExtensions
11 | {
12 | public static void AssertContains(this LSP.CompletionList list, string name)
13 | {
14 | var item = list.Items.FirstOrDefault(i => i.Label == name);
15 | Assert.NotNull(item); // "Completion result is missing item '{0}'", name);
16 | }
17 |
18 | public static void AssertNonEmpty([NotNull] this LSP.CompletionList? list)
19 | {
20 | Assert.NotNull(list);
21 | Assert.NotEmpty(list.Items);
22 | }
23 |
24 | public static void AssertItemCount([NotNull] this LSP.CompletionList? list, int expectedCount)
25 | {
26 | Assert.NotNull(list);
27 | Assert.Equal(expectedCount, list.Items.Length);
28 | }
29 |
30 | public static void AssertDoesNotContain(this LSP.CompletionList list, string name)
31 | {
32 | var item = list.Items.FirstOrDefault(i => i.Label == name);
33 | Assert.Null(item); //, "Completion result has unexpected item '{0}'", name);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer.Tests/Import/AbstractLanguageServerProtocolTests.Edited.cs:
--------------------------------------------------------------------------------
1 | // heavily edited methods from
2 | // https://github.com/dotnet/roslyn/blob/1a4c3f429fe13a2e928c800cebbf93154447095a/src/EditorFeatures/TestUtilities/LanguageServer/AbstractLanguageServerProtocolTests.cs
3 |
4 | // Licensed to the .NET Foundation under one or more agreements.
5 | // The .NET Foundation licenses this file to you under the MIT license.
6 | // See the LICENSE file in the project root for more information.
7 |
8 | using Microsoft.CodeAnalysis.Test.Utilities;
9 | using Microsoft.CodeAnalysis.Editor.UnitTests;
10 |
11 | namespace Roslyn.Test.Utilities
12 | {
13 | partial class AbstractLanguageServerProtocolTests
14 | {
15 | protected static readonly TestComposition EditorFeaturesLspComposition = EditorTestCompositions.LanguageServerProtocolEditorFeatures;
16 |
17 | protected static readonly TestComposition FeaturesLspComposition = EditorTestCompositions.LanguageServerProtocol;
18 | protected virtual TestComposition Composition => EditorFeaturesLspComposition;
19 | }
20 | }
--------------------------------------------------------------------------------
/MSBuildLanguageServer/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: http://EditorConfig.org
2 |
3 | [*.cs]
4 |
5 | # revert settings to match roslyn style better
6 | indent_style = space
7 | trim_trailing_whitespace = false
8 | csharp_space_between_method_declaration_name_and_open_parenthesis = false
9 | csharp_space_between_method_call_name_and_opening_parenthesis = false
10 | csharp_space_after_keywords_in_control_flow_statements = false
11 |
12 | # Newline settings
13 | csharp_new_line_before_open_brace = methods, properties, control_blocks, types
14 | csharp_new_line_before_else = false
15 | csharp_new_line_before_catch = false
16 | csharp_new_line_before_finally = false
17 |
18 | # VS threading analyzer triggers on imported roslyn code
19 | dotnet_diagnostic.VSTHRD002.severity = none
20 | dotnet_diagnostic.VSTHRD003.severity = none
21 | dotnet_diagnostic.VSTHRD103.severity = none
22 | dotnet_diagnostic.VSTHRD110.severity = none
--------------------------------------------------------------------------------
/MSBuildLanguageServer/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | [assembly: SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1024:Symbols should be compared for equality", Justification = "", Scope = "member", Target = "~M:Roslyn.Utilities.GeneratedCodeUtilities.IsGeneratedSymbolWithGeneratedCodeAttribute(Microsoft.CodeAnalysis.ISymbol,Microsoft.CodeAnalysis.INamedTypeSymbol)~System.Boolean")]
9 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Handler/CodeActions/CodeActionResolveData.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System.Text.Json.Serialization;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Handler.CodeActions;
7 |
8 | class CodeActionResolveData
9 | {
10 | [JsonPropertyName("resultId")]
11 | [JsonRequired]
12 | public long ResultId { get; init; }
13 |
14 | [JsonPropertyName("index")]
15 | [JsonRequired]
16 | public int Index { get; init; }
17 | }
18 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Handler/CodeActions/UnsupportedCodeActionOperationException.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using MonoDevelop.MSBuild.Editor.CodeActions;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Handler.CodeActions;
7 |
8 | class UnsupportedCodeActionOperationException(MSBuildWorkspaceEditOperation? operation, bool isUnknown) : Exception
9 | {
10 | public MSBuildWorkspaceEditOperation? Operation { get; } = operation;
11 | public bool IsUnknown { get; } = isUnknown;
12 |
13 | public override string Message => (IsUnknown || Operation is null)
14 | ? $"Code action returned unknown workspace edit operation '{Operation?.GetType().ToString() ?? "[null]"}'"
15 | : $"Code action returned unsupported workspace edit operation '{Operation.GetType()}'";
16 | }
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Handler/Completion/CompletionItems/MSBuildNewGuidCompletionItem.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using Roslyn.LanguageServer.Protocol;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Handler.Completion.CompletionItems;
7 |
8 | class MSBuildNewGuidCompletionItem() : ILspCompletionItem
9 | {
10 | const string label = "New GUID";
11 |
12 | public bool IsMatch(CompletionItem request) => string.Equals(label, request.Label, StringComparison.Ordinal);
13 |
14 | public async ValueTask Render(CompletionRenderSettings settings, CompletionRenderContext ctx, CancellationToken cancellationToken)
15 | {
16 | var item = new CompletionItem { Label = label };
17 |
18 | if(settings.IncludeItemKind)
19 | {
20 | item.Kind = MSBuildCompletionItemKind.NewGuid;
21 | }
22 |
23 | if(settings.IncludeDocumentation)
24 | {
25 | item.Documentation = new MarkupContent {
26 | Value = "Inserts a new GUID",
27 | Kind = MarkupKind.Markdown
28 | };
29 | }
30 |
31 | if(settings.IncludeInsertText)
32 | {
33 | item.InsertText = Guid.NewGuid().ToString("B").ToUpper();
34 | }
35 |
36 | return item;
37 | }
38 | }
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Handler/Completion/CompletionItems/MSBuildSdkCompletionItem.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using MonoDevelop.MSBuild.SdkResolution;
5 |
6 | using Roslyn.LanguageServer.Protocol;
7 |
8 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Handler.Completion.CompletionItems;
9 |
10 | class MSBuildSdkCompletionItem(SdkInfo info, MSBuildCompletionDocsProvider docsProvider) : ILspCompletionItem
11 | {
12 | string label => info.Name;
13 |
14 | public bool IsMatch(CompletionItem request) => string.Equals(request.Label, label, StringComparison.Ordinal);
15 |
16 | public async ValueTask Render(CompletionRenderSettings settings, CompletionRenderContext ctx, CancellationToken cancellationToken)
17 | {
18 | var item = new CompletionItem { Label = label };
19 |
20 | if(settings.IncludeItemKind)
21 | {
22 | item.Kind = MSBuildCompletionItemKind.Sdk;
23 | }
24 |
25 | if(settings.IncludeDocumentation && info.Path is string sdkPath)
26 | {
27 | // FIXME: better docs
28 | item.Documentation = new MarkupContent { Kind = MarkupKind.Markdown, Value = $"`{sdkPath}`" };
29 | }
30 |
31 | return item;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Handler/Completion/CompletionItems/XmlEntityCompletionItem.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using Roslyn.LanguageServer.Protocol;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Handler.Completion.CompletionItems;
7 |
8 | class XmlEntityCompletionItem(string name, string character) : ILspCompletionItem
9 | {
10 | readonly string label = $"&{name};";
11 |
12 | public bool IsMatch(CompletionItem request) => string.Equals(request.Label, label, StringComparison.Ordinal);
13 |
14 |
15 | //TODO: need to tweak semicolon insertion for XmlCompletionItemKind.Entity
16 | public ValueTask Render(CompletionRenderSettings settings, CompletionRenderContext ctx, CancellationToken cancellationToken)
17 | {
18 | var item = new CompletionItem { Label = label, FilterText = name, Kind = XmlToLspCompletionItemKind.Entity };
19 |
20 | if(settings.IncludeDocumentation)
21 | {
22 | item.Documentation = $"Escaped '{character}'";
23 | };
24 |
25 | return new(item);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Handler/Completion/PackageCompletionDocsProvider.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using ProjectFileTools.NuGetSearch.Contracts;
5 | using ProjectFileTools.NuGetSearch.Feeds;
6 |
7 | using Roslyn.LanguageServer.Protocol;
8 |
9 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Handler.Completion;
10 |
11 | record class PackageCompletionDocsProvider(IPackageSearchManager PackageSearchManager, MSBuildCompletionDocsProvider docsProvider, string? TargetFrameworkSearchParameter)
12 | {
13 | public Task GetPackageDocumentation(string packageId, string? packageVersion, FeedKind feedKind, CancellationToken cancellationToken)
14 | => docsProvider.GetPackageDocumentation(PackageSearchManager, packageId, packageVersion, feedKind, TargetFrameworkSearchParameter, cancellationToken);
15 | }
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Handler/Completion/XmlCommitKind.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Handler.Completion;
5 |
6 | ///
7 | /// Controls how XML completion items are committed
8 | ///
9 | enum XmlCommitKind
10 | {
11 | Element,
12 | SelfClosingElement,
13 | Attribute,
14 | AttributeValue,
15 | CData,
16 | Comment,
17 | Prolog,
18 | Entity,
19 | ClosingTag,
20 | MultipleClosingTags
21 | }
22 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Handler/Completion/XmlToLspCompletionItemKind.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using Roslyn.LanguageServer.Protocol;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Handler.Completion;
7 |
8 | ///
9 | /// Central location for mapping XML item kinds to values
10 | ///
11 | class XmlToLspCompletionItemKind
12 | {
13 | public const CompletionItemKind ClosingTag = CompletionItemKind.CloseElement;
14 | public const CompletionItemKind Comment = CompletionItemKind.TagHelper;
15 | public const CompletionItemKind CData = CompletionItemKind.TagHelper;
16 | public const CompletionItemKind Prolog = CompletionItemKind.TagHelper;
17 | public const CompletionItemKind Entity = CompletionItemKind.TagHelper;
18 | }
19 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/InternalsVisibleTo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System.Runtime.CompilerServices;
5 | using MonoDevelop.MSBuild;
6 |
7 | [assembly: InternalsVisibleTo ($"MSBuildLanguageServer.Tests, {IVT.PublicKeyAtt}")]
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Parser/LspXmlParserServiceFactory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System.Composition;
5 | using Microsoft.CodeAnalysis.LanguageServer;
6 | using Microsoft.CodeAnalysis.LanguageServer.Handler;
7 | using Microsoft.CommonLanguageServerProtocol.Framework;
8 |
9 | using MonoDevelop.MSBuild.Editor.LanguageServer.Workspace;
10 |
11 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Parser;
12 |
13 | [ExportCSharpVisualBasicLspServiceFactory(typeof(LspXmlParserService)), Shared]
14 | class LspXmlParserServiceFactory : ILspServiceFactory
15 | {
16 | public ILspService CreateILspService(LspServices lspServices, WellKnownLspServerKinds serverKind)
17 | {
18 | var logger = lspServices.GetRequiredService();
19 | var workspace = lspServices.GetRequiredService();
20 | return new LspXmlParserService(logger, workspace);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Parser/NullBackgroundParseService.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using MonoDevelop.Xml.Editor.Parsing;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Parser;
7 |
8 | class NullBackgroundParseService : IBackgroundParseService
9 | {
10 | public static NullBackgroundParseService Instance { get; } = new();
11 |
12 | public bool IsRunning => throw new NotSupportedException();
13 |
14 | public event EventHandler RunningStateChanged
15 | {
16 | add => throw new NotSupportedException();
17 | remove => throw new NotSupportedException();
18 | }
19 |
20 | public void RegisterBackgroundOperation(Task task)
21 | {
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Services/CodeActionCacheFactory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System.Composition;
5 |
6 | using Microsoft.CodeAnalysis.LanguageServer;
7 | using Microsoft.CodeAnalysis.LanguageServer.Handler;
8 |
9 | using MonoDevelop.MSBuild.Editor.CodeActions;
10 |
11 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Services;
12 |
13 | [ExportCSharpVisualBasicLspServiceFactory(typeof(CodeActionCache)), Shared]
14 | internal class CodeActionCacheFactory : ILspServiceFactory
15 | {
16 | [ImportingConstructor]
17 | public CodeActionCacheFactory()
18 | {
19 | }
20 |
21 | public ILspService CreateILspService(LspServices lspServices, WellKnownLspServerKinds serverKind) => new CodeActionCache();
22 | }
23 |
24 | class CodeActionCache : ResolveCache>
25 | {
26 | public CodeActionCache() : base(maxCacheSize: 3) { }
27 | }
28 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Services/CompletionListCacheFactory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System.Composition;
5 |
6 | using Microsoft.CodeAnalysis.LanguageServer;
7 | using Microsoft.CodeAnalysis.LanguageServer.Handler;
8 |
9 | using MonoDevelop.MSBuild.Editor.LanguageServer.Handler.Completion;
10 |
11 | using LSP = Roslyn.LanguageServer.Protocol;
12 |
13 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Services;
14 |
15 | [ExportCSharpVisualBasicLspServiceFactory(typeof(CompletionListCache)), Shared]
16 | internal class CompletionListCacheFactory : ILspServiceFactory
17 | {
18 | [ImportingConstructor]
19 | public CompletionListCacheFactory()
20 | {
21 | }
22 |
23 | public ILspService CreateILspService(LspServices lspServices, WellKnownLspServerKinds serverKind) => new CompletionListCache();
24 | }
25 |
26 | class CompletionListCache : ResolveCache
27 | {
28 | public CompletionListCache() : base(maxCacheSize: 3) { }
29 | }
30 |
31 | record CompletionListCacheEntry(List Items, CompletionRenderContext Context) { }
32 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Services/LspNavigationService.FindReferencesSearchJob.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using Microsoft.CodeAnalysis.Text;
5 |
6 | using MonoDevelop.Xml.Dom;
7 |
8 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Services;
9 |
10 | partial class LspNavigationService
11 | {
12 | class FindReferencesSearchJob
13 | {
14 | public FindReferencesSearchJob(string filename, XDocument? document, SourceText? sourceText)
15 | {
16 | Filename = filename;
17 | Document = document;
18 | SourceText = sourceText;
19 | }
20 |
21 | public string Filename { get; }
22 | public XDocument? Document { get; set; }
23 | public SourceText? SourceText { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Services/LspNavigationServiceFactory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System.Composition;
5 |
6 | using Microsoft.CodeAnalysis.LanguageServer;
7 | using Microsoft.CodeAnalysis.LanguageServer.Handler;
8 | using Microsoft.CommonLanguageServerProtocol.Framework;
9 |
10 | using MonoDevelop.MSBuild.Editor.LanguageServer.Workspace;
11 |
12 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Services;
13 |
14 | [ExportCSharpVisualBasicLspServiceFactory(typeof(LspNavigationService)), Shared]
15 | internal class LspNavigationServiceFactory : ILspServiceFactory
16 | {
17 | [ImportingConstructor]
18 | public LspNavigationServiceFactory()
19 | {
20 | }
21 |
22 | public ILspService CreateILspService(LspServices lspServices, WellKnownLspServerKinds serverKind)
23 | {
24 | var logger = lspServices.GetRequiredService();
25 | var extLogger = logger.ToILogger();
26 | var workspaceService = lspServices.GetRequiredService();
27 | var xmlParserService = lspServices.GetRequiredService();
28 | return new LspNavigationService(workspaceService, xmlParserService, extLogger);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Workspace/EditorDocumentState.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using Microsoft.CodeAnalysis;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Workspace;
7 |
8 | class EditorDocumentState (DocumentId id, string filePath, TextAndVersion text)
9 | {
10 | public DocumentId Id => id;
11 | public string FilePath => filePath;
12 | public TextAndVersion Text => text ?? throw new InvalidOperationException("Text not yet loaded");
13 | }
14 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Workspace/LspEditorDocument.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using Microsoft.CodeAnalysis;
5 | using Microsoft.CodeAnalysis.Text;
6 |
7 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Workspace;
8 |
9 | class LspEditorDocument
10 | {
11 | EditorDocumentState state;
12 |
13 | public EditorDocumentState CurrentState => state;
14 |
15 | public DocumentId Id => state.Id;
16 | public string FilePath => state.FilePath;
17 | public TextAndVersion Text => state.Text;
18 |
19 | public LspEditorDocument(DocumentId id, string filePath, SourceText initialText)
20 | {
21 | state = new EditorDocumentState(id, filePath, TextAndVersion.Create(initialText, VersionStamp.Default));
22 | }
23 |
24 | internal void UpdateText (SourceText text)
25 | {
26 | EditorDocumentState oldState = state;
27 | state = new EditorDocumentState (
28 | oldState.Id,
29 | oldState.FilePath,
30 | TextAndVersion.Create(text, oldState.Text?.Version.GetNewerVersion() ?? VersionStamp.Default)
31 | );
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/MSBuildLanguageServer/Workspace/LspEditorWorkspaceFactory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System.Composition;
5 | using Microsoft.CodeAnalysis.LanguageServer;
6 | using Microsoft.CodeAnalysis.LanguageServer.Handler;
7 |
8 | namespace MonoDevelop.MSBuild.Editor.LanguageServer.Workspace;
9 |
10 | [ExportCSharpVisualBasicLspServiceFactory(typeof(LspEditorWorkspace)), Shared]
11 | class LspEditorWorkspaceFactory : ILspServiceFactory
12 | {
13 | public ILspService CreateILspService(LspServices lspServices, WellKnownLspServerKinds serverKind)
14 | {
15 | return new LspEditorWorkspace();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.Common/CodeActions/MSBuildChangeAnnotation.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | namespace MonoDevelop.MSBuild.Editor.CodeActions
5 | {
6 | class MSBuildChangeAnnotation (string label)
7 | {
8 | public string Label => label;
9 |
10 | public bool NeedsConfirmation { get; set; }
11 |
12 | public string? Description { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.Common/CodeActions/MSBuildDocumentCreate.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | namespace MonoDevelop.MSBuild.Editor.CodeActions;
5 |
6 | class MSBuildDocumentCreate (string filename) : MSBuildWorkspaceEditOperation (filename)
7 | {
8 | public string? Content { get; set; }
9 |
10 | public bool Overwrite { get; set; }
11 |
12 | public bool IgnoreIfExists { get; set; }
13 |
14 | public MSBuildChangeAnnotation? Annotation { get; set; }
15 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.Common/CodeActions/MSBuildDocumentDelete.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | namespace MonoDevelop.MSBuild.Editor.CodeActions;
5 |
6 | class MSBuildDocumentDelete (string fileOrFolder) : MSBuildWorkspaceEditOperation (fileOrFolder)
7 | {
8 | public string FileOrFolder => Filename;
9 |
10 | public bool Recursive { get; set; }
11 |
12 | public bool IgnoreIfNotExists { get; set; }
13 |
14 | public MSBuildChangeAnnotation? Annotation { get; set; }
15 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.Common/CodeActions/MSBuildDocumentEdit.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using Microsoft.CodeAnalysis.Text;
5 |
6 | using TextSpan = MonoDevelop.Xml.Dom.TextSpan;
7 |
8 | namespace MonoDevelop.MSBuild.Editor.CodeActions;
9 |
10 | class MSBuildDocumentEdit (string filename, SourceText? originalText, MSBuildTextEdit[] textEdits) : MSBuildWorkspaceEditOperation (filename)
11 | {
12 | public MSBuildTextEdit[] TextEdits => textEdits;
13 |
14 | public SourceText? OriginalText { get; } = originalText;
15 | }
16 |
17 | class MSBuildTextEdit(TextSpan range, string newText, TextSpan[]? relativeSelections = null)
18 | {
19 | public string NewText => newText;
20 |
21 | public TextSpan Range => range;
22 |
23 | ///
24 | /// If this edit is in the focused document, then these ranges (relative to the beginning of the ) will be selected after the operation is complete.
25 | ///
26 | public TextSpan[]? RelativeSelections => relativeSelections;
27 |
28 | public MSBuildChangeAnnotation? Annotation { get; set; }
29 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.Common/CodeActions/MSBuildDocumentRename.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | namespace MonoDevelop.MSBuild.Editor.CodeActions;
5 |
6 | class MSBuildDocumentRename (string oldFilename, string newFilename) : MSBuildWorkspaceEditOperation (newFilename)
7 | {
8 | public string OldFilename => oldFilename;
9 | public string NewFilename => Filename;
10 |
11 | public bool Overwrite { get; set; }
12 |
13 | public bool IgnoreIfExists { get; set; }
14 |
15 | public MSBuildChangeAnnotation? Annotation { get; set; }
16 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.Common/CodeActions/MSBuildWorkspaceEdit.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System.Collections.Generic;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.CodeActions
7 | {
8 | class MSBuildWorkspaceEdit (IEnumerable? operations = null)
9 | {
10 | public IList Operations => new List (operations ?? []);
11 |
12 | public string? FocusFile { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.Common/CodeActions/MSBuildWorkspaceEditOperation.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | namespace MonoDevelop.MSBuild.Editor.CodeActions
5 | {
6 | class MSBuildWorkspaceEditOperation (string filename)
7 | {
8 | public string Filename => filename;
9 | }
10 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.Common/CodeActions/SourceTextExtensions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using Microsoft.CodeAnalysis.Text;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.CodeActions;
7 |
8 | static class SourceTextExtensions
9 | {
10 | public static string? GetLineBreakTextForLineContainingOffset (this SourceText text, int offset)
11 | {
12 | var currentLine = text.Lines.GetLineFromPosition (offset);
13 | return text.GetLineBreakTextForLine (currentLine);
14 | }
15 |
16 | public static string? GetLineBreakTextForLine (this SourceText text, TextLine line)
17 | {
18 | int length = line.EndIncludingLineBreak - line.End;
19 | if (length == 0) {
20 | return null;
21 | }
22 | if (length == 1) {
23 | return text[line.End].ToString ();
24 | }
25 | return $"{text[line.End]}{text[line.End + 1]}";
26 | }
27 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.Common/InternalsVisibleTo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System.Runtime.CompilerServices;
5 | using MonoDevelop.MSBuild;
6 |
7 | [assembly: InternalsVisibleTo ($"MonoDevelop.MSBuild.Tests, {IVT.PublicKeyAtt}")]
8 | [assembly: InternalsVisibleTo ($"MonoDevelop.MSBuild.Tests.Editor, {IVT.PublicKeyAtt}")]
9 | [assembly: InternalsVisibleTo ($"MSBuildLanguageServer.Tests, {IVT.PublicKeyAtt}")]
10 |
11 | [assembly: InternalsVisibleTo ($"MSBuildLanguageServer, {IVT.PublicKeyAtt}")]
12 | [assembly: InternalsVisibleTo ($"MonoDevelop.MSBuild.Editor, {IVT.PublicKeyAtt}")]
13 | [assembly: InternalsVisibleTo ($"MonoDevelop.MSBuild.Editor.VisualStudio, {IVT.PublicKeyAtt}")]
14 | [assembly: InternalsVisibleTo ($"MonoDevelop.MSBuildEditor, {IVT.PublicKeyAtt}")]
15 | [assembly: InternalsVisibleTo ($"Microsoft.Ide.LanguageService.MSBuild, PublicKey=0024000004800000940000000602000000240000525341310004000001000100675da410943cdcf89a2bbd3716e451b3c35c0de9278a874e06d143dbc861f7b4d21771131177e413290078b98615421b2bb9ac25c14021c4e2c7b967407b5ea96417317ff8bdb1ef34e0d63f5965bdf92841bdaae505987af712a2e1951b2ff76a16d211e0d5ae2c444f55dbd0a3c0f5bed051af0cf7bae49114c4e0c527c4ed")]
16 |
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.Common/Roslyn/IRoslynCompilationProvider.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using Microsoft.CodeAnalysis;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.Roslyn
7 | {
8 | ///
9 | /// Allows consumers of to control how it loads
10 | /// assemblies.
11 | ///
12 | public interface IRoslynCompilationProvider
13 | {
14 | MetadataReference CreateReference (string assemblyPath);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.Common/Roslyn/RoslynHelpers.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using Microsoft.CodeAnalysis;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.Roslyn
7 | {
8 | static class RoslynHelpers
9 | {
10 | public static string GetFullName (this ITypeSymbol symbol)
11 | {
12 | var sb = new System.Text.StringBuilder ();
13 | var ns = symbol.ContainingNamespace;
14 | while (ns != null && !string.IsNullOrEmpty (ns.Name)) {
15 | sb.Insert (0, '.');
16 | sb.Insert (0, ns.Name);
17 | ns = ns.ContainingNamespace;
18 | }
19 | sb.Append (symbol.Name);
20 | return sb.ToString ();
21 | }
22 |
23 | // loading the docs from roslyn can be expensive, return an empty string and the symbol
24 | // this mean callers have to resolve the docs from the symbol themselves. it's a lot
25 | // simpler to push the async logic to the callers than to make all the BaseInfo.Description
26 | // implementations and usages async
27 | public static DisplayText GetDescription (ISymbol symbol) => new DisplayText ("", symbol);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/Logging/MSBuildEditorLoggerProvider.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | #nullable enable
5 |
6 | using System.ComponentModel.Composition;
7 |
8 | using Microsoft.Extensions.Logging;
9 | using Microsoft.Extensions.Logging.Abstractions;
10 |
11 | using Microsoft.VisualStudio.Shell;
12 | using Microsoft.VisualStudio.Utilities;
13 |
14 | using MonoDevelop.Xml.Editor.Logging;
15 |
16 | namespace MonoDevelop.MSBuild.Editor.VisualStudio.Logging;
17 |
18 | [Export (typeof (IEditorLoggerProvider))]
19 | [Name ("MSBuild Editor Logger Provider")]
20 | [ContentType (MSBuildContentType.Name)]
21 | class MSBuildEditorLoggerProvider : IEditorLoggerProvider
22 | {
23 | readonly MSBuildExtensionLogger? loggerFactory;
24 |
25 | [ImportingConstructor]
26 | public MSBuildEditorLoggerProvider (SVsServiceProvider serviceProvider)
27 | {
28 | loggerFactory = (MSBuildExtensionLogger) serviceProvider.GetService (typeof (MSBuildExtensionLogger));
29 | }
30 |
31 | public ILogger CreateLogger (string categoryName) => loggerFactory?.CreateEditorLogger (categoryName) ?? NullLogger.Instance;
32 |
33 | public void Dispose () { }
34 | }
35 |
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/Logging/MSBuildEditorSettingsStorage.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | #nullable enable
5 |
6 | using System;
7 | using System.IO;
8 |
9 | namespace MonoDevelop.MSBuild.Editor.VisualStudio.Logging;
10 |
11 | class MSBuildEditorSettingsStorage
12 | {
13 | const string editorDataDirectoryName = "MSBuildEditor";
14 |
15 | readonly string roamingDataDir;
16 | readonly string localDataDir;
17 |
18 | public MSBuildEditorSettingsStorage ()
19 | {
20 | localDataDir = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData), editorDataDirectoryName);
21 | roamingDataDir = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), editorDataDirectoryName);
22 | }
23 |
24 | public string RoamingDataDir => roamingDataDir;
25 | public string LocalDataDir => localDataDir;
26 | }
27 |
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/MSBuildEditorFactory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System;
5 | using System.Runtime.InteropServices;
6 |
7 | using Microsoft.VisualStudio.ComponentModelHost;
8 | using Microsoft.VisualStudio.LanguageServices.Implementation;
9 |
10 | namespace MonoDevelop.MSBuild.Editor.VisualStudio
11 | {
12 | [ComVisible (true)]
13 | [Guid (PackageConsts.EditorFactoryGuid)]
14 | class MSBuildEditorFactory : AbstractEditorFactory
15 | {
16 | public MSBuildEditorFactory (IComponentModel componentModel) : base (componentModel) { }
17 |
18 | protected override string ContentTypeName => MSBuildContentType.Name;
19 |
20 | protected override string LanguageName => PackageConsts.LanguageServiceName;
21 | }
22 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/Options/MSBuildTelemetryOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using Community.VisualStudio.Toolkit;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.VisualStudio.Options;
7 |
8 | public class MSBuildTelemetryOptions : BaseOptionModel
9 | {
10 | public bool IsEnabled { get; set; } = true;
11 | }
12 |
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/Options/MSBuildTelemetryOptionsPage.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | using Microsoft.VisualStudio.Shell;
8 |
9 | namespace MonoDevelop.MSBuild.Editor.VisualStudio.Options;
10 |
11 | [ComVisible (true)]
12 | [Guid (PackageConsts.TelemetryOptionsPageGuid)]
13 | public class MSBuildTelemetryOptionsPage : UIElementDialogPage
14 | {
15 | protected override UIElement Child {
16 | get {
17 | MSBuildTelemetryOptionsUIElement page = new (this);
18 | page.Initialize ();
19 | return page;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/Options/OptionsResources.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
16 |
20 |
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 |
3 | // Setting ComVisible to false makes the types in this assembly not visible
4 | // to COM components. If you need to access a type in this assembly from
5 | // COM, set the ComVisible attribute to true on that type.
6 | [assembly: ComVisible (false)]
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/Properties/DesignTimeResources.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
16 | Segoe UI
17 | 9
18 |
19 |
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/RoslynFindReferences/Entries/Entry.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using System.Windows;
4 |
5 | namespace MonoDevelop.MSBuild.Editor.VisualStudio.FindReferences
6 | {
7 | internal partial class StreamingFindUsagesPresenter
8 | {
9 | ///
10 | /// Represents a single entry (i.e. row) in the ungrouped FAR table.
11 | ///
12 | private abstract class Entry
13 | {
14 | protected Entry ()
15 | {
16 | }
17 |
18 | public bool TryGetValue (string keyName, out object content)
19 | {
20 | content = GetValueWorker (keyName);
21 | return content != null;
22 | }
23 |
24 | protected abstract object GetValueWorker (string keyName);
25 |
26 | public virtual bool TryCreateColumnContent (string columnName, out FrameworkElement content)
27 | {
28 | content = null;
29 | return false;
30 | }
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/RoslynFindReferences/Entries/SimpleMessageEntry.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using System.Threading.Tasks;
4 | using Microsoft.VisualStudio.Shell.TableManager;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.VisualStudio.FindReferences
7 | {
8 | internal partial class StreamingFindUsagesPresenter
9 | {
10 | private class SimpleMessageEntry : Entry
11 | {
12 | private readonly string _message;
13 |
14 | private SimpleMessageEntry (
15 | string message)
16 | : base ()
17 | {
18 | _message = message;
19 | }
20 |
21 | public static Task CreateAsync (
22 | string message)
23 | {
24 | var referenceEntry = new SimpleMessageEntry (message);
25 | return Task.FromResult (referenceEntry);
26 | }
27 |
28 | protected override object GetValueWorker (string keyName)
29 | {
30 | switch (keyName) {
31 | case StandardTableKeyNames.Text:
32 | return _message;
33 | }
34 |
35 | return null;
36 | }
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/RoslynFindReferences/IFindAllReferencesWindowExtensions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using System.Linq;
4 | using Microsoft.VisualStudio.Shell.FindAllReferences;
5 | using Microsoft.VisualStudio.Shell.TableControl;
6 |
7 | namespace MonoDevelop.MSBuild.Editor.VisualStudio.FindReferences
8 | {
9 | internal static class IFindAllReferencesWindowExtensions
10 | {
11 | public static ColumnState2 GetDefinitionColumn (this IFindAllReferencesWindow window)
12 | {
13 | return window.TableControl.ColumnStates.FirstOrDefault (
14 | s => s.Name == StandardTableColumnDefinitions2.Definition) as ColumnState2;
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/RoslynFindReferences/ISupportNavigation.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | namespace MonoDevelop.MSBuild.Editor.VisualStudio.FindReferences
4 | {
5 | internal interface ISupportsNavigation
6 | {
7 | bool TryNavigateTo (bool isPreview);
8 | }
9 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/RoslynFindReferences/NameMetadata.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using System.Collections.Generic;
4 |
5 | namespace MonoDevelop.MSBuild.Editor.VisualStudio.FindReferences
6 | {
7 | internal class NameMetadata
8 | {
9 | public string Name { get; }
10 |
11 | public NameMetadata (IDictionary data)
12 | {
13 | if (!data.TryGetValue (nameof (Name), out var val)) {
14 | Name = null;
15 | }
16 | Name = (string)val;
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/RoslynFindReferences/Placeholders.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.Immutable;
4 | using System.Windows.Controls;
5 | using System.Windows.Documents;
6 | using Microsoft.VisualStudio.Text.Classification;
7 | using MonoDevelop.MSBuild.Editor.Host;
8 |
9 | namespace MonoDevelop.MSBuild.Editor.VisualStudio.FindReferences
10 | {
11 | static class MSBuildOptions
12 | {
13 | public static int DefinitionGroupingPriority { get; set; }
14 | }
15 |
16 | static class FindReferencesExtensions
17 | {
18 | public static HashSet ToSet (this IEnumerable items) => new HashSet (items);
19 | }
20 | }
--------------------------------------------------------------------------------
/MonoDevelop.MSBuild.Editor.VisualStudio/RoslynFindReferences/ReferenceEqualityComparer.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2 |
3 | using System.Collections.Generic;
4 | using System.Runtime.CompilerServices;
5 |
6 | namespace MonoDevelop.MSBuild.Editor.VisualStudio.FindReferences
7 | {
8 | ///
9 | /// Compares objects based upon their reference identity.
10 | ///
11 | internal class ReferenceEqualityComparer : IEqualityComparer