fsharp / emacs-fsharp-mode

F# Emacs mode
Apache License 2.0
208 stars 62 forks source link

Autocomplete is not working #235

Open anquegi opened 4 years ago

anquegi commented 4 years ago

Description

I get this error on messages:

Company: An error occurred in auto-begin Company: backend company-capf error "jsonrpc-error: "request id=17 failed:", (jsonrpc-error-code . -32603), (jsonrpc-error-message . "no type check results"), (jsonrpc-error-data)" with args (candidates Newt)

Repro steps

THis is my configuration, I'm using MAC OS X catalina and dotnet 3.1

;;; my-fsharp.el --- fsharp configuration -- lexical-binding: t; -- ;;; Commentary: ;; ;;; Code: (use-package fsharp-mode :defer t :ensure t) (add-to-list 'auto-mode-alist '("\.fs[iylx]?$" . fsharp-mode))

(require 'eglot-fsharp)

(setq inferior-fsharp-program "dotnet fsi")

(require 'dotnet) (add-hook 'fsharp-mode-hook 'dotnet-mode)

(provide 'my-fsharp)

;;; my-fsharp.el ends here

Expected behavior

After M-x eglot, it start well ,

[eglot] Connected! Server EGLOT (FSNetCore/fsharp-mode)' now managingfsharp-mode' buffers in project `FSNetCore'.

I'm creating the project from here https://docs.microsoft.com/es-es/dotnet/fsharp/get-started/get-started-command-line

Actual behavior

but then start error with autocomplete

Related information

Mac os catalina 10.15.2 learn/functional-programming/FSNetCore via .NET 3.1.100 ➜ dotnet --version 3.1.100

27

juergenhoetzel commented 4 years ago

Did you restore your project: dotnet restore?

Could you provide the content of your *EGLOT (PROJECT_NAME/fsharp-mode) events* buffer?

anquegi commented 4 years ago

Thanks for the quick reply. after restoring it worked better. but I get the error in this file

module Library

open Newtonsoft.Json

let getJsonNetJson value = sprintf "I used to be %s but now I'm %s thanks to JSON.NET!" value (JsonConvert.SerializeObject(value))

Getting this error in messages.


Company: An error occurred in auto-begin
Company: backend company-capf error "jsonrpc-error: "request id=5 failed:", (jsonrpc-error-code . -32603), (jsonrpc-error-message . "no type check results"), (jsonrpc-error-data)" with args (candidates mod)
No completion found
[eglot] val sprintf: 
(...truncated. Full help is in `*eglot-help for sprintf*')
[eglot] val sprintf: 
(...truncated. Full help is in `*eglot-help for sprintf*')
Mark set
Auto-saving...done
[eglot] type JsonConvert
(...truncated. Full help is in `*eglot-help for JsonConvert*')
[eglot] JsonConvert.SerializeObject(value: obj) : string
(...truncated. Full help is in `*eglot-help for value*')
A

The buffer you mentioned is attached in a file eglot-events-buffer.txt :

juergenhoetzel commented 4 years ago

I can reproduce the issue. Adding -v to the fsautocomplete.dll parameters reveals:

[Checker] ParseAndCheckFileInProject - /home/juergen/fsharp/FSNetCore/src/Library/Library.fs completed with errors [unknown (1,1)-(1,1) parameter error Assembly reference 'mscorlib.dll' was not found or is invalid

Related Ionideissue: https://github.com/ionide/ionide-vscode-fsharp/issues/398

serezlan commented 2 years ago

Hello,

I'm experiencing this problem as well. I have restore my project and use the latest package. Please advice.

serezlan commented 2 years ago

Attached is my eglot buffer output eglot.txt