Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Issue with fsproj-file location #79

Open
viktorvan opened this issue Jun 2, 2017 · 4 comments
Open

Issue with fsproj-file location #79

viktorvan opened this issue Jun 2, 2017 · 4 comments

Comments

@viktorvan
Copy link

tl dr;
Could it be a reasonable default to look for fsproj-files in the current folder and any parent folders recursively?

According to the plugin documentation, opening an .fs-file will load any fsproj-file in that directory.

And some experimentation will show this to be true :)
With the following project structure:

  • Project.fsproj
  • Library.fs
  • Folder/File1.fs
  • Folder/File2.fs

Given that Library.fs opens modules from File1 and File2 and
given that File2 opens a module from File1.

  1. I can open a vim-session for Library.fs an it will resolve any modules correctly because if will have loaded Project.fsproj.

  2. If I start a new vim-session and start with opening File2 it will not be able to resolve the module in File1 because Project.fsproj will not be loaded since it is located in a parent folder.

  3. However if I start a new vim-session and open Library.fs (which will load Project.fsproj) and then open File2 it will resolve the modules in File1 since the project file already is loaded.

Could we solve 2. by letting the plugin search for fsproj-files in parent directories?

@kjnilsson
Copy link
Contributor

kjnilsson commented Jun 2, 2017 via email

@kjnilsson
Copy link
Contributor

actually the limit should be configurable with a default that retains the current behaviour (only scanning the same dir as the file).

@viktorvan
Copy link
Author

Sure, that would work great.

Just for information I ran into the issue when I was using the dotnet cli template for fable-elmish-react. That template is using a project structure with the .fsproj-file in the root-directory and all .fs-files in a src-subfolder. So when opening any .fs-file in the src-folder it never would be able to load the .fsproj-file.

@enricosada
Copy link

@kjnilsson the search of fsproj is now supported fsac side (ref ionide/FsAutoComplete#191 ) and support also sln files.

So should help implement this feature (just run workspacepeek at startup).
Vim need to iterate projects and call project. This will be improved by ionide/FsAutoComplete#192 later, doing whole init fsac side

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants