Skip to content

Commit

Permalink
Update to rider 2024.2.0-eap08
Browse files Browse the repository at this point in the history
  • Loading branch information
Socolin committed Jul 26, 2024
1 parent 5b92096 commit edaf772
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 192 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 2024.2.0 - 2024-07-25
- Rider 2024.2-EAP9-SNAPSHOT

## 2024.1.0 - 2024-03-21
- Rider 2023.3-EAP9-SNAPSHOT

Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import org.apache.tools.ant.taskdefs.condition.Os
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.8.22'
id 'org.jetbrains.intellij' version '1.13.3' // https://github.com/JetBrains/gradle-intellij-plugin/releases
id 'com.jetbrains.rdgen' version '2024.1.1' // https://github.com/JetBrains/rd/releases
id 'org.jetbrains.intellij' version '1.17.4' // https://github.com/JetBrains/gradle-intellij-plugin/releases
id 'com.jetbrains.rdgen' version '2024.1.1' // https://github.com/JetBrains/rd/releases
}

ext {
Expand Down Expand Up @@ -37,7 +37,7 @@ sourceSets {
}

compileKotlin {
kotlinOptions { jvmTarget = "1.8" }
kotlinOptions { jvmTarget = "17" }
}

task setBuildTool {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
DotnetPluginId=ReSharperPlugin.NSubstituteComplete
DotnetSolution=NSubstituteComplete.sln
RiderPluginId=nsubstitutecomplete
PluginVersion=2024.1.2
PluginVersion=2024.2.0

BuildConfiguration=Release
PublishToken="_PLACE_HOLDER_"
Expand All @@ -13,7 +13,7 @@ PublishToken="_PLACE_HOLDER_"
# 2020.1.0-SNAPSHOT
# 2020.1.0-EAP2-SNAPSHOT
# 2020.1.0
ProductVersion=2024.1
ProductVersion=2024.2-EAP8-SNAPSHOT

# Kotlin 1.4 will bundle the stdlib dependency by default, causing problems with the version bundled with the IDE
# https://blog.jetbrains.com/kotlin/2020/07/kotlin-1-4-rc-released/#stdlib-default
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://cache-redirector.jetbrains.com/services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://cache-redirector.jetbrains.com/services.gradle.org/distributions/gradle-8.5-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
122 changes: 18 additions & 104 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -117,97 +115,6 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# GRADLE JVM WRAPPER START MARKER
BUILD_DIR="${HOME}/.local/share/gradle-jvm"
JVM_ARCH=$(uname -m)
JVM_TEMP_FILE=$BUILD_DIR/gradle-jvm-temp.tar.gz
if [ "$darwin" = "true" ]; then
case $JVM_ARCH in
x86_64)
JVM_URL=https://download.oracle.com/java/17/archive/jdk-17.0.3.1_macos-x64_bin.tar.gz
JVM_TARGET_DIR=$BUILD_DIR/jdk-17.0.3.1_macos-x64_bin-1bcf03
;;
arm64)
JVM_URL=https://download.oracle.com/java/17/archive/jdk-17.0.3.1_macos-aarch64_bin.tar.gz
JVM_TARGET_DIR=$BUILD_DIR/jdk-17.0.3.1_macos-aarch64_bin-297fa2
;;
*)
die "Unknown architecture $JVM_ARCH"
;;
esac
elif [ "$cygwin" = "true" ] || [ "$msys" = "true" ]; then
JVM_URL=https://download.oracle.com/java/17/archive/jdk-17.0.3.1_windows-x64_bin.zip
JVM_TARGET_DIR=$BUILD_DIR/jdk-17.0.3.1_windows-x64_bin-d6ede5
else
JVM_ARCH=$(linux$(getconf LONG_BIT) uname -m)
case $JVM_ARCH in
x86_64)
JVM_URL=https://download.oracle.com/java/17/archive/jdk-17.0.3.1_linux-x64_bin.tar.gz
JVM_TARGET_DIR=$BUILD_DIR/jdk-17.0.3.1_linux-x64_bin-9324ae
;;
aarch64)
JVM_URL=https://download.oracle.com/java/17/archive/jdk-17.0.3.1_linux-aarch64_bin.tar.gz
JVM_TARGET_DIR=$BUILD_DIR/jdk-17.0.3.1_linux-aarch64_bin-319da6
;;
*)
die "Unknown architecture $JVM_ARCH"
;;
esac
fi

set -e

if [ -e "$JVM_TARGET_DIR/.flag" ] && [ -n "$(ls "$JVM_TARGET_DIR")" ] && [ "x$(cat "$JVM_TARGET_DIR/.flag")" = "x${JVM_URL}" ]; then
# Everything is up-to-date in $JVM_TARGET_DIR, do nothing
true
else
echo "Downloading $JVM_URL to $JVM_TEMP_FILE"

rm -f "$JVM_TEMP_FILE"
mkdir -p "$BUILD_DIR"
if command -v curl >/dev/null 2>&1; then
if [ -t 1 ]; then CURL_PROGRESS="--progress-bar"; else CURL_PROGRESS="--silent --show-error"; fi
# shellcheck disable=SC2086
curl $CURL_PROGRESS -L --output "${JVM_TEMP_FILE}" "$JVM_URL" 2>&1
elif command -v wget >/dev/null 2>&1; then
if [ -t 1 ]; then WGET_PROGRESS=""; else WGET_PROGRESS="-nv"; fi
wget $WGET_PROGRESS -O "${JVM_TEMP_FILE}" "$JVM_URL" 2>&1
else
die "ERROR: Please install wget or curl"
fi

echo "Extracting $JVM_TEMP_FILE to $JVM_TARGET_DIR"
rm -rf "$JVM_TARGET_DIR"
mkdir -p "$JVM_TARGET_DIR"

case "$JVM_URL" in
*".zip") unzip "$JVM_TEMP_FILE" -d "$JVM_TARGET_DIR" ;;
*) tar -x -f "$JVM_TEMP_FILE" -C "$JVM_TARGET_DIR" ;;
esac

rm -f "$JVM_TEMP_FILE"

echo "$JVM_URL" >"$JVM_TARGET_DIR/.flag"
fi

JAVA_HOME=
for d in "$JVM_TARGET_DIR" "$JVM_TARGET_DIR"/* "$JVM_TARGET_DIR"/Contents/Home "$JVM_TARGET_DIR"/*/Contents/Home; do
if [ -e "$d/bin/java" ]; then
JAVA_HOME="$d"
fi
done

if [ '!' -e "$JAVA_HOME/bin/java" ]; then
die "Unable to find bin/java under $JVM_TARGET_DIR"
fi

# Make it available for child processes
export JAVA_HOME

set +e

# GRADLE JVM WRAPPER END MARKER

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand All @@ -224,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -288,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down Expand Up @@ -332,4 +246,4 @@ eval "set -- $(
tr '\n' ' '
)" '"$@"'

exec "$JAVACMD" "$@"
exec "$JAVACMD" "$@"
78 changes: 1 addition & 77 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -36,82 +36,6 @@ for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem GRADLE JVM WRAPPER START MARKER

setlocal
set BUILD_DIR=%LOCALAPPDATA%\gradle-jvm
set JVM_TARGET_DIR=%BUILD_DIR%\jdk-17.0.3.1_windows-x64_bin-d6ede5\

set JVM_URL=https://download.oracle.com/java/17/archive/jdk-17.0.3.1_windows-x64_bin.zip

set IS_TAR_GZ=0
set JVM_TEMP_FILE=gradle-jvm.zip

if /I "%JVM_URL:~-7%"==".tar.gz" (
set IS_TAR_GZ=1
set JVM_TEMP_FILE=gradle-jvm.tar.gz
)

set POWERSHELL=%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

if not exist "%JVM_TARGET_DIR%" MD "%JVM_TARGET_DIR%"

if not exist "%JVM_TARGET_DIR%.flag" goto downloadAndExtractJvm

set /p CURRENT_FLAG=<"%JVM_TARGET_DIR%.flag"
if "%CURRENT_FLAG%" == "%JVM_URL%" goto continueWithJvm

:downloadAndExtractJvm

PUSHD "%BUILD_DIR%"
if errorlevel 1 goto fail

echo Downloading %JVM_URL% to %BUILD_DIR%\%JVM_TEMP_FILE%
if exist "%JVM_TEMP_FILE%" DEL /F "%JVM_TEMP_FILE%"
"%POWERSHELL%" -nologo -noprofile -Command "Set-StrictMode -Version 3.0; $ErrorActionPreference = \"Stop\"; (New-Object Net.WebClient).DownloadFile('%JVM_URL%', '%JVM_TEMP_FILE%')"
if errorlevel 1 goto fail

POPD

RMDIR /S /Q "%JVM_TARGET_DIR%"
if errorlevel 1 goto fail

MKDIR "%JVM_TARGET_DIR%"
if errorlevel 1 goto fail

PUSHD "%JVM_TARGET_DIR%"
if errorlevel 1 goto fail

echo Extracting %BUILD_DIR%\%JVM_TEMP_FILE% to %JVM_TARGET_DIR%

if "%IS_TAR_GZ%"=="1" (
tar xf "..\\%JVM_TEMP_FILE%"
) else (
"%POWERSHELL%" -nologo -noprofile -command "Set-StrictMode -Version 3.0; $ErrorActionPreference = \"Stop\"; Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('..\\%JVM_TEMP_FILE%', '.');"
)
if errorlevel 1 goto fail

DEL /F "..\%JVM_TEMP_FILE%"
if errorlevel 1 goto fail

POPD

echo %JVM_URL%>"%JVM_TARGET_DIR%.flag"
if errorlevel 1 goto fail

:continueWithJvm

set JAVA_HOME=
for /d %%d in ("%JVM_TARGET_DIR%"*) do if exist "%%d\bin\java.exe" set JAVA_HOME=%%d
if not exist "%JAVA_HOME%\bin\java.exe" (
echo Unable to find java.exe under %JVM_TARGET_DIR%
goto fail
)

endlocal & set JAVA_HOME=%JAVA_HOME%

@rem GRADLE JVM WRAPPER END MARKER

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

Expand Down Expand Up @@ -165,4 +89,4 @@ exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
:omega
2 changes: 1 addition & 1 deletion src/dotnet/Plugin.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<SdkVersion>2024.1.0</SdkVersion>
<SdkVersion>2024.2.0-eap08</SdkVersion>

<Title>NSubstituteComplete</Title>
<Description>Provide quick fixes and smart autocomplete when using NSubstitute</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using JetBrains.ReSharper.Feature.Services.QuickFixes;
using JetBrains.ReSharper.Psi;
using JetBrains.ReSharper.Psi.CSharp;
using JetBrains.ReSharper.Psi.CSharp.Conversions;
using JetBrains.ReSharper.Psi.CSharp.ExpectedTypes;
using JetBrains.ReSharper.Psi.CSharp.Resolve;
using JetBrains.ReSharper.Psi.CSharp.Tree;
Expand Down Expand Up @@ -107,8 +106,7 @@ protected override Action<ITextControl> ExecutePsiTransaction(ISolution solution
var elementFactory = CSharpElementFactory.GetInstance(treeNode);
var psiServices = treeNode.GetPsiServices();
var psiSourceFile = treeNode.GetSourceFile();
var cSharpTypeConversionRule = treeNode.GetTypeConversionRule();
var cSharpTypeConstraintsVerifier = new CSharpTypeConstraintsVerifier(treeNode.GetCSharpLanguageLevel(), cSharpTypeConversionRule);
var cSharpTypeConstraintsVerifier = new CSharpTypeConstraintsVerifier(treeNode.GetPsiModule());
var mockAliases = NSubstituteCompleteSettingsHelper.GetSettings(solution)
.GetMockAliases();

Expand All @@ -132,7 +130,7 @@ protected override Action<ITextControl> ExecutePsiTransaction(ISolution solution
}
else
{
var expectedTypeConstraint = new CSharpImplicitlyConvertibleToConstraint(parameter.Type, cSharpTypeConversionRule, cSharpTypeConstraintsVerifier);
var expectedTypeConstraint = new CSharpImplicitlyConvertibleToConstraint(parameter.Type, cSharpTypeConstraintsVerifier);
var options = new SuggestionOptions(defaultName: declaredType.GetClrName().ShortName);
var (mockedType, useNSubstituteMock) = GetMockedType(declaredType, mockAliases, expectedTypeConstraint);
var fieldDeclaration = elementFactory.CreateTypeMemberDeclaration("private $0 $1;", mockedType, declaredType.GetClrName().ShortName);
Expand Down

0 comments on commit edaf772

Please sign in to comment.