fsharp / fsautocomplete Goto Github PK
View Code? Open in Web Editor NEWF# language server using Language Server Protocol
License: Other
F# language server using Language Server Protocol
License: Other
As reported by @xenocons at fsprojects/zarchive-fsharpbinding#1019:
To reproduce the issue,
Create a .fsx file somewhere else, and put the contents as:
#if INTERACTIVE #I @"C:\Users\user\Documents\Visual Studio 2013\Projects\test\";; #endif
Save this file, and close emacs, then load emacs again, then load this file, you will see fsautocomplete.exe crash with something like the following:
Unhandled Exception: System.Exception: Exception when getting check options for 'c:\Users\user\Desktop\test.fsx' .Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at Microsoft.FSharp.Control.AsyncBuilderImpl.commit[a](Result`1 res) at Microsoft.FSharp.Control.CancellationTokenOps.RunSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout) at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) at FSharp.CompilerBinding.LanguageService.GetScriptCheckerOptions(String fileName, String projFilename, String source) in C:\Users\user\.emacs.d\fsharpbinding\FSharp.CompilerBinding\LanguageService.fs:line 299
Additionally, using fsautocomplete.exe and parsing the above file will cause the same exception.
I think it could perhaps be that the version 12 of the framework stuff is not in VS2015's version of F#? I tried this from a fresh elpa install of fsharp-mode.
Edit: Now that i think about it, this is probably due to CompilerServices not using .NET 4.6 yet?
With all F# Plugins for Atom,ST and Vim i got StackOverflowException
on Win7 64bit (VS2015 installed). Then I tried the following:
I have cloned master branch and build it with build.cmd
, in the FsAutoComplete folder i have executed "bin\Debug\fsautocomplete.exe" and put in:
project "FsAutoComplete.fsproj"
Result
Process is terminated due to StackOverflowException.
Simplest would be to use the existing FSharpToolTip
type and output an array of arrays, which would be an outer array of "things" with inner arrays of overloads (reverse patch):
- type ToolTipElement =
- {
- Text: string
- XmlDoc: Option<string>
- }
-
type OverloadParameter =
{
Name : string
@@ -293,28 +287,6 @@ module CommandResponse =
member x.Declarations(decls) =
x.WriteJson { Kind = "declarations"; Data = decls }
- member x.ToolTipSymbol(FSharpToolTipText elements) =
- let xmldoc cmt =
- match cmt with
- | FSharpXmlDoc.Text s -> Some s
- | FSharpXmlDoc.None -> None
- | FSharpXmlDoc.XmlDocFileSignature(file, key) -> Some (file + "," + key)
-
- let data =
- [ for e in elements do
- match e with
- | FSharpToolTipElement.None -> ()
- | FSharpToolTipElement.CompositionError err ->
- yield [ {Text = err; XmlDoc = None} ]
- | FSharpToolTipElement.Single(it, comment) ->
- yield [{ Text = it; XmlDoc = xmldoc comment }]
- | FSharpToolTipElement.Group(items) ->
- yield [ for it, comment in items do
- yield { Text = it; XmlDoc = xmldoc comment } ]
- ]
-
- x.WriteJson { Kind = "tooltip"; Data = data }
-
member x.ToolTip(tip) =
x.WriteJson { Kind = "tooltip"; Data = TipFormatter.formatTip tip }
A more involved approach would be to use get the FSharpSymbol
like is done in the XS support, and output information from that.
Some examples of current tooltips are:
List.map
val map : mapping:('T -> 'U) -> list:'T list -> 'U list
Full name: Microsoft.FSharp.Collections.List.map
Choice
Multiple items
type Choice<'T1,'T2> =
| Choice1Of2 of 'T1
| Choice2Of2 of 'T2
Full name: Microsoft.FSharp.Core.Choice<_,_>
--------------------
Console.WriteLine
Multiple overloads
Console.WriteLine() : unit
Console.WriteLine(value: bool) : unit
Console.WriteLine(value: char) : unit
Console.WriteLine(buffer: char []) : unit
1454508556.569836: project "c:/Users/msjp_000/Documents/Visual Studio 2015/Projects/Dougu/Dougu/Dougu.fsproj" verbose
1454508556.6635273: {"Kind":"project","Data":{"Project":"c:\\Users\\msjp_000\\Documents\\Visual Studio 2015\\Projects\\Dougu\\Dougu\\Dougu.fsproj","Files":[],"Output":"null","References":["C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\FSharp\\.NETFramework\\v4.0\\4.4.0.0\\FSharp.Core.dll"],"Logs":{"c:\\Users\\msjp_000\\Documents\\Visual":"System.IO.FileNotFoundException: Could not find file 'c:\\Users\\msjp_000\\Documents\\Visual'.\r\nFile name: 'c:\\Users\\msjp_000\\Documents\\Visual'\r\n at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)\r\n at System.IO.StreamReader..ctor(String path)\r\n at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.projectInstanceFromFullPath@139(FSharpProjectFileInfo this, ProjectCollection engine, String fsprojFullPath)\r\n at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.FSharpProjectFileInfo.CrackProjectUsingNewBuildAPI(String fsprojFile)\r\n at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.FSharpProjectFileInfo..ctor(String fsprojFileName, FSharpOption`1 properties, FSharpOption`1 enableLogging)\r\n at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.getOptions@376(Boolean enableLogging, FSharpList`1 properties, String file)\r\n at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.getOptions(String file, Boolean enableLogging, FSharpList`1 properties)\r\n at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.main(String[] argv)"}}}
c:\Users\msjp_000\Documents\Visual:
System.IO.FileNotFoundException: Could not find file 'c:\Users\msjp_000\Documents\Visual'.
File name: 'c:\Users\msjp_000\Documents\Visual'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
at System.IO.StreamReader..ctor(String path)
at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.projectInstanceFromFullPath@139(FSharpProjectFileInfo this, ProjectCollection engine, String fsprojFullPath)
at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.FSharpProjectFileInfo.CrackProjectUsingNewBuildAPI(String fsprojFile)
at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.FSharpProjectFileInfo..ctor(String fsprojFileName, FSharpOption`1 properties, FSharpOption`1 enableLogging)
at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.getOptions@376(Boolean enableLogging, FSharpList`1 properties, String file)
at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.getOptions(String file, Boolean enableLogging, FSharpList`1 properties)
at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.main(String[] argv)
fsautocomplete.exe starts up, but doesn't respond to commands and can't be terminated via ^C when running on mono 4.2.1 or 4.2.2. Running on 4.0.4 works fine. I can reproduce this 100% of the time on my x86_64 Arch install.
copied from https://github.com/fsprojects/atom-fsharp/issues/108
When I tried to declare a function using Σ in Atom it said the character was unexpected.
( oddly the tooltips stop working during this error state, but the info bar continues to work )
However I know this character is supported as I've seen it in libraries in the past and visual studio gladly accepts it and even displays it inside tooltips.
Could this issue be rooted in how FsAutocomplete is encoding the strings and sending them to the compiler service?
Maybe we should add this? Or inject a special error message.
Merge in this prototype: https://github.com/rneatherway/fsharpbinding/tree/msbuildpath
I keep getting a malformed json error with the following code snippet when I put the cursor at SqlCommandProvider. Once the error happens, fsharp-mode becomes useless as the status window is out of control. Not sure if this is an FsAutoComplete issue or a Newtonsoft issue as to which is outputting the malformed json so posting here until I can dig deeper.
module FSharpErrorTest
open System
open FSharp.Data
open FSharp.Data.SqlClient
[<Literal>]
let connectionString =
@"Data Source=localhost;User Id=user; password=Test123;Initial Catalog=testdb;MultipleActiveResultSets=True"
type GetProject =
SqlCommandProvider<"SELECT * FROM Projects WHERE Id = @id", connectionString>
let getProjectById id =
use cmd = new SqlCommandProvider<"SELECT * FROM Projects WHERE Id=@id", connectionString>
cmd.Execute(id)
|> Seq.map (fun x -> x.Title)
from Messages buffer
error in process filter: Wrong type argument: hash-table-p, "Error: F# completion process produced malformed JSON ({\"Kind\":\"tooltip\",\"Data\":\"type SqlCommandProvider\\n\\nFull name: FSharp.Data.SqlCommandProvider\\n\\n\\n\\n<summary>Typed representation of a T-SQL statement to execute against a SQL Server database.</summary> \\n<param name='CommandText'>Transact-SQL statement to execute at the data source.</param>\\n<param name='ConnectionStringOrName'>String used to open a SQL Server database or the name of the connection string in the configuration file in the form of \"name=<connection string name>\".</param>\\n<param name='ResultType'>A value that defines structure of result: Records, Tuples, DataTable, or SqlDataReader.</param>\\n<param name='SingleRow'>If set the query is expected to return a single row of the result set. See MSDN documentation for details on CommandBehavior.SingleRow.</param>\\n<param name='ConfigFile'>The name of the configuration file that's used for connection strings at DESIGN-TIME. The default value is app.config or web.config.</param>\\n<param name='AllParametersOptional'>If set all parameters become optional. NULL input values must be handled inside T-SQL.</param>\\n<param name='ResolutionFolder'>A folder to be used to resolve relative file paths to *.sql script files at compile time. The default value is the folder that contains the project or script.</param>\\n<param name='DataDirectory'>The name of the data directory that replaces |DataDirectory| in connection strings. The default value is the project or script directory.</param>\"}
from fsharp-complete buffer:
{"Kind":"tooltip","Data":"type SqlCommandProvider\n\nFull name: FSharp.Data.SqlCommandProvider\n\n\n\n<summary>Typed representation of a T-SQL statement to execute against a SQL Server database.</summary> \n<param name='CommandText'>Transact-SQL statement to execute at the data source.</param>\n<param name='ConnectionStringOrName'>String used to open a SQL Server database or the name of the connection string in the configuration file in the form of "name=<connection string name>".</param>\n<param name='ResultType'>A value that defines structure of result: Records, Tuples, DataTable, or SqlDataReader.</param>\n<param name='SingleRow'>If set the query is expected to return a single row of the result set. See MSDN documentation for details on CommandBehavior.SingleRow.</param>\n<param name='ConfigFile'>The name of the configuration file that's used for connection strings at DESIGN-TIME. The default value is app.config or web.config.</param>\n<param name='AllParametersOptional'>If set all parameters become optional. NULL input values must be handled inside T-SQL.</param>\n<param name='ResolutionFolder'>A folder to be used to resolve relative file paths to *.sql script files at compile time. The default value is the folder that contains the project or script.</param>\n<param name='DataDirectory'>The name of the data directory that replaces |DataDirectory| in connection strings. The default value is the project or script directory.</param>"}
Perhaps the output assemblies should not also be included in the list returned by FCS?
I've started using Atom-fsharp developing one of my projects and I'm experiencing really a lot of StackOverflow exceptions - I've mentioned it some time ago but it was not as often as this time, so I've started investigated it bit more.
First observation (pointed out by smarter-than-me people from F# Slack channel): looks like our main function is not tail recursive - I was pointed out to this blog post http://vaskir.blogspot.com/2013/02/recursion-and-trywithfinally-blocks.html - which states that using try ... with
in recursive function makes it not-tail recursive.
Our main function has this nice try ... with
which should work as global error handler but looks like we have here some side effect ;)
From @rneatherway on October 25, 2014 11:20
Unhandled Exception: Microsoft.FSharp.Compiler.ErrorLogger+UnresolvedPathReferenceNoRange: Exception of type 'Microsoft.FSharp.Compiler.ErrorLogger+UnresolvedPathReferenceNoRange' was thrown.
at Microsoft.FSharp.Control.AsyncBuilderImpl.commit[a](Result`1 res)
at Microsoft.FSharp.Control.CancellationTokenOps.RunSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout)
at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken)
at FSharp.InteractiveAutocomplete.Main.main(State state) in D:\dev\rneatherway-fsharpbinding\FSharp.AutoComplete\Program.fs:line 493
at FSharp.InteractiveAutocomplete.Main.entry(String[] args) in D:\dev\rneatherway-fsharpbinding\FSharp.AutoComplete\Program.fs:line 569
Copied from original issue: fsprojects/zarchive-fsharpbinding#777
Right now helptext command returns (example from tests) something like:
{
"Kind": "helptext",
"Data": {
"funky": "val funky : x:int -> int"
}
}
I'm not sure if format of returned JSON is right - I would suggest something like
{
"Kind": "helptext",
"Data": {
"Name": "funky"
"Text": "val funky : x:int -> int"
}
}
I think such solution would be more consistent with results of others commands and would make it easier to parse result back in clients ( at least from F# in Atom point of view, no idea about rest editors and how "breaking" is that change).
Submit a PR to FAKE to put it back to normal there as well.
To reproduce:
build.sh
a first time to generate the projecttests/sample.Tests/Tests.fs
with Vim or Emacs, activate F# syntax checkingYou'll see the editor complain that the sample
module is undefined (sample.Tests.fsproj
includes it as a ProjectReference
). However, build.sh
successfully compiles and runs the unit tests, so the project is set up correctly. I presume this indicates a bug in fsharpbinding?
Emacs complains about an undefined module/namespace. Vim gives me this:
Unable to find the file '/tmp/ProjectScaffold-master/tests/sample.Tests/./bin/Debug/sample.dll' in any of /usr/lib/mono/4.0 /tmp/ProjectScaffold-master/tests/sample.Tests ...
That's more question then true issue. I just wonder why most calls to FCS are run synchronously (only parse call is run async). It doesn't feel right (but I might be wrong as I'm only starting to understand what's going on here ;) ).
Another thing I'd like to ask (sorry for such multi-topic issue) is whether we could support cancellation of calls to FCS. I think it's reasonable to assume that if we get new request of given type on command queue client is not longer interested in past version just in newest request - we should cancel FCS call if current FCS call is for same request type and we should remove all requests of this type from command queue.
Let's say I've written Sy
in editor and requested completion. From FSharp.Autocomplete
I'm getting list of all possible completions (as nothing was written) instead of getting those completions which starts with (or contains) Sy
. Is that by-design behavior? Or am I doing something wrong with it? Or we should try to change it?
Also maybe it would be nice to add Gitter room for this project? It could be good place to ask similar questions. (Or we can use F# slack channel but I'm not sure if all contributors / maintainers / people doing editor support are there, regularly I've been seeing there @rojepp, @kjnilsson and @7sharp9 )
IFileSystem should be implemented, as was done in XS here: fsprojects/zarchive-fsharpbinding#602
FSAC would then keep a list of modified file contents, and present those as fact to FCS via IFileSystem.
Editors are already sending modified file contents, so implementing this would improve error checking without editors needing to change anything.
From @rneatherway on April 17, 2014 9:11
See #481. We now only parse buffers if they have changed, however something they depend on may have changed. FCS can inform fsautocomplete of this via the dirtyNotify callback. This can then be sent to a user of fsautocomplete (emacs) so that the editor knows to parse the buffer unconditionally.
Copied from original issue: fsprojects/zarchive-fsharpbinding#483
From @rneatherway on October 24, 2014 13:37
Unhandled Exception:
System.Exception: Exception when getting check options for '/auto/users/robnea/dev/rneatherway-fsharpbinding/FSharp.AutoComplete/build.fsx'
.Details: System.TimeoutException: The operation has timed-out.
at Microsoft.FSharp.Control.CancellationTokenOps.RunSynchronously[ProjectOptions] (CancellationToken token, Microsoft.FSharp.Control.FSharpAsync`1 computation, Microsoft.FSharp.Core.FSharpOption`1 timeout) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[ProjectOptions] (Microsoft.FSharp.Control.FSharpAsync`1 computation, Microsoft.FSharp.Core.FSharpOption`1 timeout, Microsoft.FSharp.Core.FSharpOption`1 cancellationToken) [0x00000] in <filename unknown>:0
at FSharp.CompilerBinding.LanguageService.GetScriptCheckerOptions (System.String fileName, System.String projFilename, System.String source, FSharp.CompilerBinding.FSharpTargetFramework targetFramework) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Core.ExtraTopLevelOperators+PrintFormatToStringThenFail@128-1[Microsoft.FSharp.Compiler.SourceCodeServices.ProjectOptions].Invoke (System.String message) [0x00000] in <filename unknown>:0
Copied from original issue: fsprojects/zarchive-fsharpbinding#776
Parameter completions are sorely missing in Atom, Sublime etc.
Expose FCS GetMethods
to provide parameter completions.
Do include all overloads, perhaps sorted by best-match?
Ident-parsing is ideally done here, not per editor?
Sorry if this is the right place for this kind of report.
I've installed fsharpbinding for emacs via MELPA as per the instructions in the README.
When opening a fsharp script file I get
Failed to start fsautocomplete (Failed to launch: 'mono ~/.emacs.d/elpa/fsharp-mode-20150604.1028/bin/fsautocomplete.exe'). Disabling intellisense. To reenable, set fsharp-ac-intellisense-enabled to t.
To investigate further I run the mono .emacs.d/elpa/fsharp-mode-20150604.1028/bin/fsautocomplete.exe
on the command line and get the following dump:
Invalid type Microsoft.FSharp.Compiler.SourceCodeServices.FSharpProjectFileInfo for instance field FSharp.InteractiveAutocomplete.Main+files@464:p
Unhandled Exception:
System.TypeLoadException: Could not load type 'FSharp.InteractiveAutocomplete.Main+files@464' from assembly 'fsautocomplete, Version=0.18.0.0, Culture=neutral, PublicKeyToken=null'.
at FSharp.InteractiveAutocomplete.Main.entry (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type
'FSharp.InteractiveAutocomplete.Main+files@464' from assembly 'fsautocomplete, Version=0.18.0.0, Culture=neutral, PublicKeyToken=null'.
at FSharp.InteractiveAutocomplete.Main.entry (System.String[] args) [0x00000] in <filename unknown>:0
I was testing FSharp.Atom on the FsharpBinding project and I noticed the following error:
Unable to find the file '/Users/dave/code/xamarin/monodevelop/main/external/fsharpbinding/MonoDevelop.FSharpBinding/bin/Debug/FSharpBinding.Gui.dll
In my fsprog the output path is set to
<OutputPath>..\bin\mac-linux\Debug\</OutputPath>`
Yet bin/debug
is being used to find the reference, this seems really similar to this:
I use FsAutoComplete via vim-fsharp
, but the same error happens when it is run directly. It complains about not finding System.Diagnostics.Process
, even though the same project compiles perfectly well Visual Studio, MSBuild, or just fsc.
This issue can be easily reproduced: create a minimal F# project (referencing System
by default) and try to use anything from the module Process
in an included fs
source file, e.g.,
module M
open System.Diagnostics
let p = Process.GetProcessesByName "fsi"
Then,
fsautocomplete.exe
project "fsautocomplete-repro.fsproj"
{"Kind":"project","Data":{"Project":"D:\\Code\\fsharp-repro\\FsAutoComplete-repro\\fsautocomplete-repro.fsproj","Files":["D:\\Code\\fsharp-repro\\FsAutoComplete-repro\\AssemblyInfo.fs","D:\\Code\\fsharp-repro\\FsAutoComplete-repro\\Program.fs"],"Output":"D:\\Code\\fsharp-repro\\FsAutoComplete-repro\\bin\\Debug\\FsAutoComplete_repro.exe","References":["C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\FSharp\\.NETFramework\\v4.0\\4.4.0.0\\FSharp.Core.dll"],"Framework":"v4.5.2"}}
parse "Program.fs"
module M
open System.Diagnostics
let p = Process.GetProcessesByName "fsi"
<<EOF>>
{"Kind":"info","Data":"Background parsing started"}
{"Kind":"errors","Data":[{"FileName":"D:\\Code\\fsharp-repro\\FsAutoComplete-repro\\Program.fs","StartLine":5,"EndLine":5,"StartColumn":9,"EndColumn":16,"Severity":"Error","Message":"The namespace or module 'Process' is not defined","Subcategory":"typecheck"}]}
Am I missing anything here?
Add a command that resolves all symbol locations for the symbol at a location in the code, so that editors can highlight occurrences.
I've been trying to get this reorg of the project structure working before I submit this PR #6 onto this repo, but I've run into this issue and haven't been able to figure out how to resolve it.
Any ideas?
Everything was working fine with Mono 4.x installed but I've had to move back to 3.1.2 to sort out a build issue. I'm now getting this exception when I open up an fs or fsx file. This is pasted in directly in from messages.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Utilities.v12.0' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Build.Utilities.v12.0'
at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName,System.Security.Policy.Evidence)
at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName)
at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in :0
at FsAutoComplete.CompilerServiceInterface+onResolveEvent@163.Invoke (System.Object sender, System.ResolveEventArgs args) [0x00000] in :0
at System.AppDomain.DoAssemblyResolve (System.String name, Boolean refonly) [0x00000] in :0
at (wrapper managed-to-native) System.AppDomain:LoadAssembly (System.AppDomain,string,System.Security.Policy.Evidence,bool)
at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName,System.Security.Policy.Evidence)
at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.AppDomain:Load (System.Reflection.AssemblyName)
at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in :0
at FsAutoComplete.CompilerServiceInterface+onResolveEvent@163.Invoke (System.Object sender, System.ResolveEventArgs args) [0x00000] in :0
at System.AppDomain.DoAssemblyResolve (System.String name, Boolean refonly) [0x00000] in :0
at FsAutoComplete.Main.main (FsAutoComplete.State state) [0x00000] in :0
See fsharp/fsharp-compiler-docs#384
Related to #42, for supporting VS2015 and MSBuild > 12.
The script checker options will default to the version of FSharp.Core used by FSAC, which is FSharp.Core 4.3.0.0. So this is already a minor issue w.r.t. F# 3.1/ FSharp.Core 4.3.1.0.
From @rneatherway on October 22, 2014 15:58
Comment in FSharp.AutoComplete/Program.fs:
// TODO: Clean up the API these options are being generated to call
//
// That API is in FSharp.CompilerBinding.LanguageService.
// 1. It expects a Target Framework, but only for FSI as
// FCS is rumoured not to return references including FSharp.Core
// and it uses the framework to guess where it is.
// We will just use 4.5.
// 2. The CompileFiles just get added to the options, so we will do that
// here and then pass in an empty array of CompileFiles.
Any changes will also affect monodevelop binding.
Copied from original issue: fsprojects/zarchive-fsharpbinding#772
There exists other tools created by community such as Fantomas and FSharpLint using FCS under the hood. It would be nice if we could integrate those tools into FSAC to not force editors to host multiple FCS sessions if they want use those tools. Also both tools provide API which can be used with AST, so they don't need to parse files again on their own.
Sometimes (when I'm not lucky!) I get an error "socket closed" in the Atom editor which happens when the fsautocomplete.exe
process stops (cc @Krzysztof-Cieslak). It turns out that this was caused by a timeout:
C:\Users\Tomas\.atom\packages\atom-fsharp\bin>fsautocomplete.exe -l=log.txt
parse "nop.fsx"
1 + 1
<<EOF>>
INFO: Background parsing started
<<EOF>>
Unhandled Exception: System.Exception: Exception when getting check options for
'C:\Users\Tomas\.atom\packages\atom-fsharp\bin\nop.fsx'
.Details: System.TimeoutException: The operation has timed out.
at Microsoft.FSharp.Control.CancellationTokenOps.RunSynchronously[a](Cancella
tionToken token, FSharpAsync`1 computation, FSharpOption`1 timeout)
at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 com
putation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken)
at FSharp.CompilerBinding.LanguageService.GetScriptCheckerOptions(String file
Name, String projFilename, String source)
at <StartupCode$FSharp-Core>[email protected](Exception
exn)
at Microsoft.FSharp.Control.CancellationTokenOps.StartWithContinuations@1198-
1.Invoke(Exception x)
at Microsoft.FSharp.Control.Trampoline.ExecuteAction(FSharpFunc`2 firstAction
)
at Microsoft.FSharp.Control.AsyncBuilderImpl.startAsync[a](CancellationToken
cancellationToken, FSharpFunc`2 cont, FSharpFunc`2 econt, FSharpFunc`2 ccont, FS
harpAsync`1 p)
at Microsoft.FSharp.Control.CancellationTokenOps.StartWithContinuations[T](Ca
ncellationToken token, FSharpAsync`1 a, FSharpFunc`2 cont, FSharpFunc`2 econt, F
SharpFunc`2 ccont)
at Microsoft.FSharp.Control.FSharpAsync.StartWithContinuations[T](FSharpAsync
`1 computation, FSharpFunc`2 continuation, FSharpFunc`2 exceptionContinuation, F
SharpFunc`2 cancellationContinuation, FSharpOption`1 cancellationToken)
at Microsoft.FSharp.Control.FSharpAsync.StartImmediate(FSharpAsync`1 computat
ion, FSharpOption`1 cancellationToken)
at FSharp.InteractiveAutocomplete.Main.main(State state)
at FSharp.InteractiveAutocomplete.Main.entry(String[] args)
This should be handled in some better way - it should probably not crash the process (or perhaps Atom needs to restart the process?)
From @rneatherway on November 25, 2014 18:7
Because the helptext is returned synchronously, if it isn't ready then "(loading description...)" is returned. This cause problems on slow machines (like the CI environment). To work around this large waits have been inserted in the JSON tests (plain text doesn't support helptext), which works most of the time, but is ugly and unpredictable.
For testing we could instead use DescriptionTextAsync
which 'Never returns "Loading...".' as mentioned here: http://fsharp.github.io/FSharp.Compiler.Service/reference/microsoft-fsharp-compiler-sourcecodeservices-fsharpdeclarationlistitem.html
Copied from original issue: fsprojects/zarchive-fsharpbinding#857
From @rneatherway on October 15, 2014 13:5
At the time I was in Emacs. I had just entered [<Test>]
and was at the end of the line. I may or may not have pressed enter yet, ready to type let``test name``= ...
The text [<Test>]
was highlighted as an error at that time.
*fsharp-debug*
contents:
1413378161.9040136: Parsing "/auto/users/robnea/dev/rneatherway-fsharpbinding/FSharp.AutoComplete/test/unit/ProjectLoading/ProjectReferenceTests.fs"
1413378161.9046407: tooltip "/auto/users/robnea/dev/rneatherway-fsharpbinding/FSharp.AutoComplete/test/unit/ProjectLoading/ProjectReferenceTests.fs" 29 7 400
1413378161.9917514: Received 'INFO' message of length 65
1413378162.0245857: Received 'errors' message of length 65
Unhandled Exception:
Microsoft.FSharp.Compiler.ErrorLogger+UnresolvedPathReferenceNoRange: Exception of type 'Microsoft.FSharp.Compiler.ErrorLogger+UnresolvedPathReferenceNoRange' was thrown.
at Microsoft.FSharp.Compiler.Tast+CcuThunk.EnsureDerefable (System.String[] requiringPath) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Compiler.Tast+NonLocalEntityRef.TryDeref (Boolean canError) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Compiler.Tast+EntityRef.Resolve (Boolean canError) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Compiler.Tast+EntityRef.get_Deref () [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Compiler.Tastops.stripTyEqnsA (Microsoft.FSharp.Compiler.TcGlobals g, Boolean canShortcut, Microsoft.FSharp.Compiler.TType ty) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Compiler.Tastops.stripTyEqnsAndErase (Boolean eraseFuncAndTuple, Microsoft.FSharp.Compiler.TcGlobals g, Microsoft.FSharp.Compiler.TType ty) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Compiler.Tastops.stripTyEqnsWrtErasure (Microsoft.FSharp.Compiler.Erasure erasureFlag, Microsoft.FSharp.Compiler.TcGlobals g, Microsoft.FSharp.Compiler.TType ty) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Compiler.Tastops.typeAEquivAux (Microsoft.FSharp.Compiler.Erasure erasureFlag, Microsoft.FSharp.Compiler.TcGlobals g, Microsoft.FSharp.Compiler.TypeEquivEnv aenv, Microsoft.FSharp.Compiler.TType ty1, Microsoft.FSharp.Compiler.TType ty2) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Collections.ListModule.forall2aux[TType,TType] (Microsoft.FSharp.Core.FSharpFunc`3 f, Microsoft.FSharp.Collections.FSharpList`1 list1, Microsoft.FSharp.Collections.FSharpList`1 list2) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Collections.ListModule.ForAll2[TType,TType] (Microsoft.FSharp.Core.FSharpFunc`2 predicate, Microsoft.FSharp.Collections.FSharpList`1 list1, Microsoft.FSharp.Collections.FSharpList`1 list2) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Compiler.AbstractIL.Internal.Library+List.lengthsEqAndForall2[TType,TType] (Microsoft.FSharp.Core.FSharpFunc`2 p, Microsoft.FSharp.Collections.FSharpList`1 l1, Microsoft.FSharp.Collections.FSharpList`1 l2) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Compiler.Tastops.typesAEquivAux (Microsoft.FSharp.Compiler.Erasure erasureFlag, Microsoft.FSharp.Compiler.TcGlobals g, Microsoft.FSharp.Compiler.TypeEquivEnv aenv, Microsoft.FSharp.Collections.FSharpList`1 l1, Microsoft.FSharp.Collections.FSharpList`1 l2) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Compiler.Tastops.typeAEquivAux (Microsoft.FSharp.Compiler.Erasure erasureFlag, Microsoft.FSharp.Compiler.TcGlobals g, Microsoft.FSharp.Compiler.TypeEquivEnv aenv, Microsoft.FSharp.Compiler.TType ty1, Microsoft.FSharp.Compiler.TType ty2) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Compiler.Tast+TType,Microsoft.FSharp.Compiler.Tast+TType].InvokeFast[Boolean] (Microsoft.FSharp.Core.FSharpFunc`2 func, Microsoft.FSharp.Compiler.TType arg1, Microsoft.FSharp.Compiler.TType arg2) [0x00000] in <filename unknown>:0
at [email protected] (Microsoft.FSharp.Compiler.Val v) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Collections.ListModule.TryFind[Val] (Microsoft.FSharp.Core.FSharpFunc`2 predicate, Microsoft.FSharp.Collections.FSharpList`1 list) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Compiler.Tast+ModuleOrNamespaceType.TryLinkVal (Microsoft.FSharp.Compiler.CcuThunk ccu, Microsoft.FSharp.Compiler.ValLinkageFullKey key) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Compiler.Tast+ValRef.get_Deref () [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Compiler.Infos+GetIntrinsicConstructorInfosOfType@3333-5.Invoke (Microsoft.FSharp.Compiler.ValRef vref) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Collections.ListModule.chooseAllAcc[ValRef,ValRef] (Microsoft.FSharp.Core.FSharpFunc`2 f, Microsoft.FSharp.Collections.FSharpList`1 x
Copied from original issue: fsprojects/zarchive-fsharpbinding#764
Make change to namespaces and paths, also to build.fsx text
From @rneatherway on November 5, 2014 11:25
Copied from original issue: fsprojects/zarchive-fsharpbinding#789
A prototype is at https://github.com/rneatherway/fsharpbinding/commits/xmldocstring
From @rneatherway on November 21, 2014 13:28
Copied from original issue: fsprojects/zarchive-fsharpbinding#842
Linked to #54
I was hoping that a solution has already been identified by @rneatherway or @7sharp9 ??
I am experiencing an auto complete issue in Xamarin Studio when trying to dot into a records property, image explains the issue clearly:
Hi,
i have Suave/Web Service version of this Problem #64 . I have just tested master and FsAutoComplete CLI, work as expected, thus it is no regresion!
Here is web response:
HTTP/1.1 200 OK
Server: Suave/0.32.1.0 (http://suave.io)
Date: Mon, 09 Nov 2015 08:50:41 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 244
["{\"Kind\":\"error\",\"Data\":\"Could not load file or assembly 'Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Das System kann die angegebene Datei nicht finden.\"}"]
Btw. the other way to solve that, other as patching "addMSBuildv14BackupResolution" as in the FsAutoComplete CLI, is to add "FSharp.Compiler.Tools/4.0.0.1" dependencies to release.
Microsoft.Build.dll
Microsoft.Build.Engine.dll
Microsoft.Build.Framework.dll
For completeness the mirror issue from me https://github.com/ionide/ionide-fsharp/issues/176
FsAutoComplete does not seem to work correctly, on Windows 10 (10130), with VS2015 RC, Atom 0.209.0, fsprojects/atom-fsharp 0.5.5.
atom-fsharp installs FsAutoComplete 0.18.0
...\.atom\packages\atom-fsharp\bin>fsautocomplete.exe --version
FSharp.AutoComplete 0.18.0
I experienced issues where FsAutoComplete reported errors in Atom:
I dropped to the console, and ran the following commands:
C:\Users\adamchester\.atom\packages\atom-fsharp\bin>fsautocomplete.exe -v -l=log.txt
parse "whatever.whatever"
let abc = 123
<<EOF>>
INFO: Background parsing started
<<EOF>>
Process is terminated due to StackOverflowException.
C:\Users\adamchester\.atom\packages\atom-fsharp\bin>fsautocomplete.exe -v -l=log.txt
parse "C:\repo\FSharp.Data.SqlClient\build.fsx"
let abc = 123
<<EOF>>
INFO: Background parsing started
<<EOF>>
DATA: errors
[1:0-1:80] ERROR internal error: BuildFrameworkTcImports: no successful import of C:\Users\adamchester\.atom\packages\atom-fsharp\bin\FSharp.Core.dll
[1:0-1:80] ERROR Problem reading assembly 'FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a': Error opening binary file 'C:\Users\adamchester\.atom\packages\atom-fsharp\bin\FSharp.Core.dll': File 'C:\Users\adamchester\.atom\packages\atom-fsharp\bin\FSharp.Core.optdata' not found alongside FSharp.Core
[1:0-1:80] ERROR Error opening binary file 'C:\Users\adamchester\.atom\packages\atom-fsharp\bin\FSharp.Core.dll': File 'C:\Users\adamchester\.atom\packages\atom-fsharp\bin\FSharp.Core.optdata' not found alongside FSharp.Core
[1:0-1:80] ERROR File 'C:\Users\adamchester\.atom\packages\atom-fsharp\bin\FSharp.Core.optdata' not found alongside FSharp.Core
<<EOF>>
I checked what is in the GAC:
C:\Program Files (x86)\Microsoft Visual Studio 14.0>gacutil /l fsharp.core
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.33440
Copyright (c) Microsoft Corporation. All rights reserved.
The Global Assembly Cache contains the following assemblies:
fsharp.core, Version=2.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
fsharp.core, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Number of items = 2
C:\Program Files (x86)\Microsoft Visual Studio 14.0>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.