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

F# project support #315

Open
mikhailshilkov opened this issue Apr 9, 2018 · 10 comments
Open

F# project support #315

mikhailshilkov opened this issue Apr 9, 2018 · 10 comments
Labels
feature future Issues that were in the "future" milestone during our previous triage process P1

Comments

@mikhailshilkov
Copy link

Are there plans to support F# project / function creation?
I'm willing to help with this, if you give me some high-level guidance.

@whitetigle
Copy link

+1

@ejizba
Copy link
Member

ejizba commented Apr 9, 2018

We already have limited support for F#. In your user settings for VS Code, set "azureFunctions.projectLanguage" to "F#Script". The next time you create a project, you will not be prompted for a language and it will use F#Script instead.

With that project, you can create a new function:
screen shot 2018-04-09 at 3 25 02 pm
(NOTE: I'm using runtime v1.x on Windows. The functions runtime doesn't support F# for v2.x yet.)

And then if you do "Run Task" from the command palette, you can run the Functions host in VS Code's task system:
screen shot 2018-04-09 at 3 26 59 pm

The biggest piece missing is debugging, aka the "launch.json" file in the ".vscode" folder. I'm guessing it might be similar to the "launch.json" for C#, but I have no idea. Have you debugged other F# projects in VS Code that aren't related to Functions? How does that usually work? What VS Code extensions do you need?

@mikhailshilkov
Copy link
Author

Why doesn't it appear in the default language selection?

image

This makes it hard to discover, while the whole point is to help people get started.

And of course, we need support for precompiled F# and v2, since that's the future, and F# tooling actually works best with those.

Debugging F# works just fine. I am able to debug precompiled v2 F# Azure Functions created manually with dotnet new command. launch.json is probably exactly the same as C# one, since it's dotnet doing all the work. Ionide is the plugin to do all things F# in VS Code.

@ejizba
Copy link
Member

ejizba commented Apr 10, 2018

The simplest answer is because we don't think the experience I described above is good enough to display in the default language selection yet. We have the settings for more advanced users that want to explore, but we don't want people getting started on a bad/underdeveloped experience.

We're adding languages to that list on a case-by-case basis once they have full support (including debugging). I can't make any guarantees on timing for F#, but feedback like this definitely helps us prioritize which language to work on next (There's actually several languages not displayed including Bash, PowerShell, PHP, Python, TypeScript, etc.).

Based on your input and my experience with our C# support - I'm guessing we'll never add 'F#Script' to that list and instead only add 'F#' (Aka precompiled instead of script). We're using these templates for C#, but I don't think those exist for F# yet. When you used dotnet new, I assume you're not using a Function-specific template?

@mikhailshilkov
Copy link
Author

OK, clear. F# Script might still be useful for some folks, but I don't use it.

The other languages you mention are experimental, I hope F# stands above this list.

There is Azure/azure-functions-templates#627 where we try to add F# precompiled templates and Azure/azure-functions-templates#665 to add them to your nuget package.

@forki
Copy link

forki commented Apr 11, 2018

Definitely interested in better tooling support for f#. We have around 40 F# functions right now and we are planning to do WAY more

@TonyHenrique
Copy link

Yes, please give F# more attention.

@ejizba ejizba added this to the future milestone Apr 18, 2018
@ejizba ejizba modified the milestones: future, 0.10.0 May 2, 2018
@ejizba ejizba modified the milestones: 0.10.0, 0.11.0 Jun 20, 2018
@ejizba ejizba modified the milestones: 0.11.0, 0.12.0 Aug 27, 2018
@ejizba ejizba modified the milestones: 0.11.0, 0.12.0 Sep 12, 2018
@ejizba ejizba modified the milestones: 0.12.0, future Oct 3, 2018
@Angr1st
Copy link

Angr1st commented Apr 2, 2019

What is still to do here?

@ejizba
Copy link
Member

ejizba commented Apr 2, 2019

Only piece missing is creating a function and for that we need Azure/azure-functions-templates#627 to be fixed first.

Right now you can do the following:

  1. Create new project
    1. Set azureFunctions.projectLanguage in your VS Code User settings to F#. That language will be used the next time you create a project in VS Code. (Once the above is fixed, we will show "F#" in the normal "Create new project" dropdown for language)
    2. NOTE: You must be on at least v0.16.0 of our extension for this to work
  2. Create new function
    1. As mentioned, this is not supported yet. In the meantime, I have an example commit here to manually create a function based on this blogpost by @mikhailshilkov.
  3. Debug
  4. Deploy

@Angr1st
Copy link

Angr1st commented Apr 2, 2019

  1. Just tested it looks good. 👍
    2., 3. and 4. I have already done. Hopefully the missing necessary PR gets merged soon.

ejizba added a commit that referenced this issue Apr 22, 2019
One of the last pieces of #315. The [recently added](Azure/azure-functions-templates#627 (comment)) templates should show up when the template filter is set to "All".

Only remaining work is to add templates to "Verified" category, make sure tests are up-to-par with other languages, and finally show F# in the "New Project" quick pick. Will likely do that after build conference.
@ejizba ejizba added the future Issues that were in the "future" milestone during our previous triage process label Jan 29, 2021
@ejizba ejizba removed this from the out of scope milestone Jan 29, 2021
@ejizba ejizba added this to the Backlog Candidates milestone Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature future Issues that were in the "future" milestone during our previous triage process P1
Projects
None yet
Development

No branches or pull requests

6 participants