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

Easier API to get project options #16

Closed
alfonsogarciacaro opened this issue Feb 22, 2018 · 4 comments
Closed

Easier API to get project options #16

alfonsogarciacaro opened this issue Feb 22, 2018 · 4 comments
Assignees

Comments

@alfonsogarciacaro
Copy link

Fable is using Dotnet.ProjInfo and it's working really well, thank you! However, I'm concerned that I need to keep this file in my repo. It's mainly copied from Ionide (or FSAC, I don't remember) and it's also working fine. But the code is not trivial and has some slight modifications, so I'm afraid it can easily break and/or become outdated soon and it won't be easy to keep it up-to-date.

It'd be great if there was a simple function exposed by Dotnet.ProjInfo to which I could pass the .fsproj file path and get the Project options without the extra boilerplate.

@alfonsogarciacaro
Copy link
Author

alfonsogarciacaro commented Mar 5, 2018

@enricosada Any thoughts on this? I have to copy the ProjectCoreCracker.fs file around whenever I want to use Dotnet.ProjInfo :)

MangelMaxime/Thoth#17
https://github.com/alfonsogarciacaro/TypeProviderTest/tree/master/ASTViewer

@enricosada
Copy link
Collaborator

pratically that file does two things:

  • navigate the projects (so all p2p references) based on target framework
  • convert to use default ProjectCracker options (used by FCS)

i think i can add these as feature to this library:

  • put the first thing (navigate p2p) inside this library directly.
  • use a builtin type, who can be easy mapped to FCS type as needed
  • maybe i can provide a builtin SRTP mapper too, so already ready to use

i dont like to add a reference to FCS just for the projectcracker type (anyway is really dumb data).

I'll do that @alfonsogarciacaro so you dont need that file anymore (so less moving bugfixes around).
added to backlog

@enricosada enricosada self-assigned this Mar 5, 2018
@enricosada
Copy link
Collaborator

sry @alfonsogarciacaro didnt see before the issue

@alfonsogarciacaro
Copy link
Author

No worries, I just wanted to ping you because the notification might have gone unnoticed :)

It'd be really helpful if you could add the features to the library, thank you! But I agree you shouldn't add the FCS dependency just for the type. For me, it'd be enough to have an interface with the same properties and I can do the conversion in my code :)

@enricosada enricosada mentioned this issue Jan 26, 2019
10 tasks
enricosada added a commit that referenced this issue Feb 4, 2019
ref #16

Extract FSAC code for loading (fsproj and fsx) and package in a nice to use library (`Dotnet.ProjInfo.Workspace`), plus features and cleanup.

Features:

- notifications for loading/loaded/failed
- same fsc info (fsc args etc)
- traverse all projects (like f# -> c# -> f#)
- allow configure msbuild (msbuild.exe or dotnet msbuild)
- api for fsx
- cached projs by target framework
- removed the helper target file in `obj` dir
- easier way to test scenarios ( `test/Dotnet.ProjInfo.Workspace.Tests` )
- support old fsproj (verbose) and .NET sdk fsproj (slim) both using Out Of Process msbuild (no msbuild libs as deps)

Add `Dotnet.ProjInfo.Workspace.FCS` with helper functions to use with FSharp.Compiler.Service

part of the code is from ionide/FsAutoComplete@7ed9a0b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants