Skip to content
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

Unable to get any autocomplete when opening fsx files #75

Closed
grab-a-byte opened this issue Aug 21, 2023 · 7 comments
Closed

Unable to get any autocomplete when opening fsx files #75

grab-a-byte opened this issue Aug 21, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@grab-a-byte
Copy link

Describe the bug
I have followed the guide and installed fsautocomplete globally and also installed the plugin. My init.vim file looks like the following.

call plug#begin()
Plug 'ThePrimeagen/vim-be-good'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'deoplete-plugins/deoplete-lsp'
Plug 'ionide/Ionide-vim'
Plug 'vim-airline/vim-airline'
call plug#end()

set number
set relativenumber

To Reproduce
Steps to reproduce the behaviour:

  1. Fresh install of neovim.
  2. run dotnet tool install -g fsautocomplete
  3. Add the above contents to the init.vim file (found in "C:\Users\USER\AppData\Local\nvim\init.vim" on windows)
  4. open a fsx file and try and type something and get intellisence/autocomplete.

Expected behaviour
Expect a popup with some sort of autocomplete suggestion.

Screenshots
image
No Autocomplete suggestions at all

Environment (please complete the following information):

  • OS: Windows 11 22H2 - Build 22621.2134
  • Vim / Neovim version: Neovim v0.9.1
  • dotnet SDK version: 7.0.400-preview.23274.1
  • mono / .Net Framework version: N/A

Additional context
Apologies if I have missed something or not understood. I am new to Neovim and trying to learn it and though F# being my favorite language I don't get a chance to use, i'd use it to try and learn some Neovim for fun so apologies of the question is obvious and I've missed something very clear.

@grab-a-byte grab-a-byte added the bug Something isn't working label Aug 21, 2023
@cannorin
Copy link
Member

I guess it is caused by either Ionide-vim not recognizing fsx as a workspace marker, or FSAC not supposed to work with a single fsx (I don't remember if it is really the case).

For a workaround, creating an empty F# project in the same directory through dotnet new console -lang:F# -o . may help.

@baronfel
Copy link

FSAC does support loose loose fsx scripts (the compiler tooling interprets them as projects with a single source file and a standard set of project options).

@baronfel
Copy link

Is there a language association set up for fsx files (as opposed to fs files)?

@cannorin
Copy link
Member

@grab-a-byte
Copy link
Author

Hi there, I've tried it with a FsProj from dotnet new console as shown here
image

Still Not getting any suggestions as seen in this screenshot.
image

Does appear to be working a bit more however based on the fact that in normal mode I seem to be getting more information.
image

Any further suggestions?

@grab-a-byte
Copy link
Author

Strangely enough doing this with VimPlug didnt seem to work but added via Mason with kickstart.nvim and it's workign now. Thanks for the suggestion. Any way i'd be able to make this work for standalone fsx files? Happy to close this for now however.

@niontrix
Copy link

niontrix commented Feb 19, 2024

Hi guys,
I know this is already closed, but I recently stumbled upon the same issue, that ionide is not activating a workspace and launching fsac when opening an .fsx file. I had a look at https://github.com/ionide/Ionide-vim/blob/master/lua/ionide/init.lua#L45-L47 and I think @cannorin is right. The rootMarkers list does not contain fsx, but if you simply create a git repository in the same folder it also works.
Maybe we could add fsx to the list explicitly, which would make for a better UX, imo.
Maybe I will create a PR.

greggyb added a commit to greggyb/Ionide-vim that referenced this issue May 18, 2024
Per discussion in ionide#75, the LSP server is not started when opening a bare
.fsx file (not in a directory with a git repo, project, or solution
file), at least with some installations and setups.

Add wildcard pattern to match a root directory when it contains any
"*.fsx" files, which, tautologically, and script file will match. Tested
that this does start the server automatically for bare script files.
cannorin added a commit that referenced this issue May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants