Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ImplementInterface (previously GenerateInterfaceStub) #929

Merged
merged 4 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions src/FsAutoComplete.Core/Commands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ open Fantomas.Client.LSPFantomasService
open FsAutoComplete.Logging
open FsAutoComplete.UnionPatternMatchCaseGenerator
open FsAutoComplete.RecordStubGenerator
open FsAutoComplete.InterfaceStubGenerator
open System.Threading
open Utils
open FSharp.Compiler.CodeAnalysis
Expand Down Expand Up @@ -1331,23 +1330,6 @@ type Commands
|> x.AsCancellable tyRes.FileName
|> AsyncResult.recoverCancellation

member x.GetInterfaceStub (tyRes: ParseAndCheckResults) (pos: Position) (lines: NamedText) (lineStr: LineStr) =
async {
let doc = docForText lines tyRes
let! res = tryFindInterfaceExprInBufferAtPos codeGenServer pos doc

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

match stubInfo with
| Some (insertPosition, generatedCode) -> return CoreResponse.Res(generatedCode, insertPosition)
| None -> return CoreResponse.InfoRes "Interface at position not found"
}
|> x.AsCancellable tyRes.FileName
|> AsyncResult.recoverCancellation

member x.GetAbstractClassStub
(tyRes: ParseAndCheckResults)
(objExprRange: Range)
Expand Down
1 change: 0 additions & 1 deletion src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<Compile Include="CodeGeneration.fs" />
<Compile Include="UnionPatternMatchCaseGenerator.fs" />
<Compile Include="RecordStubGenerator.fs" />
<Compile Include="InterfaceStubGenerator.fs" />
<Compile Include="AbstractClassStubGenerator.fs" />
<Compile Include="SymbolCache.fs" />
<Compile Include="BackgroundServices.fs" />
Expand Down
212 changes: 0 additions & 212 deletions src/FsAutoComplete.Core/InterfaceStubGenerator.fs

This file was deleted.

4 changes: 4 additions & 0 deletions src/FsAutoComplete.Core/Utils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -761,3 +761,7 @@ type Debounce<'a>(timeout, fn) =

/// Calls the function, after debouncing has been applied.
member __.Bounce(arg) = mailbox.Post(arg)

module Indentation =
let inline get (line: string) =
line.Length - line.AsSpan().Trim(' ').Length
43 changes: 0 additions & 43 deletions src/FsAutoComplete/CodeFixes/GenerateInterfaceStub.fs

This file was deleted.

Loading