Skip to content

Update debug config for node projects due to breaking changes #478

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

Merged
merged 5 commits into from
Jul 23, 2018

Conversation

ejizba
Copy link
Contributor

@ejizba ejizba commented Jul 23, 2018

Fixes #475

See the docs page that I added for more information. New projects should work going forward. Old projects will see this dialog:
screen shot 2018-07-23 at 2 47 40 pm

And the following if they decide to update:
screen shot 2018-07-23 at 3 02 47 pm

I implemented Option 1 from my docs page. It's technically just a workaround, but it's better because it only changes 1 file that is tracked by git. I thought about implementing both option 1 and option 2, but ultimately decided that wasn't worth it since option 2 is still not finalized (according to Azure/azure-functions-host#3120).

@ejizba ejizba requested a review from a team July 23, 2018 22:06
@@ -0,0 +1,22 @@
# Breaking changes to JavaScript Debug Configuration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this mention JavaScript?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think so. C# wasn't affected. Python isn't supported by this extension yet. And these instructions don't work for Java (The partner team is handling Java support and I think they fixed everything directly in Maven. In any case, we can always change this after the fact to include Java since the aka.ms link will point directly to master)


The first option is to add the following to your `runFunctionsHost` task in `.vscode\tasks.json`:

```json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's really helpful to see the entire task (even if just an example).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

identifier: funcHostTaskId,
type: 'shell',
command: 'func host start',
options: options,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this can return

options: undefined

is that okay?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. 'undefined' values are excluded when stringifying JSON, which is what we want in this case

* JavaScript debugging in the func cli had breaking changes in v2.0.1-beta.30. This verifies users are up-to-date with the latest working debug config.
* See https://aka.ms/AA1vrxa for more info
*/
async function verifyDebugConfigIsValid(folderPath: string, actionContext: IActionContext): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to guard against this function throwing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point

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

Successfully merging this pull request may close these issues.

2 participants