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

matthid
Copy link
Contributor

@matthid matthid commented Jun 16, 2019

Replaces #1136
This depends on ionide/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
Copy link
Contributor Author

matthid 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)

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

@matthid matthid left a comment

Choose a reason for hiding this comment

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

some cleanup

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

This comment has been minimized.

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

matthid commented Jun 17, 2019

I think this ready for review, seems to work.

@matthid
Copy link
Contributor Author

matthid 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
Copy link
Contributor Author

matthid 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
Copy link
Contributor Author

matthid 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
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can someone please ping someone who knows something?

Copy link
Member

Choose a reason for hiding this comment

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

I believe this is exactly the same as Just My Code in VS - https://docs.microsoft.com/en-us/visualstudio/debugger/just-my-code?view=vs-2019

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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
Copy link
Contributor Author

matthid 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
Copy link
Contributor Author

matthid commented Jun 18, 2019

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

@Krzysztof-Cieslak Krzysztof-Cieslak merged commit 4d8c9d2 into ionide:4.0 Jun 22, 2019
Krzysztof-Cieslak pushed a commit that referenced this pull request Jun 24, 2019
* 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
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants