提交 6c47d215 编写于 作者: D Don Syme

Integrate FCS API: Other changes to vsintegration\src\Salsa

上级 9342e0f9
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
......@@ -18,15 +18,15 @@
<DefineConstants>FX_ATLEAST_45;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(FSharpSourcesRoot)\utils\CompilerLocationUtils.fs" />
<Compile Include="$(FSharpSourcesRoot)\utils\CompilerLocationUtils.fs">
<Link>CompilerLocationUtils.fs</Link>
</Compile>
<Compile Include="..\unittests\TestLib.Utils.fs">
<Link>UnitTests.TestLib.Utils.fs</Link>
</Compile>
<Compile Include="InternalsVisibleTo.fs" />
<Compile Include="VsMocks.fs" />
<Compile Include="Salsa.fsi" />
<Compile Include="Salsa.fs" />
<Compile Include="SalsaUtils.fsi" />
<Compile Include="SalsaUtils.fs" />
</ItemGroup>
<ItemGroup>
......@@ -35,7 +35,6 @@
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Xml" />
<Reference Include="System.Windows.Forms" />
<Reference Include="Microsoft.VisualStudio.Shell.$(VisualStudioVersion)" />
<Reference Include="Microsoft.Build.Framework, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.Build.Engine, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
......@@ -61,8 +60,8 @@
<Reference Include="Microsoft.VisualStudio.Text.Data, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=$(VisualStudioVersion).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="nunit.framework">
<Private>True</Private>
<HintPath>$(NUnitLibDir)\nunit.framework.dll</HintPath>
<Private>True</Private>
<HintPath>$(NUnitLibDir)\nunit.framework.dll</HintPath>
</Reference>
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project>
......@@ -100,4 +99,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(FSharpSourcesRoot)\FSharpSource.targets" />
</Project>
</Project>
\ No newline at end of file
......@@ -100,12 +100,10 @@ module internal VsOpsUtils =
(opsOfFile file).GetQuickInfoAndSpanAtCursor(file)
let GetNameOfOpenFile(file) =
(opsOfFile file).GetNameOfOpenFile(file)
let GetCheckOptionsOfScript(file) =
(opsOfFile file).GetCheckOptionsOfScript(file)
let GetProjectOptionsOfScript(file) =
(opsOfFile file).GetProjectOptionsOfScript(file)
let GetParameterInfoAtCursor(file) =
(opsOfFile file).GetParameterInfoAtCursor(file)
let GetParameterInfoAtCursorNoFallback(file) =
(opsOfFile file).GetParameterInfoAtCursorNoFallback(file)
let GetTokenTypeAtCursor(file) =
(opsOfFile file).GetTokenTypeAtCursor(file)
let GetSquiggleAtCursor(file) =
......@@ -121,9 +119,9 @@ module internal VsOpsUtils =
let CompletionBestMatchAtCursorFor(file, value, filterText) =
(opsOfFile file).CompletionBestMatchAtCursorFor(file, value, filterText)
let GotoDefinitionAtCursor file =
(opsOfFile file).GotoDefinitionAtCursor file false
(opsOfFile file).GotoDefinitionAtCursor (file, false)
let GotoDefinitionAtCursorForceGeneration file =
(opsOfFile file).GotoDefinitionAtCursor file true
(opsOfFile file).GotoDefinitionAtCursor (file, true)
let GetNavigationContentAtCursor(file) =
(opsOfFile file).GetNavigationContentAtCursor(file)
let GetHiddenRegionCommands(file) =
......@@ -133,7 +131,7 @@ module internal VsOpsUtils =
let GetF1KeywordAtCursor file =
(opsOfFile file).GetF1KeywordAtCursor file
let GetLineNumber file n =
(opsOfFile file).GetLineNumber file n
(opsOfFile file).GetLineNumber (file, n)
let GetAllLines file=
(opsOfFile file).GetAllLines file
let SwitchToFile (vs : VisualStudio) file =
......
......@@ -81,9 +81,8 @@ module internal VsOpsUtils =
val GetQuickInfoAtCursor : OpenFile -> string
val GetQuickInfoAndSpanAtCursor : OpenFile -> string*TextSpan
val GetNameOfOpenFile : OpenFile -> string
val GetCheckOptionsOfScript : OpenFile -> CheckOptions
val GetParameterInfoAtCursor : OpenFile -> MethodListForAMethodTip
val GetParameterInfoAtCursorNoFallback: OpenFile -> MethodListForAMethodTip
val GetProjectOptionsOfScript : OpenFile -> FSharpProjectOptions
val GetParameterInfoAtCursor : OpenFile -> MethodListForAMethodTip option
val GetTokenTypeAtCursor : OpenFile -> Salsa.Salsa.TokenType
val GetIdentifierAtCursor : OpenFile -> (string * int) option
val GetF1KeywordAtCursor : OpenFile -> string option
......
......@@ -1051,7 +1051,7 @@ module internal VsMocks =
member this.SetCursor( hNewCursor, phOldCursor) = err(__LINE__)
member this.GetCurrentSelection( ppHier, pitemid, ppMIS) = err(__LINE__)
}
let vsWindowFrame =
{ new IVsWindowFrame with
member this.Show() = err(__LINE__)
......
此差异已折叠。
// Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Salsa
open Microsoft.VisualStudio
open Microsoft.VisualStudio.Shell.Interop
open Microsoft.VisualStudio.FSharp.ProjectSystem
open Microsoft.VisualStudio.FSharp.LanguageService
open Microsoft.VisualStudio.TextManager.Interop
open Microsoft.Build.Framework
open Microsoft.VisualStudio.FSharp.LanguageService.Implementation
module internal Salsa =
[<Class>]
type HostCompile =
interface ITaskHost
member Compile : System.Converter<int,int> * string[] * string[] -> int
type TokenType = Text | Keyword | Comment | Identifier | String | Number | InactiveCode | PreprocessorKeyword | Operator
/// Declaration types.
type DeclarationType =
| Class = 0
| Constant = 6
| FunctionType = 12 // Like 'type FunctionType=unit->unit'
| Enum = 18
| EnumMember = 24
| Event = 30
| Exception = 36
| Interface = 48
| Method = 72
| FunctionValue = 74 // Like 'type Function x = 0'
| Module = 84
| Namespace = 90
| Property = 102
| ValueType = 108 // Like 'type ValueType=int*int'
| RareType = 120 // Bucket for unusual types like 'type AsmType = (# "!0[]" #)'
| Record = 126
| DiscriminatedUnion = 132
type BuildAction =
| Compile = 0
| EmbeddedResource = 1
| None = 2
type BuildResult = {
ExecutableOutput : string
BuildSucceeded : bool
}
/// An error
[<Sealed>]
type Error =
member Path : string
member Message : string
member Context : TextSpan
member Severity : Severity
override ToString : unit -> string
type ChangeCallBack = IVsHierarchy * string -> unit
/// Hooks for controlling behaviors
/// Thrown when a marker is not found when placing the cursor via VsOps
exception MarkerNotFoundException of string
/// Representation of an item from the completion list
type CompletionItem = string * string * (unit -> string) * DeclarationType
type GotoDefnResult = Microsoft.VisualStudio.FSharp.LanguageService.GotoDefinitionResult
[<AutoOpen>]
module GotoDefnResultExtensions =
type Microsoft.VisualStudio.FSharp.LanguageService.GotoDefinitionResult with
member ToOption : unit -> (TextSpan * string) option
/// Representes the information that is displayed in the navigation bar
type NavigationBarResult =
{ TypesAndModules : DropDownMember[]
Members : DropDownMember[]
SelectedType : int
SelectedMember : int }
/// Methods for simulating VisualStudio
[<NoEquality; NoComparison>]
type ProjectBehaviorHooks = {
CreateProjectHook: (*projectFilename:*)string ->
(*files:*)(string*BuildAction*string option) list ->
(*references:*)(string*bool) list ->
(*projReferences:*)string list ->
(*disabledWarnings:*)string list ->
(*defines*)string list ->
(*versionFile:*)string ->
(*otherFlags:*)string ->
(*preImportXml:*)string ->
(*targetFrameworkVersion:*)string -> unit
InitializeProjectHook : OpenProject -> unit
MakeHierarchyHook : string->string->string->ChangeCallBack->OleServiceProvider->IVsHierarchy
AddFileToHierarchyHook : string -> IVsHierarchy -> unit
BuildHook : (*basename:*)string -> (*target:*)string -> IVsOutputWindowPane -> BuildResult
GetMainOutputAssemblyHook : string -> string
SaveHook : unit -> unit
DestroyHook : unit->unit
ModifyConfigurationAndPlatformHook : string->unit
}
and [<NoEquality; NoComparison>] VsOps = {
CreateVisualStudio : unit -> VisualStudio
CreateSolution : VisualStudio -> OpenSolution
GetOutputWindowPaneLines : VisualStudio -> string list
CloseSolution : OpenSolution ->unit
CreateProject : OpenSolution * string -> OpenProject
CreateProjectWithHooks : OpenSolution * ProjectBehaviorHooks * string -> OpenProject
NewFile : VisualStudio * string * BuildAction * string list -> File
DeleteFileFromDisk : File -> unit
AddFileFromText : OpenProject * string * string * BuildAction * string list -> File
AddLinkedFileFromText : OpenProject*string*string*string*BuildAction*string list->File
AddAssemblyReference : OpenProject * string * bool -> unit
AddProjectReference : OpenProject * OpenProject -> unit
ProjectDirectory : OpenProject -> string
ProjectFile : OpenProject -> string
SetVersionFile : OpenProject * string -> unit
SetOtherFlags : OpenProject * string -> unit
SetConfigurationAndPlatform : OpenProject * string -> unit
AddDisabledWarning : OpenProject * string -> unit
GetErrors : OpenProject -> Error list
BuildProject : OpenProject * string -> BuildResult
GetMainOutputAssembly : OpenProject -> string
SaveProject : OpenProject -> unit
OpenFileViaOpenFile : VisualStudio * string -> OpenFile
OpenFile : OpenProject * string -> OpenFile
GetOpenFiles : OpenProject -> OpenFile list
SetProjectDefines : OpenProject * string list -> unit
PlaceIntoProjectFileBeforeImport : OpenProject * string -> unit
OpenExistingProject : VisualStudio * string * string -> OpenProject * OpenSolution
MoveCursorTo : OpenFile * int * int -> unit
GetCursorLocation : OpenFile -> int * int
GetLineNumber : OpenFile -> int -> string
GetAllLines : OpenFile -> string list
SwitchToFile : VisualStudio * OpenFile -> unit
OnIdle : VisualStudio -> unit
ShiftKeyDown : VisualStudio -> unit
ShiftKeyUp : VisualStudio -> unit
TakeCoffeeBreak : VisualStudio -> unit
ReplaceFileInMemory : OpenFile * string list * bool -> unit
SaveFileToDisk : OpenFile -> unit
CleanUp : VisualStudio -> unit
CleanInvisibleProject : VisualStudio -> unit
ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients : VisualStudio -> unit
GetSquiggleAtCursor : OpenFile -> (Microsoft.VisualStudio.FSharp.LanguageService.Severity * string) option
GetSquigglesAtCursor : OpenFile -> (Microsoft.VisualStudio.FSharp.LanguageService.Severity * string) list
/// does a BackgroundRequestReason.MemberSelect at the cursor
AutoCompleteAtCursor : OpenFile -> CompletionItem array
/// like AutoCompleteAtCursor, but can pass e.g. BackgroundRequestReason.CompleteWord to do Ctrl-space rather than auto-dot-popup-completion
CompleteAtCursorForReason : OpenFile * Microsoft.VisualStudio.FSharp.LanguageService.BackgroundRequestReason -> CompletionItem array
CompletionBestMatchAtCursorFor : OpenFile * string * string option -> (string * bool * bool) option
MoveCursorToEndOfMarker : OpenFile * string -> unit
MoveCursorToStartOfMarker : OpenFile * string -> unit
GetQuickInfoAtCursor : OpenFile -> string
GetQuickInfoAndSpanAtCursor : OpenFile -> string*TextSpan
GetMatchingBracesForPositionAtCursor : OpenFile -> (TextSpan * TextSpan) array
GetNameOfOpenFile : OpenFile -> string
GetCheckOptionsOfScript : OpenFile -> Microsoft.FSharp.Compiler.SourceCodeServices.CheckOptions
GetParameterInfoAtCursor : OpenFile -> MethodListForAMethodTip
GetParameterInfoAtCursorNoFallback: OpenFile -> MethodListForAMethodTip
GetTokenTypeAtCursor : OpenFile -> TokenType
GetIdentifierAtCursor : OpenFile -> (string * int) option
GetF1KeywordAtCursor : OpenFile -> string option
GotoDefinitionAtCursor : OpenFile -> bool -> GotoDefnResult
GetNavigationContentAtCursor : OpenFile -> NavigationBarResult
GetHiddenRegionCommands : OpenFile -> list<NewHiddenRegion> * Map<uint32, TextSpan>
CreatePhysicalProjectFileInMemory : ((*files:*)(string*BuildAction*string option) list) ->
((*references:*)(string*bool) list) ->
((*projectReferences:*)string list) ->
((*disabledWarnings:*)string list) ->
((*defines:*)string list) ->
(*versionFile*) string ->
((*otherFlags:*)string) ->
((*otherProjMisc:*)string) ->
((*targetFrameworkVersion:*)string) -> string
/// True if files outside of the project cone are added as links.
AutoCompleteMemberDataTipsThrowsScope : string -> System.IDisposable
// VsOps capabilities.
OutOfConeFilesAreAddedAsLinks : bool
SupportsOutputWindowPane : bool
}
// Opaque handles to vs objects
/// Simulate a VisualStudio instance
and VisualStudio = interface
abstract VsOps : VsOps
end
/// The solution opened in VS
and OpenSolution = interface
abstract VS : VisualStudio
end
/// A project opened in VS
and OpenProject = interface
abstract VS : VisualStudio
end
/// A file opened in VS
and OpenFile = interface
abstract VS : VisualStudio
end
/// A file on disk
and File = interface end
val CreateFSharpManifestResourceName : projectFileName:string -> configuration:string -> platform:string -> (string * string) list
/// The different variations of of Salsa tests
module Models =
/// Salsa tests which create .fsproj files for projects.
val MSBuild : unit -> VsOps * ProjectBehaviorHooks
/// Salsa tests which create .fsproj files for projects using the installed
/// FSharp.targets file.
val InstalledMSBuild : unit -> VsOps * ProjectBehaviorHooks
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册