-
Notifications
You must be signed in to change notification settings - Fork 588
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
How to enable VSCode integration to fake-dotnetcore? #1744
Comments
Ok the principle idea is to have "include" scripts for the IDE in order to provide proper intellisense (via So the current way (as scripting is not supported in netcore) is to manually use a paket load script and load FakeLib.dll (the "old" FAKE) via This is quite cumbersome at the moment. Take a look at |
By the way any help/idea/hack is appreciated in this space... I'd like to get this to work as well... |
I just ported one of my project to Fake5 and wasn't that easy at first. My way to get intellisense support by doing: To get intellisense, i wrote: paket.dependencies:
build.fsx (* -- Fake Dependencies paket.dependencies
file ./paket.dependencies
group netcorebuild
-- Fake Dependencies -- *)
#if !DOTNETCORE
#I "./packages/netcorebuild"
#r "NETStandard.Library.NETFramework/build/net461/lib/netstandard.dll"
#r "Fake.DotNet.Paket/lib/netstandard2.0/Fake.DotNet.Paket.dll"
#r "Fake.IO.FileSystem/lib/netstandard2.0/Fake.IO.FileSystem.dll"
#r "Fake.Core.Globbing/lib/netstandard2.0/Fake.Core.Globbing.dll"
#r "Fake.Core.String/lib/netstandard2.0/Fake.Core.String.dll"
#r "Fake.Core.Target/lib/netstandard2.0/Fake.Core.Target.dll"
#r "Fake.DotNet.Cli/lib/netstandard2.0/Fake.DotNet.Cli.dll"
#r "Fake.Core.ReleaseNotes/lib/netstandard2.0/Fake.Core.ReleaseNotes.dll"
#r "Fake.Core.Process/lib/netstandard2.0/Fake.Core.Process.dll"
#r "Fake.Core.Environment/lib/netstandard2.0/Fake.Core.Environment.dll"
#endif
open System
open System.IO
open System.Text.RegularExpressions
open Fake.Core.Globbing.Operators
open Fake.Core
open Fake.Core.Process
open Fake.Core.TargetOperators
open Fake.DotNet.Cli
open Fake.IO
open Fake.IO.FileSystemOperators
open Fake.DotNet
open Fake.Core.String |
Oh very interesting, thanks for this. maybe this could be a way to get it working... |
As an easy step, you could have paket generate the include scripts for the framework you'll be executing in and load that? |
After, I don't know we will solve some of the semantic for example, I only open open Fake.IO
Target.Create "Docs.Setup" (fun _ ->
// Make sure directories exist
Directory.ensure "./docs/scss/extra/highlight.js/"
// Copy files from node_modules allow us to manage them via yarn
Shell.CopyDir "./docs/public/fonts" "./node_modules/font-awesome/fonts" (fun _ -> true)
Shell.CopyFile "./docs/scss/extra/highlight.js/atom-one-light.css" "./node_modules/highlight.js/styles/atom-one-light.css"
) If I would open I see two solution, change the |
@MangelMaxime Yes opening only |
Ok an initial fix will be part of beta011, we generate intellisense-scripts with the initial run of the script. So the following workflow should work soon:
|
@matthid Do you get intellisense when using Ionide and adding On my side, i only errors: |
@MangelMaxime yes it works for me. The only known issue is: You need to use ‘storage:none’ in order for the paths to be correct (this is default for ‘#r “paket: ...”’) Can you post your example? |
I am not at work and so can't check the paket.dependencies but I think I didn't set the |
@matthid Even by using Reproduction projectMy project can be find here
Machine infos
intellisense.fsx (click to expand)
// This file is automatically generated by FAKE
// This file is needed for IDE support only
printfn "loading dependencies ..."
#if !FAKE
#r "../../../../../../../../../../.nuget/packages/fake.core.semver/5.0.0-beta018/lib/net46/Fake.Core.SemVer.dll"
#r "../../../../../../../../../../.nuget/packages/fake.core.context/5.0.0-beta018/lib/net46/Fake.Core.Context.dll"
#r "../../../../../../../../../../.nuget/packages/fake.core.environment/5.0.0-beta018/lib/net46/Fake.Core.Environment.dll"
#r "../../../../../../../../../../.nuget/packages/fake.core.globbing/5.0.0-beta018/lib/net46/Fake.Core.Globbing.dll"
#r "../../../../../../../../../../.nuget/packages/fake.core.string/5.0.0-beta018/lib/net46/Fake.Core.String.dll"
#r "../../../../../../../../../../.nuget/packages/system.net.http/4.3.3/lib/net46/System.Net.Http.dll"
#r "../../../../../../../../../../.nuget/packages/newtonsoft.json/11.0.1/lib/net45/Newtonsoft.Json.dll"
#r "../../../../../../../../../../.nuget/packages/system.security.cryptography.x509certificates/4.3.2/lib/net461/System.Security.Cryptography.X509Certificates.dll"
#r "../../../../../../../../../../.nuget/packages/system.security.cryptography.cng/4.4.0/lib/net47/System.Security.Cryptography.Cng.dll"
#r "../../../../../../../../../../.nuget/packages/system.security.cryptography.csp/4.3.0/lib/net46/System.Security.Cryptography.Csp.dll"
#r "../../../../../../../../../../.nuget/packages/system.security.cryptography.openssl/4.4.0/lib/netstandard2.0/System.Security.Cryptography.OpenSsl.dll"
#r "../../../../../../../../../../.nuget/packages/system.componentmodel.typeconverter/4.3.0/lib/net462/System.ComponentModel.TypeConverter.dll"
#r "../../../../../../../../../../.nuget/packages/system.security.cryptography.algorithms/4.3.1/lib/net463/System.Security.Cryptography.Algorithms.dll"
#r "../../../../../../../../../../.nuget/packages/system.xml.xmldocument/4.3.0/lib/net46/System.Xml.XmlDocument.dll"
#r "../../../../../../../../../../.nuget/packages/system.collections.specialized/4.3.0/lib/net46/System.Collections.Specialized.dll"
#r "../../../../../../../../../../.nuget/packages/system.linq.expressions/4.3.0/lib/net463/System.Linq.Expressions.dll"
#r "../../../../../../../../../../.nuget/packages/system.runtime.serialization.formatters/4.3.0/lib/net46/System.Runtime.Serialization.Formatters.dll"
#r "../../../../../../../../../../.nuget/packages/system.security.cryptography.encoding/4.3.0/lib/net46/System.Security.Cryptography.Encoding.dll"
#r "../../../../../../../../../../.nuget/packages/system.xml.readerwriter/4.3.1/lib/net46/System.Xml.ReaderWriter.dll"
#r "../../../../../../../../../../.nuget/packages/system.collections.nongeneric/4.3.0/lib/net46/System.Collections.NonGeneric.dll"
#r "../../../../../../../../../../.nuget/packages/system.componentmodel.primitives/4.3.0/lib/net45/System.ComponentModel.Primitives.dll"
#r "../../../../../../../../../../.nuget/packages/system.diagnostics.fileversioninfo/4.3.0/lib/net46/System.Diagnostics.FileVersionInfo.dll"
#r "../../../../../../../../../../.nuget/packages/system.diagnostics.process/4.3.0/lib/net461/System.Diagnostics.Process.dll"
#r "../../../../../../../../../../.nuget/packages/system.globalization.extensions/4.3.0/lib/net46/System.Globalization.Extensions.dll"
#r "../../../../../../../../../../.nuget/packages/system.linq/4.3.0/lib/net463/System.Linq.dll"
#r "../../../../../../../../../../.nuget/packages/system.reflection.typeextensions/4.4.0/lib/net461/System.Reflection.TypeExtensions.dll"
#r "../../../../../../../../../../.nuget/packages/system.runtime.serialization.primitives/4.3.0/lib/net46/System.Runtime.Serialization.Primitives.dll"
#r "../../../../../../../../../../.nuget/packages/system.security.cryptography.primitives/4.3.0/lib/net46/System.Security.Cryptography.Primitives.dll"
#r "../../../../../../../../../../.nuget/packages/system.text.regularexpressions/4.3.0/lib/net463/System.Text.RegularExpressions.dll"
#r "../../../../../../../../../../.nuget/packages/system.diagnostics.diagnosticsource/4.4.1/lib/net46/System.Diagnostics.DiagnosticSource.dll"
#r "../../../../../../../../../../.nuget/packages/system.runtime.interopservices/4.3.0/lib/net463/System.Runtime.InteropServices.dll"
#r "../../../../../../../../../../.nuget/packages/system.console/4.3.0/lib/net46/System.Console.dll"
#r "../../../../../../../../../../.nuget/packages/system.io.filesystem/4.3.0/lib/net46/System.IO.FileSystem.dll"
#r "../../../../../../../../../../.nuget/packages/system.reflection/4.3.0/lib/net462/System.Reflection.dll"
#r "../../../../../../../../../../.nuget/packages/microsoft.win32.registry/4.4.0/lib/net461/Microsoft.Win32.Registry.dll"
#r "../../../../../../../../../../.nuget/packages/system.globalization.calendars/4.3.0/lib/net46/System.Globalization.Calendars.dll"
#r "../../../../../../../../../../.nuget/packages/system.io/4.3.0/lib/net462/System.IO.dll"
#r "../../../../../../../../../../.nuget/packages/system.threading.tasks.extensions/4.4.0/lib/netstandard2.0/System.Threading.Tasks.Extensions.dll"
#r "../../../../../../../../../../.nuget/packages/system.threading.threadpool/4.3.0/lib/net46/System.Threading.ThreadPool.dll"
#r "../../../../../../../../../../.nuget/packages/microsoft.win32.primitives/4.3.0/lib/net46/Microsoft.Win32.Primitives.dll"
#r "../../../../../../../../../../.nuget/packages/system.collections.immutable/1.4.0/lib/netstandard2.0/System.Collections.Immutable.dll"
#r "../../../../../../../../../../.nuget/packages/system.diagnostics.tracing/4.3.0/lib/net462/System.Diagnostics.Tracing.dll"
#r "../../../../../../../../../../.nuget/packages/system.io.filesystem.primitives/4.3.0/lib/net46/System.IO.FileSystem.Primitives.dll"
#r "../../../../../../../../../../.nuget/packages/system.runtime.extensions/4.3.0/lib/net462/System.Runtime.Extensions.dll"
#r "../../../../../../../../../../.nuget/packages/system.security.accesscontrol/4.4.1/lib/net461/System.Security.AccessControl.dll"
#r "../../../../../../../../../../.nuget/packages/system.threading.thread/4.3.0/lib/net46/System.Threading.Thread.dll"
#r "../../../../../../../../../../.nuget/packages/system.runtime/4.3.0/lib/net462/System.Runtime.dll"
#r "../../../../../../../../../../.nuget/packages/system.security.principal.windows/4.4.1/lib/net461/System.Security.Principal.Windows.dll"
#r "../../../../../../../../../../.nuget/packages/fake.core.releasenotes/5.0.0-beta018/lib/net46/Fake.Core.ReleaseNotes.dll"
#r "../../../../../../../../../../.nuget/packages/fake.core.buildserver/5.0.0-beta018/lib/net46/Fake.Core.BuildServer.dll"
#r "../../../../../../../../../../.nuget/packages/fake.io.filesystem/5.0.0-beta018/lib/net46/Fake.IO.FileSystem.dll"
#r "../../../../../../../../../../.nuget/packages/system.reflection.metadata/1.5.0/lib/netstandard2.0/System.Reflection.Metadata.dll"
#r "../../../../../../../../../../.nuget/packages/fake.core.trace/5.0.0-beta018/lib/net46/Fake.Core.Trace.dll"
#r "../../../../../../../../../../.nuget/packages/fake.core.process/5.0.0-beta018/lib/net46/Fake.Core.Process.dll"
#r "../../../../../../../../../../.nuget/packages/fake.core.target/5.0.0-beta018/lib/net46/Fake.Core.Target.dll"
#r "../../../../../../../../../../.nuget/packages/fake.dotnet.cli/5.0.0-beta018/lib/net46/Fake.DotNet.Cli.dll"
#r "../../../../../../../../../../.nuget/packages/fake.dotnet.paket/5.0.0-beta018/lib/net46/Fake.DotNet.Paket.dll"
#r "../../../../../../../../../../.nuget/packages/fake.tools.git/5.0.0-beta018/lib/net46/Fake.Tools.Git.dll"
#r "System"
#r "System.ComponentModel.Composition"
#r "System.Core"
#r "System.Runtime.Serialization"
#r "System.Numerics"
#r "System.Xml"
#r "Microsoft.CSharp"
#r "System.Net.Http"
#r "System.Configuration"
#endif
When you spoke about the need to use |
Are the realtive paths correct? Does it work if you replace with absolute paths and re-open the Editor? I think something is broken here... |
Indeed the path is incorrect. Correct path: Generatec path: Both the correct relative path and asbolute path are working. |
1. use absolute paths when storage:none is specified 2. make sure the RootPath is properly evaluated.
1. use absolute paths when storage:none is specified 2. make sure the RootPath is properly evaluated.
Basically this should work now in beta020, I don't think FAKE is impacted directly by fsprojects/Paket#3080, just to be safe I'll release beta021 soonish. @MangelMaxime thanks for the feedback and please continue to let me know if things don't work or could be done better :) |
Awesome it's working ❤️ Sure, I will keep using FAKE 5 on some of my project and give feedback if needed and send some PR :) |
I just installed Fake 5 to a new project of mine. I loaded an example build script, but got this:
I know that the build script does not compile. But Ionide does not recognize the
Fake
namespace.Is there a way to make Ionide understand the build script despite the inline Paket dependencies file?
The text was updated successfully, but these errors were encountered: