Skip to content

Commit

Permalink
Fix interface stub integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof-Cieslak committed Jan 29, 2019
1 parent cdb628f commit dee80bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/FsAutoComplete.Core/Commands.fs
Expand Up @@ -48,6 +48,7 @@ type CoreResponse =
| Compile of errors: Microsoft.FSharp.Compiler.SourceCodeServices.FSharpErrorInfo[] * code: int
| Analyzer of messages: SDK.Message [] * file: string
| SymbolUseRange of ranges: SymbolCache.SymbolUseRange[]
| InterfaceStub of generatedCode: string * insertPosition: pos

[<RequireQualifiedAccess>]
type NotificationEvent =
Expand Down Expand Up @@ -776,14 +777,14 @@ type Commands (serialize : Serializer) =

let! res = tryFindInterfaceExprInBufferAtPos codeGenServer pos doc
match res with
| None -> return [Response.info serialize "Interface at position not found"]
| None -> return [CoreResponse.InfoRes "Interface at position not found"]
| Some interfaceData ->
let! stubInfo = handleImplementInterface codeGenServer pos doc lines lineStr interfaceData

match stubInfo with
| Some (insertPosition, generatedCode) ->
return [Response.interfaceStub serialize generatedCode insertPosition]
| None -> return [Response.info serialize "Interface at position not found"]
return [CoreResponse.InterfaceStub (generatedCode, insertPosition)]
| None -> return [CoreResponse.InfoRes "Interface at position not found"]
} |> x.AsCancellable (Path.GetFullPath tyRes.FileName)

member x.WorkspacePeek (dir: string) (deep: int) (excludedDirs: string list) = async {
Expand Down
4 changes: 2 additions & 2 deletions src/FsAutoComplete/AssemblyInfo.fs
Expand Up @@ -7,7 +7,7 @@ open System.Reflection
[<assembly: AssemblyDescriptionAttribute("A command line tool for interfacing with FSharp.Compiler.Service over a pipe.")>]
[<assembly: AssemblyVersionAttribute("0.34.0")>]
[<assembly: AssemblyFileVersionAttribute("0.34.0")>]
[<assembly: AssemblyMetadataAttribute("githash","439f786b27c2d5fc9f6f956f8097b5cd76e4224f")>]
[<assembly: AssemblyMetadataAttribute("githash","cdb628f6113ff9587716fadcbff83588a7342d38")>]
do ()

module internal AssemblyVersionInformation =
Expand All @@ -16,4 +16,4 @@ module internal AssemblyVersionInformation =
let [<Literal>] AssemblyDescription = "A command line tool for interfacing with FSharp.Compiler.Service over a pipe."
let [<Literal>] AssemblyVersion = "0.34.0"
let [<Literal>] AssemblyFileVersion = "0.34.0"
let [<Literal>] AssemblyMetadata_githash = "439f786b27c2d5fc9f6f956f8097b5cd76e4224f"
let [<Literal>] AssemblyMetadata_githash = "cdb628f6113ff9587716fadcbff83588a7342d38"
2 changes: 2 additions & 0 deletions src/FsAutoComplete/CommandResponse.fs
Expand Up @@ -791,3 +791,5 @@ module CommandResponse =
analyzer s (messages, file)
| CoreResponse.SymbolUseRange(ranges) ->
symbolUseRange s ranges
| CoreResponse.InterfaceStub(generatedCode, insertPosition) ->
interfaceStub s generatedCode insertPosition

0 comments on commit dee80bf

Please sign in to comment.