未验证 提交 9297efff 编写于 作者: K Kevin Ransom (msft) 提交者: GitHub

We don't ever set fsi_server_intellisense (#10654)

上级 7cd8292f
......@@ -33,10 +33,6 @@ open System.Runtime.Remoting.Lifetime
type internal FSharpInteractiveServer() =
inherit System.MarshalByRefObject()
abstract Interrupt : unit -> unit
#if FSI_SERVER_INTELLISENSE
abstract Completions : prefix:string -> string array
abstract GetDeclarations : text:string * names:string array -> (string * string * string * int) array
#endif
default x.Interrupt() = ()
[<CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")>]
......
......@@ -27,10 +27,6 @@ open System.Runtime.Remoting.Lifetime
type internal FSharpInteractiveServer() =
inherit System.MarshalByRefObject()
abstract Interrupt : unit -> unit
#if FSI_SERVER_INTELLISENSE
abstract Completions : prefix:string -> string array
abstract GetDeclarations : text:string * names:string array -> (string * string * string * int) array
#endif
default x.Interrupt() = ()
[<CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")>]
......
......@@ -37,9 +37,6 @@ module internal AssemblyAttributes =
do()
module internal Guids =
#if FSI_SERVER_INTELLISENSE
let enable_fsi_intellisense = true
#endif
// FSI Session command set
let guidInteractiveCommands = Microsoft.VisualStudio.VSConstants.VsStd11
......
......@@ -119,26 +119,7 @@ type internal FsiAuthoringScope(sessions:FsiSessions option,readOnlySpanGetter:u
null
override this.GetDeclarations(_snapshot,line:int,col:int,info:TokenInfo,reason:ParseReason) =
match sessions with
| None -> (new FsiDeclarations() :> Declarations)
| Some sessions ->
#if FSI_SERVER_INTELLISENSE
if Guids.enable_fsi_intellisense then
let lines = view.GetBuffer() |> throwOnFailure1
//NOTE:
// There is an issue of how much preceeding text to grab for the intellisense.
// Ideally, we want all text from the end of the last executed interaction.
// However, we do not have an interactive "scanner" yet.
//------
// The decision is use the current "input area" as the source context.
// Multiline input is available to a limited degree (and could be improved).
let span = readOnlySpanGetter()
let str = lines.GetLineText(span.iEndLine,span.iEndIndex,line,col) |> throwOnFailure1
let declInfos = sessions.GetDeclarationInfos (str:string)
new FsiDeclarations(declInfos) :> Declarations
else
#endif
(new FsiDeclarations() :> Declarations)
(new FsiDeclarations() :> Declarations)
override this.GetMethods(line:int,col:int,name:string) =
new FsiMethods() :> Methods
......
......@@ -300,19 +300,6 @@ type FsiSession() =
/// interrupt timeout in miliseconds
let interruptTimeoutMS = 1000
#if FSI_SERVER_INTELLISENSE
// timeout in miliseconds.
// This timeout is to catch any issue with remoting becoming unresponsive.
// On it's duration, it is better from user POV to wait a few seconds and see,
// than to abort an intelisense request that would return,
// since an abort request has no useful information at all.
// 2 seconds seems to slow. (which was surprising, maybe
// the tcEnv were still being computed).
let completionsTimeoutMS = 3000
#endif
let checkLeaseStatus myService =
if false then
let myLease = RemotingServices.GetLifetimeService(myService) :?> ILease
......@@ -357,20 +344,6 @@ type FsiSession() =
with e ->
fsiOutput.Trigger (VFSIstrings.SR.killingProcessRaisedException (e.ToString()))
#if FSI_SERVER_INTELLISENSE
member x.Completions(s:string) =
checkLeaseStatus client
match timeoutApp "VFSI completions" completionsTimeoutMS (fun () -> client.Completions(s)) () with
| Some names -> names
| None -> [| |]
member x.GetDeclarations(s: string, plid: string[]) =
checkLeaseStatus client
match timeoutApp "VFSI intelisense" completionsTimeoutMS (fun () -> client.GetDeclarations(s,plid)) () with
| Some results -> results
| None -> [| |]
#endif
//-------------------------------------------------------------------------
// sessions
//-------------------------------------------------------------------------
......@@ -432,26 +405,3 @@ type FsiSessions() =
member x.Kill() = kill()
member x.Restart() = restart()
member x.Exited = fsiExited.Publish
#if FSI_SERVER_INTELLISENSE
member x.Completions(s) =
match sessionR with
| None -> [| |]
| Some session -> session.Completions(s)
member x.GetDeclarations(s,plid) =
match sessionR with
| None -> [| |]
| Some session -> session.GetDeclarations(s,plid)
member x.GetDeclarationInfos (str:string) =
// RPC to the session to get the completions based on the latest state.
let plid = Microsoft.VisualStudio.FSharp.Interactive.QuickParse.GetPartialLongName(str,str.Length-1) // Subtract one to convert to zero-relative
let project = function (name,None) -> [name] | (name,Some residue) -> [name;residue]
let plid = plid |> List.collect project |> List.toArray
// diagnostics.Log(sprintf "RPC GetDeclarations with str =[[%s]]" str)
// diagnostics.Log(sprintf "RPC GetDeclarations with plid=[[%s]]" (String.concat "." plid))
let declInfos = x.GetDeclarations(str,plid)
declInfos
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册