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

Split fsiextraparameters for fsac #83

Merged
merged 4 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -382,14 +382,31 @@ let g:fsharp#use_sdk_scripts = 0 " for net462 FSI

##### Set additional runtime arguments passed to FSI

*Default:* empty
*Default:* `--readline-`

Sets additional arguments of the FSI instance Ionide-vim spawns and changes the behavior of FSAC accordingly when editing fsx files.
FSAC passes parameters on to the compiler for static analysis of script files.
Not all parameters are shared between the compiler and interpreter, so FSAC splits these into
1. `FSIExtraInteractiveParameters`: specifically for use with the interpreter process
2. `FSIExtraSharedParameters`: those parameters which should be passed both to the interactive interpreter *and* the compiler

Ionide-vim will pass all options from both of these parameters to the interpreter launched by `fsharp#fsi_command`

~~~.vim
let g:fsharp#fsi_extra_parameters = ['--langversion:preview']
let g:fsharp#fsi_extra_interactive_parameters = ['--readline-']
let g:fsharp#fsi_extra_shared_parameters = ['--langversion:preview']
~~~

There is a legacy option that is still supported by Ionide-vim and FSAC, `FSIExtraParameters`, that will be deprecated upstream in the future.
This is a single option that combines the functionality of both mentioned above.
Using interactive-only parameters in this option yields compiler errors.
[See more discussion in the issue for FSAC](https://github.com/Ionide/fsautocomplete/issues/1210).

It is recommended to migrate configuration to the new parameters.
If you are currently using `FSIExtraParameters`, simply copying the options to `FSIExtraSharedParameters` will preserve all current behavior.

Unti

##### Customize how FSI window is opened

*Default:* `botright 10new`
Expand Down
15 changes: 13 additions & 2 deletions autoload/fsharp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ let s:config_keys_camel =
\ {'key': 'LineLens', 'default': {'enabled': 'never', 'prefix': ''}},
\ {'key': 'UseSdkScripts', 'default': 1},
\ {'key': 'dotNetRoot'},
\ {'key': 'fsiExtraParameters', 'default': []},
\ {'key': 'fsiExtraParameters'},
\ {'key': 'fsiExtraInteractiveParameters', 'default': ['--readline-']},
\ {'key': 'fsiExtraSharedParameters', 'default': []},
\ {'key': 'fsiCompilerToolLocations', 'default': []},
\ {'key': 'TooltipMode', 'default': 'full'},
\ {'key': 'GenerateBinlog', 'default': 0},
Expand Down Expand Up @@ -554,7 +556,16 @@ endfunction

function! s:get_fsi_command()
let cmd = g:fsharp#fsi_command
for prm in g:fsharp#fsi_extra_parameters
if exists("g:fsharp#fsi_extra_parameters")
echom "[Ionide-vim]: `g:fsharp#fsi_extra_parameters` is being deprecated. Migrate to `g:fsharp#fsi_extra_interactive_parameters` and `g:fsharp_extra_shared_parameters`."
for prm in g:fsharp#fsi_extra_parameters
let cmd = cmd . " " . prm
endfor
endif
for prm in g:fsharp#fsi_extra_interactive_parameters
let cmd = cmd . " " . prm
endfor
for prm in g:fsharp#fsi_extra_shared_parameters
let cmd = cmd . " " . prm
endfor
return cmd
Expand Down