forked from dotnet/roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into useDeconstruction
- Loading branch information
Showing
14 changed files
with
149 additions
and
136 deletions.
There are no files selected for viewing
28 changes: 0 additions & 28 deletions
28
...lementation/IntelliSense/Completion/FileSystem/CurrentWorkingDirectoryDiscoveryService.cs
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
...ementation/IntelliSense/Completion/FileSystem/ICurrentWorkingDirectoryDiscoveryService.cs
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
src/Features/Core/Portable/Scripting/IScriptEnvironmentService.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.Collections.Immutable; | ||
using Microsoft.CodeAnalysis.Host; | ||
|
||
namespace Microsoft.CodeAnalysis.Scripting | ||
{ | ||
/// <summary> | ||
/// Provides information on the current script environment. | ||
/// </summary> | ||
internal interface IScriptEnvironmentService : IWorkspaceService | ||
{ | ||
/// <summary> | ||
/// Full path of a directory to be used to resolve relative paths specified in #r and #load directives | ||
/// that are used in script that itself doesn't have a path (e.g. interactive submission). | ||
/// </summary> | ||
string BaseDirectory { get; } | ||
|
||
/// <summary> | ||
/// Search paths used to find metadata references (#r directive). | ||
/// </summary> | ||
ImmutableArray<string> MetadataReferenceSearchPaths { get; } | ||
|
||
/// <summary> | ||
/// Search paths uses to find source references (#load directive). | ||
/// </summary> | ||
ImmutableArray<string> SourceReferenceSearchPaths { get; } | ||
} | ||
} |
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
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
41 changes: 41 additions & 0 deletions
41
...itorFeatures/Core/Extensibility/Interactive/InteractiveScriptEnvironmentServiceFactory.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,41 @@ | ||
// 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.Immutable; | ||
using System.Composition; | ||
using Microsoft.CodeAnalysis.Editor.Implementation.Interactive; | ||
using Microsoft.CodeAnalysis.Host; | ||
using Microsoft.CodeAnalysis.Host.Mef; | ||
using Microsoft.CodeAnalysis.Scripting; | ||
|
||
namespace Microsoft.CodeAnalysis.Editor.Interactive | ||
{ | ||
[ExportWorkspaceServiceFactory(typeof(IScriptEnvironmentService), WorkspaceKind.Interactive), Shared] | ||
internal sealed class InteractiveScriptEnvironmentServiceFactory : IWorkspaceServiceFactory | ||
{ | ||
private sealed class Service : IScriptEnvironmentService | ||
{ | ||
private readonly InteractiveWorkspace _workspace; | ||
|
||
public ImmutableArray<string> MetadataReferenceSearchPaths => _workspace.Evaluator.ReferenceSearchPaths; | ||
public ImmutableArray<string> SourceReferenceSearchPaths => _workspace.Evaluator.SourceSearchPaths; | ||
public string BaseDirectory => _workspace.Evaluator.WorkingDirectory; | ||
|
||
public Service(InteractiveWorkspace workspace) | ||
{ | ||
_workspace = workspace; | ||
} | ||
} | ||
|
||
public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices) | ||
{ | ||
if (workspaceServices.Workspace is InteractiveWorkspace interactiveWorkspace) | ||
{ | ||
return new Service(interactiveWorkspace); | ||
} | ||
|
||
// this service is not applicable to workspaces other than InteractiveWorkspace: | ||
return null; | ||
} | ||
} | ||
} |
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
24 changes: 24 additions & 0 deletions
24
...tudio/Core/Def/Implementation/ProjectSystem/MiscellaneousFilesScriptEnvironmentService.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,24 @@ | ||
// 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.Collections.Immutable; | ||
using System.Composition; | ||
using System.Runtime.InteropServices; | ||
using Microsoft.CodeAnalysis; | ||
using Microsoft.CodeAnalysis.Host.Mef; | ||
using Microsoft.CodeAnalysis.Scripting; | ||
|
||
namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem | ||
{ | ||
/// <summary> | ||
/// Environment corresponding to csi running a script with default command line arguments. | ||
/// </summary> | ||
[ExportWorkspaceService(typeof(IScriptEnvironmentService), WorkspaceKind.MiscellaneousFiles), Shared] | ||
internal sealed class MiscellaneousFilesScriptEnvironmentService : IScriptEnvironmentService | ||
{ | ||
private static readonly ImmutableArray<string> s_metadataReferenceSearchPaths = ImmutableArray.Create(RuntimeEnvironment.GetRuntimeDirectory()); | ||
|
||
public ImmutableArray<string> MetadataReferenceSearchPaths => s_metadataReferenceSearchPaths; | ||
public ImmutableArray<string> SourceReferenceSearchPaths => ImmutableArray<string>.Empty; | ||
public string BaseDirectory => null; | ||
} | ||
} |
Oops, something went wrong.