diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2022-02-17 04:31:35 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2022-02-17 04:31:45 +0100 |
commit | b77c5f11070ecb2ff343aa18b4ea859e6168f16c (patch) | |
tree | c93d347b096ce19556f369428913b697e6aafa00 /autoload/fsharp.vim | |
parent | 2c5af8f89d3e61e04e761c07a1f043b0f35203c6 (diff) | |
download | vim-polyglot-b77c5f11070ecb2ff343aa18b4ea859e6168f16c.tar.gz vim-polyglot-b77c5f11070ecb2ff343aa18b4ea859e6168f16c.zip |
Update
Diffstat (limited to 'autoload/fsharp.vim')
-rw-r--r-- | autoload/fsharp.vim | 53 |
1 files changed, 13 insertions, 40 deletions
diff --git a/autoload/fsharp.vim b/autoload/fsharp.vim index 5d8bb79d..275913cf 100644 --- a/autoload/fsharp.vim +++ b/autoload/fsharp.vim @@ -238,11 +238,7 @@ function! fsharp#loadConfig() endif if !exists('g:fsharp#fsautocomplete_command') - let s:fsac = fnamemodify(s:script_root_dir . "fsac/fsautocomplete.dll", ":p") - let g:fsharp#fsautocomplete_command = - \ ['dotnet', s:fsac, - \ '--background-service-enabled' - \ ] + let g:fsharp#fsautocomplete_command = ['fsautocomplete', '--background-service-enabled'] endif if !exists('g:fsharp#use_recommended_server_config') let g:fsharp#use_recommended_server_config = 1 @@ -283,6 +279,7 @@ function! fsharp#loadConfig() " backend configuration if g:fsharp#backend == 'languageclient-neovim' + let $DOTNET_ROLL_FORWARD='LatestMajor' if !exists('g:LanguageClient_serverCommands') let g:LanguageClient_serverCommands = {} endif @@ -478,8 +475,17 @@ function! fsharp#OnCursorMove() endfunction function! fsharp#showF1Help() - let result = s:f1Help(expand('%:p'), line('.') - 1, col('.') - 1) - echo result + function! s:callback_showF1Help(result) + let result = a:result + if exists('result.result.content') + let content = json_decode(result.result.content) + if exists('content.Data') + let url = 'https://docs.microsoft.com/en-us/dotnet/api/' . substitute(content.Data, '#ctor', '-ctor', 'g') + echo url + endif + endif + endfunction + call s:f1Help(expand('%:p'), line('.') - 1, col('.') - 1, function("s:callback_showF1Help")) endfunction function! s:hover() @@ -505,39 +511,6 @@ function! fsharp#showTooltip() endfunction -" FSAC update utils - -function! s:update_win() - echom "[FSAC] Downloading FSAC. This may take a while..." - let script = s:script_root_dir . "install.ps1" - call system('powershell -ExecutionPolicy Unrestricted ' . script . " update") -endfunction - -function! s:update_unix() - echom "[FSAC] Downloading FSAC. This may take a while..." - let zip = s:script_root_dir . "fsac.zip" - call system( - \ 'curl -fLo ' . zip . ' --create-dirs ' . - \ '"https://github.com/fsharp/FsAutoComplete/releases/latest/download/fsautocomplete.netcore.zip"' - \ ) - if v:shell_error == 0 - call system('unzip -o -d ' . s:script_root_dir . "/fsac " . zip) - call system('find ' . s:script_root_dir . '/fsac' . ' -type f -exec chmod 777 \{\} \;') - echom "[FSAC] Updated FsAutoComplete" - else - echom "[FSAC] Failed to update FsAutoComplete" - endif -endfunction - -function! fsharp#updateFSAC(...) - if has('win32') && !has('win32unix') - call s:update_win() - else - call s:update_unix() - endif -endfunction - - " FSI integration let s:fsi_buffer = -1 |