Skip to content

Commit 2b39050

Browse files
author
Nick Jensen
committed
Respect use_net6 setting on Windows installation
1 parent 7cf0665 commit 2b39050

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

autoload/OmniSharp.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,12 @@ function! OmniSharp#Install(...) abort
429429
let l:logfile = OmniSharp#log#GetLogDir() . '\install.log'
430430
let l:script = shellescape(
431431
\ s:plugin_root_dir . '\installer\omnisharp-manager.ps1')
432+
let l:net6 = g:OmniSharp_server_use_net6 ? '-6' : ''
432433
let l:version_file_location = l:location . '\OmniSharpInstall-version.txt'
433434

434435
let l:command = printf(
435-
\ 'powershell -ExecutionPolicy Bypass -File %s %s -l %s %s',
436-
\ l:script, l:http, l:location, l:version)
436+
\ 'powershell -ExecutionPolicy Bypass -File %s %s %s -l %s %s',
437+
\ l:script, l:http, l:net6, l:location, l:version)
437438
else
438439
let l:logfile = OmniSharp#log#GetLogDir() . '/install.log'
439440
let l:script = shellescape(

installer/omnisharp-manager.ps1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@
55
# Options:
66
# -v | version to use (otherwise use latest)
77
# -l | where to install the server
8+
# -6 | install the net6.0 server version
89
# -u | help / usage info
910
# -H | install the HTTP version of the server
1011

1112
[CmdletBinding()]
1213
param(
1314
[Parameter()][Alias('v')][string]$version,
1415
[Parameter()][Alias('l')][string]$location = "$($Env:USERPROFILE)\.omnisharp\",
16+
[Parameter()][Alias('6')][Switch]$use_net6,
1517
[Parameter()][Alias('u')][Switch]$usage,
1618
[Parameter()][Alias('H')][Switch]$http_check
1719
)
1820

1921
if ($usage) {
20-
Write-Host "usage:" $MyInvocation.MyCommand.Name "[-Hu] [-v version] [-l location]"
22+
Write-Host "usage:" $MyInvocation.MyCommand.Name "[-Hu] [-v version] [-6] [-l location]"
2123
exit
2224
}
2325

@@ -32,6 +34,12 @@ if ([string]::IsNullOrEmpty($version)) {
3234
$version = get_latest_version
3335
}
3436

37+
if ($use_net6) {
38+
$net6 = "-net6.0"
39+
} else {
40+
$net6 = ""
41+
}
42+
3543
if ($http_check) {
3644
$http = ".http"
3745
} else {
@@ -44,7 +52,7 @@ if ([Environment]::Is64BitOperatingSystem) {
4452
$machine = "x86"
4553
}
4654

47-
$url = "https://github.com/OmniSharp/omnisharp-roslyn/releases/download/$($version)/omnisharp$($http)-win-$($machine).zip"
55+
$url = "https://github.com/OmniSharp/omnisharp-roslyn/releases/download/$($version)/omnisharp$($http)-win-$($machine)$($net6).zip"
4856
$out = "$($location)\omnisharp$($http)-win-$($machine).zip"
4957

5058
if (Test-Path -Path $location) {

0 commit comments

Comments
 (0)