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

Intellisense error - Implemenation has already been given #6300

Closed
kspeakman opened this issue Mar 1, 2019 · 2 comments
Closed

Intellisense error - Implemenation has already been given #6300

kspeakman opened this issue Mar 1, 2019 · 2 comments

Comments

@kspeakman
Copy link

kspeakman commented Mar 1, 2019

I found a case that consistently generates a spurious Intellisense error: "An implementation of the file or module ... has already been given".

image

Repro steps

I created a repro project here.

The file structure looks like this.

A\Widget.fs
B\Widget.fs

Each widget is in a separate namespace.

  1. Open the linked repro solution and build it to observe no error.
  2. Open B\Widget.fs.
  3. Make any change to A\Widget.fs -- including just adding newlines -- and save the file.
  4. Switch back to B\Widget.fs and wait a few seconds for the intellisense error to appear.

Expected behavior

I expect that there should be no Intellisense red error on a project that compiles successfully.

Actual behavior

If you change any file above B\Widget in the compile order, it will generate the Intellisense error on the whole B\Widget file. This error takes a few seconds to show up on my machine, but it does so consistently. The project still compiles without error.

Known workarounds

The Intellisense error can be removed by reloading the project. But then the error shows back up after any change to files above it.

Meta info

Previously I handled the same situation by making separate projects instead of separate folders within a single project. However, this has historically led to "too many" projects in my solutions. This kind of folder structure is the result of trying to follow the guidance of "project per deployable". The deployable has subsystems which are placed in different folders and namespaces. This problem occurs when the same type name occurs in different subsystems.

Related information

  • Windows 10 Pro x64
  • Visual Studio 15.9.7
  • netcoreapp2.1
@baronfel
Copy link
Member

baronfel commented Mar 1, 2019

I can verify this behavior, I thought I was just going temporarily crazy. In our case, we have a folder full of Giraffe views:

* Views
|
|- Docs.fs
|- EULA.fs
...

And in general the files look like

namespace <PRODUCT>.Views.<AREA>

open Giraffe.GiraffeViewEngine

module <SUBDETAIL> =
  let page: ....

where AREA might be Assets and SUBDETAIL might be List for a page that lists Assets.

If we have duplicate module names (ie List) in different namespaces at a similar level in this structure we'll get a message like @kspeakman did: List__2 already existing.

@cartermp
Copy link
Contributor

cartermp commented Mar 2, 2019

Closing as duplicate of #2679

@dsyme for FYI

@cartermp cartermp closed this as completed Mar 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants