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

ability to switch between build configurations #85

Open
joprice opened this issue Jun 18, 2024 · 4 comments
Open

ability to switch between build configurations #85

joprice opened this issue Jun 18, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request upstream

Comments

@joprice
Copy link

joprice commented Jun 18, 2024

I'd like to be able to switch between Debug and Release mode, to, for instance, see errors in branches guarded by #if DEBUG guards.

Describe alternatives you've considered

I tried setting the configuration in the fsproj file, hoping that the change would be detected and read by fsautocomplete, but it had no effect. I'm not that familiar with the build format, so I may have not configured it correctly, or perhaps fsautocomplete isn't parsing that config.

@joprice joprice added the enhancement New feature or request label Jun 18, 2024
@joprice joprice changed the title ability to switch between build configuration ability to switch between build configurations Jun 18, 2024
@baronfel
Copy link

This is a long-standing bug in FSAC itself, actually - we only ever handle Debug configurations currently. I tried looking for an issue for this, but we don't have one right now. This is kind of a fundamental undertaking, and it would require a few different components the learn how to handle the different configurations:

  • https://github.com/ionide/proj-info would need to learn to return a useful view of the configurations of a project from the workspace/MSBuild side of things
  • https://github.com/ionide/FsAutoComplete would need to learn to work with that new view and correctly choose the correct view of the current file when doing operations like completions, error reporting, etc
  • Ionide for VSCode, ionide-vim, and all the other FSAC-based editors would need to surface some kind of UI/configuration/etc to let users pick the Configuration to use for each project

so it's a bit of a project, but one worth doing. I'll try and write something up on proj-info to capture some of the use cases we'd need to support.

@TheAngryByrd
Copy link
Member

I have this older PR that can be spruced up ionide/FsAutoComplete#1065 that is a start

@joprice
Copy link
Author

joprice commented Jun 20, 2024

I'd be willing to chip him however I can!

On the current state of things, checking that pr, I see ProjectLoader.globalProperties being made dynamic. As I'm pretty new to fsharp and dotnet, is there any way I can at least set the Configuration statically by modifying the fsproj file, or providing some other config file or env var in the project's workspace? That would at least enable the workflow of iterating against the release configuration without requiring the full tooling integration.

@joprice
Copy link
Author

joprice commented Jun 22, 2024

Ah looks like that's just a local list. I thought it was being parsed from the env somehow: https://github.com/ionide/FsAutoComplete/blob/8d6120c78bbb64ea7bf764af109b21b855ac4d0a/src/FsAutoComplete.Core/Consts.fs#L7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request upstream
Projects
None yet
Development

No branches or pull requests

4 participants