Giter Site home page Giter Site logo

Comments (12)

mavnn avatar mavnn commented on July 3, 2024

Hi @rneatherway ,
sorry to swap venues but I don't really want to spam the whole mailing list!

My debug log for the above fsx file looks like this:

LanguageService: GetScriptCheckerOptions: Creating for stand-alone file or script: 'c:\rip\SddConf.Properties\Serialization.fsx'

LanguageService: ParseAndCheckFileInProject: Trigger parse (fileName=c:\rip\SddConf.Properties\Serialization.fsx)

LanguageService agent: Dequeued request 0 remaining

LanguageService agent: start parsing - c:\rip\SddConf.Properties\Serialization.fsx

LanguageService: GetScriptCheckerOptions: Creating for stand-alone file or script: 'c:\rip\SddConf.Properties\Serialization.fsx'

LanguageService agent: parse completed

LanguageService agent: Typecheck source...

LanguageService: Parsing: Get typed parse result, fileName=c:\rip\SddConf.Properties\Serialization.fsx

LanguageService: Not using stale results - trying typecheck with timeout

LanguageService: GetScriptCheckerOptions: Creating for stand-alone file or script: 'c:\rip\SddConf.Properties\Serialization.fsx'

LanguageService agent: Typecheck completed

LanguageService agent: Update typed info - HasFullTypeCheckInfo? true

LanguageService agent: Awaiting request

LanguageService agent: Dequeued request 0 remaining

LanguageService agent: start parsing - c:\rip\SddConf.Properties\Serialization.fsx

LanguageService: Starting background compilations

LanguageService agent: parse completed

LanguageService agent: Typecheck source...

LanguageService: Parsing: Get typed parse result, fileName=c:\rip\SddConf.Properties\Serialization.fsx

LanguageService: Parsing: using stale results

Result: Crack symbol text at column 0
Identifier: [""]
Line string: #r "packages/FParsec/lib/net40-client/FParsecCS.dll"

LanguageService: GetScriptCheckerOptions: Creating for stand-alone file or script: 'c:\rip\SddConf.Properties\Serialization.fsx'

LanguageService agent: Typecheck completed

LanguageService agent: Update typed info - HasFullTypeCheckInfo? true

LanguageService agent: Awaiting request

LanguageService: Parsing: Get typed parse result, fileName=c:\rip\SddConf.Properties\Serialization.fsx

LanguageService: Parsing: using stale results

Result

Nothing obvious looking so I'll try and turn on the debug attribute in Emacs.

from zarchive-fsharpbinding.

mavnn avatar mavnn commented on July 3, 2024

And the debug log looks like this:

1431355373.887: Parsing "c:/rip/SddConf.Properties/Enterprise.fsx"
1431355373.887: tooltip "c:/rip/SddConf.Properties/Enterprise.fsx" 1 0 400
1431355374.058: {"Kind":"INFO","Data":"Background parsing started"}

1431355374.058: Received 'INFO' message of length 65
1431355374.463: tooltip "c:/rip/SddConf.Properties/Enterprise.fsx" 3 0 400
1431355375.509: tooltip "c:/rip/SddConf.Properties/Enterprise.fsx" 1 0 400
1431355376.015: {"Kind":"ERROR","Data":"Timeout when fetching typed parse result"}

1431355376.015: Received 'ERROR' message of length 65
1431355377.399: {"Kind":"errors","Data":[{"StartLine":0,"StartLineAlternate":1,"EndLine":0,"EndLineAlternate":1,"StartColumn":0,"EndColumn":80,"Severity":"Error","Message":"The module/namespace 'System.Runtime.CompilerServices' from compilation unit 'mscorlib' did not contain the namespace, module or type 'ExtensionAttribute'","Subcategory":"typecheck","FileName":"c:\\rip\\SddConf.Properties\\Enterprise.fsx"},{"StartLine":27,"StartLineAlternate":28,"EndLine":27,"EndLineAlternate":28,"StartColumn":4,"EndColumn":21,"Severity":"Warning","Message":"This expression should have type 'unit', but has type 'string'. Use 'ignore' to discard the result of the expression, or 'let' to bind the result to a name.","Subcategory":"typecheck","FileName":"c:\\rip\\SddConf.Properties\\Enterprise.fsx"}]}

1431355377.399: Received 'errors' message of length 65
1431355377.401: {"Kind":"INFO","Data":"No tooltip information"}

1431355377.401: Received 'INFO' message of length 65
1431355377.491: {"Kind":"INFO","Data":"No tooltip information"}

1431355377.491: Received 'INFO' message of length 65

from zarchive-fsharpbinding.

rneatherway avatar rneatherway commented on July 3, 2024

Thanks, could you uncomment LanguageService.fs:319-320 and rerun the first debug session?

from zarchive-fsharpbinding.

mavnn avatar mavnn commented on July 3, 2024
LanguageService: GetScriptCheckerOptions: Creating for stand-alone file or script: 'c:\rip\SddConf.Properties\Serialization.fsx'

GetScriptCheckerOptions: ProjectFileName: c:\rip\SddConf.Properties\Serialization.fsx.fsproj, ProjectFileNames: [|"c:\rip\SddConf.Properties\paket-files\xyncro\chiron\src\Chiron\Chiron.fs";
  "c:\rip\SddConf.Properties\Serialization.fsx"|], ProjectOptions: [|"--noframework"; "--warn:3";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Numerics.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Runtime.Remoting.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Runtime.Serialization.Formatters.Soap.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Drawing.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Services.dll";
  "-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Windows.Forms.dll";
  "-r:C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\FSharp.Compiler.Interactive.Settings.dll";
  "-r:c:\rip\SddConf.Properties\packages/FsCheck/lib/net45/FsCheck

from zarchive-fsharpbinding.

mavnn avatar mavnn commented on July 3, 2024

Looks like this:

"-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll"

should be

"-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll"

on my system (or even 4.5.1)

from zarchive-fsharpbinding.

rneatherway avatar rneatherway commented on July 3, 2024

OK, so this is coming direct from FSharp.Compiler.Service. How have you configured fsi.exe to be launched, or what is the value of the variable inferior-fsharp-program?

from zarchive-fsharpbinding.

mavnn avatar mavnn commented on July 3, 2024
inferior-fsharp-program is a variable defined in `inf-fsharp-mode.el'.
Its value is
"\"c:/Program Files (x86)/Microsoft SDKs/F#/3.1/Framework/v4.0/fsi.exe\""

  This variable may be risky if used as a file-local variable.

Documentation:
*Program name for invoking an inferior fsharp from Emacs.

from zarchive-fsharpbinding.

mavnn avatar mavnn commented on July 3, 2024

It should be noted that evaluating the file in inferior-fsharp works without error.

from zarchive-fsharpbinding.

rneatherway avatar rneatherway commented on July 3, 2024

I think this is an FCS bug. I would proceed by making a repro using just FCS, you can call it as described here: http://fsharp.github.io/FSharp.Compiler.Service/editor.html

The skeleton will look like this:

// Reference F# compiler API
#r "FSharp.Compiler.Service.dll"

open System
open Microsoft.FSharp.Compiler.SourceCodeServices

// Create an interactive checker instance 
let checker = FSharpChecker.Create()

let projOptions = 
    checker.GetProjectOptionsFromScript(file, input)
    |> Async.RunSynchronously

let parseResults2, checkFileAnswer2 = 
    checker.ParseAndCheckFileInProject(file, 0, input, projOptions) 
    |> Async.RunSynchronously

from zarchive-fsharpbinding.

mavnn avatar mavnn commented on July 3, 2024

Thanks Robin, I'll try and do that. In the short term, is there any way of sending a framework version from Emacs?

from zarchive-fsharpbinding.

rneatherway avatar rneatherway commented on July 3, 2024

I'm sorry, there isn't. My earlier comment about the framework version was mistaken -- the framework is only used in the case that FCS doesn't tell us which FSharp.Core to use (LanguageService line 308). Unless I'm mistaken we are really just at the mercy of FCS here.

from zarchive-fsharpbinding.

rneatherway avatar rneatherway commented on July 3, 2024

This issue was moved to fsharp/emacs-fsharp-mode#15

from zarchive-fsharpbinding.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.