ionide-vscode-fsharp
ionide-vscode-fsharp copied to clipboard
Go to definition not working if there is a new line after a (
Describe the bug**
If there is a new line after a (
we can't "Go to definition".
Steps to reproduce
- 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(
"", "", "")
- Try to "Go to definition" by doing
Ctrl + Click
onReplace
of the linelet y
- See nothing happen
Link to sample reproduction
Expected behaviour
We should be able to go to definition.
Screenshots
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
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! 😂
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.
This is still active in 5.10.1.
I have the same issue with third-party libs. He find the signature but not the definition.
@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.
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.