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

Fake target support -> 4 0 #1137

Merged
merged 14 commits into from Jun 22, 2019

Conversation

Projects
None yet
2 participants
@matthid
Copy link
Contributor

commented Jun 16, 2019

Replaces #1136
This depends on fsharp/FsAutoComplete#415 and ionide/ionide-vscode-helpers#29

image

(ignore the typo in the screenshot)

image

  • Show targets and their dependencies (if possible)
  • add support for debugging and running buttons
  • Code Navigation via Outline
@matthid

This comment has been minimized.

Copy link
Contributor Author

commented Jun 16, 2019

This requires ionide/ionide-vscode-helpers#29 (therefore the build is red)

(I'd recommend adding those vscode-helpers as git subtree instead of paket dependencies. I actually edited them and didn't realize they are not even under source control)

Show resolved Hide resolved src/Core/LanguageService.fs Outdated
Show resolved Hide resolved src/Core/LanguageService.fs Outdated
@matthid
Copy link
Contributor Author

left a comment

some cleanup

Show resolved Hide resolved src/Components/FakeTargetsOutline.fs Outdated
Show resolved Hide resolved src/Core/LanguageService.fs Outdated
@matthid

This comment was marked as outdated.

Copy link
Contributor Author

commented Jun 17, 2019

New feature Debug and Run buttons (with all dependencies and single target mode):

image

@matthid matthid changed the title [WIP] Fake target support -> 4 0 Fake target support -> 4 0 Jun 17, 2019

@matthid

This comment has been minimized.

Copy link
Contributor Author

commented Jun 17, 2019

I think this ready for review, seems to work.

matthid added some commits Jun 17, 2019

@matthid

This comment has been minimized.

Copy link
Contributor Author

commented Jun 17, 2019

Not sure why the build is red, can someone help?

While further testing I noticed the following (which is currently by design). If navigation doesn't work the likely reason is that Target.initEnvironment() is missing at the top of your buildscript. I'm not sure if there is a good way to report this scenario to the user.
Note: If you click the targets or dependencies on the left, the editor should 'scroll' to the relevant code on the right.

@matthid

This comment has been minimized.

Copy link
Contributor Author

commented Jun 17, 2019

Also note that navigation should work no matter which DSL you are using as long as it is backed by Fake.Core.Target under the hood. For example https://github.com/vbfox/FoxSharp/blob/master/src/BlackFox.Fake.BuildTask/Readme.md should work as well /cc @vbfox

@matthid

This comment has been minimized.

Copy link
Contributor Author

commented Jun 17, 2019

I think navigation into targets defined in a #loaded script might not work, but we can fix that later.

cwd = scriptDir
console = "externalTerminal"
stopAtEntry = false
justMyCode = false

This comment has been minimized.

Copy link
@matthid

matthid Jun 18, 2019

Author Contributor

I'm not sure why we need to deactivate this or what "my Code" means here. If I set this to true no breakpoint hits.
How can I tell the debugger that the current file is "my code"? Anyone understands the details here?
The problem with false is that you can see all the stack from the FAKE runtime and potentially unrelated stuff...

This comment has been minimized.

Copy link
@matthid

matthid Jun 18, 2019

Author Contributor

Can someone please ping someone who knows something?

This comment has been minimized.

Copy link
@Krzysztof-Cieslak

This comment has been minimized.

Copy link
@matthid

matthid Jun 18, 2019

Author Contributor

The .NET Framework debugger considers optimized binaries and non-loaded .pdb files to be non-user code.
Three compiler attributes also affect what the .NET debugger considers to be user code:

DebuggerNonUserCodeAttribute tells the debugger that the code it's applied to isn't user code.
DebuggerHiddenAttribute hides the code from the debugger, even if Just My Code is turned off.
DebuggerStepThroughAttribute tells the debugger to step through the code it's applied to, rather than step into the code.

The .NET Framework debugger considers all other code to be user code.

Ok none of these attributes was set but I saw in the debug output:

Not loading <compiledDll_hash>.pdb because just my code is enabled.
So the debugger is not loading the pdb because just my code is enabled and it considers the dll not 'my code' because no pdb is loaded? Circle reasoning? I'm sure the dll has --optimize- enabled

This comment has been minimized.

Copy link
@matthid

matthid Jun 18, 2019

Author Contributor

Should we ignore this for now and note as "known limitation"? To be honest, I have no idea what to do.
Just unfortunate that the experience is a bit unfortunate... At least it works.

@matthid

This comment has been minimized.

Copy link
Contributor Author

commented Jun 18, 2019

Ok it now looks like this:
image

I took the icons from https://github.com/microsoft/vscode/tree/master/src/vs/base/browser/ui/dialog, not sure if this OK, probably not. Ideas?

@matthid

This comment has been minimized.

Copy link
Contributor Author

commented Jun 18, 2019

Ideally, we would add Icons for "soft" and "hard" dependencies as well...

@matthid matthid referenced this pull request Jun 18, 2019

Open

Improve FAKE Support TODO List (discussion and feedback) #1144

1 of 16 tasks complete

@Krzysztof-Cieslak Krzysztof-Cieslak merged commit 4d8c9d2 into ionide:4.0 Jun 22, 2019

1 of 3 checks passed

ionide.ionide-vscode-fsharp Build #177 failed
Details
ionide.ionide-vscode-fsharp (ExperimentalFsharp) ExperimentalFsharp failed
Details
ionide.ionide-vscode-fsharp (IonideFsharp) IonideFsharp succeeded
Details

Krzysztof-Cieslak added a commit that referenced this pull request Jun 24, 2019

Add Fake target support -> 4 0 (#1137)
* smaller fixes

* implement outline for fake targets

* remove logging

* Give FSAC some context

* fix languageserver implementation (based on 4.0)

* add logger and use fsharp/fakeTargets instead

* simplify package.json

* Remove FakeRuntimePath and add support for running and debugging targets

* cleanup

* update ionide-vscode-helper files

* use new error information from fsac and add them on top of the outline

* fix error messages.

* Just to be safe use --nocache when debugging as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.