dotnet / dotnet/fsharp

Operators starting with '>' don't get IDE features

Open
#3,462 26 comments 0 reactions 1 assignee Claimed by @abelbraaksma View on GitHub
AI-thinks-windows-only Area-LangService-Colorization Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

## Current status

It seems that symbols for operators are sometimes picked up for document highlight and inline rename, but it's inconsistent. Given the following code in a .NET Core project:

```fsharp
module Operators =
let (>>=) a f = Result.bind f a
let (<*>) x f = f x
let () = Result.map
let (<+>) x f = f x
let () x f = f x

open Operators

[]
let main argv =
(float (Ok 12)) |> ignore

printfn "Hello World from F#!"
0 // return an integer exit code
```

There three notable issues. Some of these are driven by the same root cause as #3873.

1. Symbols for operators _except_ for `>>=` are picked up. For `>>=`, there is nothing - no QuickInfo, no document highlight, etc.
1. When you try to rename `` at the call site, it will escape the symbol with double backticks.

Note that colorization of `>>=` and any operator that starts with `>` is similarly affected, as per https://github.com/dotnet/fsharp/issues/10272

## Update 2

Modules are now found at the open site by Inline Rename and Find all References due to #3803, thanks @vasily-kirichenko

## Update 1

Using 15.4.1, and given the following code:

```fsharp
module Foo =
let (>.>) x f = f x

open Foo

[]
let main argv =
12. >.> sqrt |> ignore
0 // return an integer exit code
```

Click on `Foo` at the declaration site:

**Epected** --> The `Foo` at `open Foo` is highlighted
**Actual** --> It's not.

Notice that Find Refs and Inline Rename also fail to pick up the symbol.

Click on `>.>` anywhere it's used.

**Expected** --> Highlights the operator everywhere it exists
**Actual** --> No highlight

Find Refs and Inline Rename also do not pick up this symbol.

## Old Issue

VS 2017 15.3 + 8/16/2017 nightly build.

Run Find all References or Rename on `ThisIsAProperty`.

```fsharp
// Learn more about F# at http://fsharp.org
// See the 'F# Tutorial' project for more help.

open TestCS

type C() =
member val ThisIsAProperty = 12 with get, set

[]
let main argv =
let c = C()
c.ThisIsAProperty <- 0
0 // return an integer exit code
```

![no-refs-proprety](https://user-images.githubusercontent.com/6309070/29444782-33fae402-8397-11e7-9cb7-9961d586af5b.PNG)

![rename-no-worky](https://user-images.githubusercontent.com/6309070/29444819-84f47440-8397-11e7-8a2c-7da9a46bce44.PNG)

I don't think that this the same as #3033, because rename and FAR work for the class definition itself.

The above also fails on modules and customer operators.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.