ionide-vscode-fsharp icon indicating copy to clipboard operation
ionide-vscode-fsharp copied to clipboard

Go to definition not working if there is a new line after a (

Open MangelMaxime opened this issue 4 years ago • 7 comments

Describe the bug**

If there is a new line after a ( we can't "Go to definition".

Steps to reproduce

  1. Copy/paste the this code
module Repro =

    type Replacer () =
        static member Replace(value : string, a : string, b : string) = ""

    let x = Replacer.Replace("", "", "")

    let y = Replacer.Replace(
                "", "", "")
  1. Try to "Go to definition" by doing Ctrl + Click on Replace of the line let y
  2. See nothing happen

Link to sample reproduction

Expected behaviour

We should be able to go to definition.

Screenshots

ionide_go_to_def_bug

Machine info

  • OS: Linux
  • .NET SDK version: [e.g. 5.0.100] 5.0.101
  • Ionide version: [e.g 5.0.1, don't use descriptions like latest ] 5.2.0

MangelMaxime avatar Jan 19 '21 10:01 MangelMaxime

Hey @MangelMaxime :wave:,

Thanks for backing our project. If possible, We will handle your issue with priority support. To make sure we don't forget how special you are, we added a backer label to your issue.

Thanks again for backing us :tada:!

Cool! 😂

Krzysztof-Cieslak avatar Jan 20 '21 13:01 Krzysztof-Cieslak

Happening as well with the following code:


// Errors.fs

module Errors =
    exception AuthError of message: string * code: string

// Main.fs

let login =
    promise {

        let! optionUser = Models.UsersModel.getUser ("[email protected]", None)

        let user =
            match optionUser with
            | Some u -> 1
            | None ->
                let error =
                    Errors.AuthError( // This is not recognized
                        message = "Provided email not found",
                        code = "Error.NOT_FOUND_EMAIL"
                    )

                1
                // raise error

        return user
    }

It is really strange that the order of match options affects the syntax colors aswell, which makes me suspicious. Sadly I can't find what exactly does cause this behaviour, I've seen it happens with exceptions and classes inside modules in other files.

alarbada avatar Mar 14 '21 12:03 alarbada

This is still active in 5.10.1.

baronfel avatar Nov 20 '21 20:11 baronfel

I have the same issue with third-party libs. He find the signature but not the definition. image

yuri-potatoq avatar Oct 18 '23 13:10 yuri-potatoq

@yuri-potatoq I think your example might be slightly different - that's a type alias, and those are often wonky in tooling APIs and typically require some special handling.

baronfel avatar Oct 18 '23 13:10 baronfel

Thank you to quickly help me. I see the difference with previous one, but what about this another case? Basically, this happen with all implementations that i'm currently using in this sample project.

image

yuri-potatoq avatar Oct 18 '23 13:10 yuri-potatoq