-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
279 additions
and
98 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...tSystem.Managed.VS/ProjectSystem/VS/LanguageServices/ActiveIntellisenseProjectProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.ComponentModel.Composition; | ||
using Microsoft.VisualStudio.TextManager.Interop; | ||
|
||
namespace Microsoft.VisualStudio.ProjectSystem.VS.LanguageServices | ||
{ | ||
[Export(typeof(IActiveIntellisenseProjectProvider))] | ||
[ExportProjectNodeComService(typeof(IVsContainedLanguageProjectNameProvider))] | ||
internal class ActiveIntellisenseProjectProvider : IActiveIntellisenseProjectProvider, IVsContainedLanguageProjectNameProvider | ||
{ | ||
[ImportingConstructor] | ||
public ActiveIntellisenseProjectProvider(UnconfiguredProject project) | ||
{ | ||
} | ||
|
||
public string ActiveIntellisenseProjectContext | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
public int GetProjectName(uint itemid, out string pbstrProjectName) | ||
{ | ||
pbstrProjectName = ActiveIntellisenseProjectContext; | ||
return HResult.OK; | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/Microsoft.VisualStudio.ProjectSystem.Managed/GlobalSuppressions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
| ||
// This file is used by Code Analysis to maintain SuppressMessage | ||
// attributes that are applied to this project. | ||
// Project-level suppressions either have no target or are given | ||
// a specific target and scoped to a namespace, type, member, etc. | ||
|
||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "<Pending>", Scope = "member", Target = "~F:Microsoft.VisualStudio.ProjectSystem.LanguageServices.WorkspaceContextHost.WorkspaceContextHostInstance._subscriptions")] | ||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "<Pending>", Scope = "member", Target = "~F:Microsoft.VisualStudio.ProjectSystem.LanguageServices.WorkspaceContextHost.WorkspaceContextHostInstance._applyChangesToWorkspaceContext")] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...LanguageServices/Rewrite/WorkspaceContextHost.WorkspaceContextHostInstance.ProjectData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.IO; | ||
using Microsoft.VisualStudio.ProjectSystem.Properties; | ||
|
||
namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices | ||
{ | ||
internal partial class WorkspaceContextHost | ||
{ | ||
private partial class WorkspaceContextHostInstance | ||
{ | ||
private struct ProjectData | ||
{ | ||
public string LanguageName; | ||
public string BinOutputPath; | ||
public string ProjectFilePath; | ||
public string DisplayName; | ||
|
||
public static ProjectData FromSnapshot(ConfiguredProject project, IProjectRuleSnapshot snapshot) | ||
{ | ||
var data = new ProjectData(); | ||
|
||
snapshot.Properties.TryGetValue(ConfigurationGeneral.LanguageServiceNameProperty, out data.LanguageName); | ||
snapshot.Properties.TryGetValue(ConfigurationGeneral.TargetPathProperty, out data.BinOutputPath); | ||
snapshot.Properties.TryGetValue(ConfigurationGeneral.MSBuildProjectFullPathProperty, out data.ProjectFilePath); | ||
|
||
data.DisplayName = GetDisplayName(data.ProjectFilePath, project.ProjectConfiguration); | ||
|
||
return data; | ||
} | ||
|
||
private static string GetDisplayName(string filePath, ProjectConfiguration projectConfiguration) | ||
{ | ||
string displayName = Path.GetFileNameWithoutExtension(filePath); | ||
|
||
// TODO: Multi-targeting | ||
return $"{displayName} ({projectConfiguration.Name})"; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...em/LanguageServices/Rewrite/WorkspaceProjectContextCreator.NullWorkspaceProjectContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.CodeAnalysis; | ||
using Microsoft.VisualStudio.LanguageServices.ProjectSystem; | ||
|
||
namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices | ||
{ | ||
internal partial class WorkspaceProjectContextCreator | ||
{ | ||
private class NullWorkspaceProjectContext : IWorkspaceProjectContext | ||
{ | ||
public static readonly IWorkspaceProjectContext Instance = new NullWorkspaceProjectContext(); | ||
|
||
public string DisplayName { get; set; } | ||
public string ProjectFilePath { get; set; } | ||
public Guid Guid { get; set; } | ||
public bool LastDesignTimeBuildSucceeded { get; set; } | ||
public string BinOutputPath { get; set; } | ||
|
||
public void AddAdditionalFile(string filePath, bool isInCurrentContext = true) | ||
{ | ||
} | ||
|
||
public void AddAnalyzerReference(string referencePath) | ||
{ | ||
} | ||
|
||
public void AddMetadataReference(string referencePath, MetadataReferenceProperties properties) | ||
{ | ||
} | ||
|
||
public void AddProjectReference(IWorkspaceProjectContext project, MetadataReferenceProperties properties) | ||
{ | ||
} | ||
|
||
public void AddSourceFile(string filePath, bool isInCurrentContext = true, IEnumerable<string> folderNames = null, SourceCodeKind sourceCodeKind = SourceCodeKind.Regular) | ||
{ | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
} | ||
|
||
public void RemoveAdditionalFile(string filePath) | ||
{ | ||
} | ||
|
||
public void RemoveAnalyzerReference(string referencePath) | ||
{ | ||
} | ||
|
||
public void RemoveMetadataReference(string referencePath) | ||
{ | ||
} | ||
|
||
public void RemoveProjectReference(IWorkspaceProjectContext project) | ||
{ | ||
} | ||
|
||
public void RemoveSourceFile(string filePath) | ||
{ | ||
} | ||
|
||
public void SetOptions(string commandLineForOptions) | ||
{ | ||
} | ||
|
||
public void SetRuleSetFile(string filePath) | ||
{ | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.