Skip to content

Commit

Permalink
Merge pull request #83 from greggyb/split-fsiextraparameters-for-fsac
Browse files Browse the repository at this point in the history
Split fsiextraparameters for fsac
  • Loading branch information
cannorin authored May 24, 2024
2 parents 1965d5d + fb146db commit 00099c3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
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

0 comments on commit 00099c3

Please sign in to comment.