fsharp / fsharp/emacs-fsharp-mode

#load in an fsx script breaks FlyCheck and auto-completion

Open
#217 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
215
Forks
65
PR merge metrics
No merged PRs in 30d

Description

### Description

When I add a `#load` directive in order to reference an .fs file from an .fsx script file, it appears that communication with the fsautocomplete process stalls. This happens with the simplest possible files I can make, and reliably happens upon completing the line.

### Repro steps

1. Create 'Simple.fs' as
```fsharp
module Simple

let times2 x = x * 2
```
2. Create 'test.fsx' as
```fsharp
let y = 2
```
Observe that type hints show in the minibuffer and help is available. Completion and tooltips appear if you continue adding to the file.
3. Add a line to 'test.fsx': `#load "./Simple.fs"`
4. Upon completing the line in (3), the FlyCheck modeline indicator gains an asterisk, indicating it is active
![image](https://user-images.githubusercontent.com/12113895/66474115-a6562680-ea5e-11e9-9c73-c1ba9600d8f8.png)

There's no big CPU or RAM consumption. Leaving it for up to 10 minutes does nothing. All FSAC functionality is gone.

### Expected behavior

At the very least, I should still get FSAC functionality within the .fsx file.

Ideally, we'd get FSAC functionality for the functions in the .fs file.

### Actual behavior

Hanging FlyCheck and broken intellisense.

### Known workarounds

Don't use `#load` directives in .fsx scripts.

### Related information

Running on WSL v1, Ubuntu 18.04

I have below:
- A debug log with `(setq fsharp-ac-debug 20)`
- Output of `report-emacs-bug`
- Output of `$ mono --version`
- Output of `$ dotnet --info` (though I don't use this for emacs development)

**FSAC debug log**

> 06:38:28.084582 (fsharp-ac-parse-current-buffer): Parsing "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx"
06:38:28.186749 (fsharp-ac-send-pos-request): typesig "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "let x = 2" 1 1 400
06:38:28.188132 (fsharp-ac-send-pos-request): symboluse "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "let x = 2" 1 1 400
06:38:31.039346 (fsharp-ac--get-msg): {"Kind":"info","Data":"Background parsing started"}
06:38:31.039437 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:31.039465 (fsharp-ac--get-msg): {"Kind":"errors","Data":{"File":"/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx","Errors":[]}}
06:38:31.039533 (fsharp-ac-filter-output): Received ’errors’ message of length 2
06:38:31.041385 (fsharp-ac-send-pos-request): lint "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "let x = 2" 1 1 400
06:38:31.385100 (fsharp-ac--get-msg): {"Kind":"typesig","Data":"let"}
06:38:31.385167 (fsharp-ac-filter-output): Received ’typesig’ message of length 2
06:38:31.412734 (fsharp-ac--get-msg): {"Kind":"info","Data":"No symbol information found"}
06:38:31.412858 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:31.822889 (fsharp-ac--get-msg): {"Kind":"lint","Data":[]}
06:38:31.823048 (fsharp-ac-filter-output): Received ’lint’ message of length 2
06:38:33.663749 (fsharp-ac-parse-current-buffer): Parsing "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx"
06:38:33.702962 (fsharp-ac--get-msg): {"Kind":"info","Data":"Background parsing started"}
06:38:33.703044 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:33.703068 (fsharp-ac--get-msg): {"Kind":"errors","Data":{"File":"/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx","Errors":[]}}
06:38:33.703137 (fsharp-ac-filter-output): Received ’errors’ message of length 2
06:38:33.704817 (fsharp-ac-send-pos-request): lint "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "" 1 1 400
06:38:33.708815 (fsharp-ac--get-msg): {"Kind":"lint","Data":[]}
06:38:33.708908 (fsharp-ac-filter-output): Received ’lint’ message of length 2
06:38:34.840693 (fsharp-ac-send-pos-request): typesig "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "#" 1 2 400
06:38:34.842295 (fsharp-ac-send-pos-request): symboluse "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "#" 1 2 400
06:38:34.845597 (fsharp-ac--get-msg): {"Kind":"info","Data":"Cannot find ident for tooltip"}
06:38:34.845719 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:34.857528 (fsharp-ac--get-msg): {"Kind":"info","Data":"No ident at this location"}
06:38:34.857601 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:34.961887 (fsharp-ac-parse-current-buffer): Parsing "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx"
06:38:34.962797 (fsharp-ac-send-pos-request): completion "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "#l" 1 3 400 filter=StartsWith
06:38:35.006898 (fsharp-ac--get-msg): {"Kind":"info","Data":"Background parsing started"}
06:38:35.006989 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:35.007013 (fsharp-ac--get-msg): {"Kind":"errors","Data":{"File":"/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx","Errors":[]}}
06:38:35.007078 (fsharp-ac-filter-output): Received ’errors’ message of length 2
06:38:35.076259 (fsharp-ac--get-msg): {"Kind":"completion","Data":[]}
06:38:35.076328 (fsharp-ac-filter-output): Received ’completion’ message of length 2
06:38:35.141957 (fsharp-ac-send-pos-request): completion "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "#lo" 1 4 400 filter=StartsWith
06:38:35.144461 (fsharp-ac--get-msg): {"Kind":"completion","Data":[]}
06:38:35.144525 (fsharp-ac-filter-output): Received ’completion’ message of length 2
06:38:35.231184 (fsharp-ac-send-pos-request): typesig "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "#lo" 1 4 400
06:38:35.232580 (fsharp-ac-send-pos-request): symboluse "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "#lo" 1 4 400
06:38:35.235396 (fsharp-ac--get-msg): {"Kind":"info","Data":"Cannot find ident for tooltip"}
06:38:35.235579 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:35.238238 (fsharp-ac--get-msg): {"Kind":"info","Data":"No ident at this location"}
06:38:35.238327 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:35.249234 (fsharp-ac-send-pos-request): completion "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "#loa" 1 5 400 filter=StartsWith
06:38:35.251938 (fsharp-ac--get-msg): {"Kind":"completion","Data":[]}
06:38:35.252020 (fsharp-ac-filter-output): Received ’completion’ message of length 2
06:38:35.338925 (fsharp-ac-send-pos-request): typesig "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "#loa" 1 5 400
06:38:35.340748 (fsharp-ac-send-pos-request): symboluse "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "#loa" 1 5 400
06:38:35.343140 (fsharp-ac--get-msg): {"Kind":"info","Data":"Cannot find ident for tooltip"}
06:38:35.343212 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:35.356092 (fsharp-ac--get-msg): {"Kind":"info","Data":"No ident at this location"}
06:38:35.356188 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:35.406385 (fsharp-ac-send-pos-request): completion "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "#load" 1 6 400 filter=StartsWith
06:38:35.408671 (fsharp-ac--get-msg): {"Kind":"completion","Data":[]}
06:38:35.408738 (fsharp-ac-filter-output): Received ’completion’ message of length 2
06:38:35.496985 (fsharp-ac-send-pos-request): typesig "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "#load" 1 6 400
06:38:35.498416 (fsharp-ac-send-pos-request): symboluse "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "#load" 1 6 400
06:38:35.500435 (fsharp-ac--get-msg): {"Kind":"info","Data":"Cannot find ident for tooltip"}
06:38:35.500527 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:35.521382 (fsharp-ac--get-msg): {"Kind":"info","Data":"No ident at this location"}
06:38:35.521471 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:35.896975 (fsharp-ac-parse-current-buffer): Parsing "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx"
06:38:36.030698 (fsharp-ac--get-msg): {"Kind":"info","Data":"Background parsing started"}
06:38:36.030833 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:36.030918 (fsharp-ac--get-msg): {"Kind":"errors","Data":{"File":"/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx","Errors":[{"FileName":"/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx","StartLine":1,"EndLine":2,"StartColumn":1,"EndColumn":1,"Severity":"Error","Message":"Invalid directive. Expected '#load \"\" ... \"\"'.","Subcategory":"parse"},{"FileName":"/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx","StartLine":1,"EndLine":2,"StartColumn":1,"EndColumn":1,"Severity":"Error","Message":"Invalid directive. Expected '#load \"\" ... \"\"'.","Subcategory":"parse"}]}}
06:38:36.031822 (fsharp-ac-filter-output): Received ’errors’ message of length 2
06:38:42.054124 (fsharp-ac-parse-current-buffer): Parsing "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx"
06:38:42.291198 (fsharp-ac--get-msg): {"Kind":"info","Data":"Background parsing started"}
06:38:42.291321 (fsharp-ac-filter-output): Received ’info’ message of length 2
06:38:42.291346 (fsharp-ac--get-msg): {"Kind":"errors","Data":{"File":"/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx","Errors":[]}}
06:38:42.291439 (fsharp-ac-filter-output): Received ’errors’ message of length 2
06:38:42.293685 (fsharp-ac-send-pos-request): lint "/mnt/c/Users/g/OneDrive/code/antifound.com/test2.fsx" "#load \"./Simple.fs\"" 1 20 400
06:38:42.295485 (fsharp-ac--get-msg): {"Kind":"info","Data":"Cached typecheck results not yet available"}
06:38:42.295555 (fsharp-ac-filter-output): Received ’info’ message of length 2

**report-emacs-bug**

> In GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21)
of 2017-09-22, modified by Debian built on lgw01-amd64-050
Windowing system distributor 'HC-Consult', version 11.0.12005001
System Description: Ubuntu 18.04.3 LTS

> Configured using:
'configure --build x86_64-linux-gnu --prefix=/usr
--sharedstatedir=/var/lib --libexecdir=/usr/lib
--localstatedir=/var/lib --infodir=/usr/share/info
--mandir=/usr/share/man --with-pop=yes
--enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp
--with-sound=alsa --without-gconf --build x86_64-linux-gnu
--prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib
--localstatedir=/var/lib --infodir=/usr/share/info
--mandir=/usr/share/man --with-pop=yes
--enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp
--with-sound=alsa --without-gconf --with-x=yes --with-x-toolkit=gtk3
--with-toolkit-scroll-bars 'CFLAGS=-g -O2
-fdebug-prefix-map=/build/emacs25-jYekUr/emacs25-25.2+1=. -fstack-protector-strong
-Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
-D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

> Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

> Important settings:
value of $LANG: C.UTF-8
locale-coding-system: utf-8-unix

> Major mode: Lisp Interaction

> Minor modes in effect:
elisp-slime-nav-mode: t
global-company-mode: t
company-mode: t
global-magit-file-mode: t
diff-auto-refine-mode: t
magit-auto-revert-mode: t
global-git-commit-mode: t
async-bytecomp-package-mode: t
ido-everywhere: t
evil-leader-mode: t
global-undo-tree-mode: t
undo-tree-mode: t
shell-dirtrack-mode: t
evil-mode: t
evil-local-mode: t
override-global-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t

> Recent messages:
, r is undefined
let
Auto-saving...done
Mark set
Replaced 29 occurrences [2 times]
Mark set
Making completion list... [2 times]

> Load-path shadows:
/usr/share/emacs/25.2/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/home/ggb/.emacs.d/elpa/seq-2.20/seq hides /usr/share/emacs/25.2/lisp/emacs-lisp/seq

> Features:
(shadow sort mail-extr emacsbug sendmail vc-git company-quickhelp
pos-tip fsharp-mode-font fsharp-mode-indent info-look markdown-mode
url-parse url-vars fsharp-mode fsharp-mode-indent-smie smie
inf-fsharp-mode fsharp-doc flycheck-fsharp flycheck find-func
fsharp-mode-completion rx fsharp-mode-util elpy find-file-in-project ivy
delsel colir color ivy-overlay elpy-rpc pyvenv esh-var esh-io esh-cmd
esh-opt esh-ext esh-proc esh-arg esh-groups eshell esh-module esh-mode
esh-util elpy-shell elpy-profile elpy-django s elpy-refactor python
tramp-sh tramp tramp-compat auth-source tramp-loaddefs trampver
ucs-normalize json map grep files-x cus-edit cus-start cus-load wid-edit
ac-geiser geiser paredit elisp-slime-nav slime-fancy slime-trace-dialog
slime-fontifying-fu slime-package-fu slime-references
slime-compiler-notes-tree slime-scratch slime-presentations bridge
slime-macrostep macrostep slime-mdot-fu slime-enclosing-context
slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c
slime-editing-commands slime-autodoc slime-repl elp slime-parse slime
derived lisp-mnt gud apropos compile arc-mode archive-mode noutline
outline pp hyperspec browse-url cl slime-autoloads company-oddmuse
company-keywords company-etags etags xref project company-gtags
company-dabbrev-code company-dabbrev company-files company-capf
company-cmake company-xcode company-clang company-semantic company-eclim
company-template company-css company-nxml company-bbdb company
auto-complete popup evil-magit magit-submodule magit-obsolete
magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull
magit-fetch magit-clone magit-remote magit-commit magit-sequence
magit-notes magit-worktree magit-tag magit-merge magit-branch
magit-reset magit-files magit-refs magit-status magit magit-repos
magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode
diff-mode magit-core magit-autorevert autorevert filenotify magit-margin
magit-transient magit-process magit-mode transient git-commit magit-git
magit-section eieio eieio-core magit-utils crm log-edit message dired
format-spec rfc822 mml mml-sec password-cache epg gnus-util time-date
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util help-fns mail-prsvr mailabbrev mail-utils gmm-utils
mailheader pcvs-util add-log with-editor async-bytecomp async server
dash ace-window subr-x avy yasnippet ido key-chord evil-leader evil
evil-keybindings evil-integration undo-tree diff evil-maps evil-commands
reveal flyspell ispell evil-jumps evil-command-window evil-types
evil-search evil-ex shell pcomplete comint ansi-color evil-macros
evil-repeat evil-states evil-core advice evil-common windmove thingatpt
rect evil-digraphs evil-vars ring edmacro kmacro cl-macs cl-seq
use-package use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core finder-inf
info parse-time package epg-config seq byte-opt gv bytecomp byte-compile
cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

> Memory information:
((conses 16 636156 61783)
(symbols 48 51232 0)
(miscs 40 122 683)
(strings 32 143710 18327)
(string-bytes 1 4129390)
(vectors 16 73177)
(vector-slots 8 1116938 19206)
(floats 8 783 273)
(intervals 56 1623 358)
(buffers 976 27))

**Mono version**
```
Mono JIT compiler version 6.0.0.334 (tarball Thu Sep 12 21:34:14 UTC 2019) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: yes(600)
Suspend: hybrid
GC: sgen (concurrent by default)
```

**dotnet core version**
```
.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26

Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/3.0.100/

Host (useful for support):
Version: 3.0.0
Commit: 95a0a61858

.NET Core SDKs installed:
3.0.100 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.