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

Sync with the ultimate master #704

Merged
merged 8 commits into from
Aug 24, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ open System
open System.Linq
open FSharp.Compiler.EditorServices
open FSharp.Compiler.Symbols
open JetBrains.Application.Parts
open JetBrains.DocumentModel
open JetBrains.ReSharper.Feature.Services.CodeCompletion
open JetBrains.ReSharper.Feature.Services.CodeCompletion.Impl
Expand Down Expand Up @@ -206,7 +207,7 @@ type FSharpCodeCompletionContext(context: CodeCompletionContext, fcsCompletionCo
fsFile.GetParseAndCheckResults(true, opName) |> Option.map (fun results -> results.CheckResults)
| _ -> None

[<IntellisensePart>]
[<IntellisensePart(Instantiation.DemandAnyThreadUnsafe)>]
type FSharpCodeCompletionContextProvider(fsXmlDocService: FSharpXmlDocService) =
inherit CodeCompletionContextProviderBase()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type FSharpScriptReferenceCompletionContext(context, token, completedPath, range
member x.SupportsNuget = supportsNuget


[<IntellisensePart>]
[<IntellisensePart(Instantiation.DemandAnyThreadSafe)>]
type FSharpScriptReferenceCompletionContextProvider() =
inherit CodeCompletionContextProviderBase()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
namespace JetBrains.ReSharper.Plugins.FSharp.Psi.Features.Comment

open JetBrains.Application.Parts
open JetBrains.ReSharper.Feature.Services.CodeCompletion.CompletionInDocComments
open JetBrains.ReSharper.Feature.Services.CodeCompletion.Infrastructure
open JetBrains.ReSharper.Plugins.FSharp.Psi.Impl.DocComments
open JetBrains.ReSharper.Plugins.FSharp.Psi.Tree
open JetBrains.ReSharper.Psi.Tree

[<IntellisensePart>]
[<IntellisensePart(Instantiation.DemandAnyThreadSafe)>]
type FSharpCodeCompletionContextProviderInDocComment() =
inherit CodeCompletionContextProviderInDocCommentBase()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using JetBrains.ReSharper.Plugins.FSharp.Metadata;
using JetBrains.ReSharper.Psi;
using JetBrains.ReSharper.Psi.ExtensionsAPI.Caches2.ExtensionMethods;
using JetBrains.ReSharper.Psi.Modules;
using JetBrains.ReSharper.Psi.Util;
using JetBrains.Util.DataStructures;

Expand All @@ -11,6 +12,8 @@ namespace JetBrains.ReSharper.Plugins.FSharp.Psi.Impl.Cache2.Compiled;
internal class FSharpCompiledExtensionMemberInfo([NotNull] FSharpMetadataValue value, FSharpCompiledModule owner)
: ICompiledExtensionMemberProxy
{
public IPsiModule PsiModule => owner.Module;

public IPsiSourceFile TryGetSourceFile() => null;

public HybridCollection<ITypeMember> FindExtensionMember()
Expand Down
2 changes: 1 addition & 1 deletion ReSharper.FSharp/src/FSharp/PackagesLock.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PackageLock Include="JetBrains.Annotations" Version="2024.2.0" />
<PackageLock Include="JetBrains.Build.Platform.DistributedCache" Version="1.1.20240726.221" />
<PackageLock Include="JetBrains.FSharp.Compiler.Service" Version="2024.3.0" />
<PackageLock Include="JetBrains.HabitatDetector" Version="1.4.1" />
<PackageLock Include="JetBrains.HabitatDetector" Version="1.4.2" />
<PackageLock Include="JetBrains.Lifetimes" Version="2024.1.0" />
<PackageLock Include="JetBrains.NuGet.Packaging" Version="6.10.20240726.136" />
<PackageLock Include="JetBrains.NuGet.Versioning" Version="6.10.20240726.136" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ type Inheritred() =
inherit Base()

---------------------------------------------------------
(0): Interface Is Implemented: (T) 'Interface 'IInterface' is implemented (click to navigate)' (E) ''
(1): Class Is Inherited: (T) 'Class 'Base' is inherited (click to navigate)' (E) ''
(0): Interface Is Implemented: Interface 'IInterface' is implemented
(1): Class Is Inherited: Class 'Base' is inherited
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
|let x = 1|(0)
#endif
---------------------------------------------------------
(0): ReSharper Inactive Preprocessor Branch: (T) 'Inactive Preprocessor Branch' (E) ''
(0): ReSharper Inactive Preprocessor Branch: Inactive Preprocessor Branch
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.jetbrains.rider.plugins.fsharp.test.cases.editor

import com.jetbrains.rdclient.testFramework.waitForDaemon
import com.jetbrains.rider.test.annotations.Solution
import com.jetbrains.rider.test.annotations.TestEnvironment
import com.jetbrains.rider.test.base.CodeFoldingTestBase
import com.jetbrains.rider.test.env.enums.SdkVersion
import org.testng.annotations.Test

@TestEnvironment(solution = "CoreConsoleApp", sdkVersion = SdkVersion.LATEST_STABLE)
@TestEnvironment(sdkVersion = SdkVersion.LATEST_STABLE)
@Solution("CoreConsoleApp")
class CodeFoldingTest : CodeFoldingTestBase() {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.jetbrains.rider.test.waitForDaemon
import org.testng.annotations.Test

@Test
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_7, reuseSolution = false)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_7)
class FantomasRunOptionsTest : FantomasDotnetToolTestBase() {
@Test
fun default() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package com.jetbrains.rider.plugins.fsharp.test.cases.markup
import com.jetbrains.rdclient.testFramework.waitForDaemon
import com.jetbrains.rider.plugins.fsharp.test.withCultureInfo
import com.jetbrains.rider.test.annotations.Mute
import com.jetbrains.rider.test.annotations.Solution
import com.jetbrains.rider.test.annotations.TestEnvironment
import com.jetbrains.rider.test.asserts.shouldContains
import com.jetbrains.rider.test.base.DocumentationTestBase
import com.jetbrains.rider.test.env.enums.SdkVersion
import org.testng.annotations.Test

@TestEnvironment(solution = "CoreConsoleApp", sdkVersion = SdkVersion.DOT_NET_6)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_6)
@Solution("CoreConsoleApp")
class FSharpHoverDocTest : DocumentationTestBase() {
override val checkSolutionLoad = false

Expand All @@ -36,21 +38,17 @@ class FSharpHoverDocTest : DocumentationTestBase() {

@Mute("RIDER-103671")
@Test
@TestEnvironment(solution = "ConsoleAppTwoTargetFrameworks")
@Solution("ConsoleAppTwoTargetFrameworks")
fun `test multiple frameworks`() = doTest("Program.fs", "Program.fs")

@Test
@TestEnvironment(
solution = "SwaggerProviderCSharp",
sdkVersion = SdkVersion.DOT_NET_6
)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_6)
@Solution("SwaggerProviderCSharp")
fun `provided method in csharp`() = doTest("CSharpLibrary.cs", "CSharpLibrary.cs")

@Test
@TestEnvironment(
solution = "SwaggerProviderCSharp",
sdkVersion = SdkVersion.DOT_NET_6
)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_6)
@Solution("SwaggerProviderCSharp")
fun `provided abbreviation in csharp`() = doTestWithTypeProviders("OpenAPI Provider for")

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.jetbrains.rider.plugins.fsharp.test.cases.markup.injections

import com.intellij.codeInsight.daemon.impl.HighlightInfoType
import com.jetbrains.rider.test.annotations.Solution
import com.jetbrains.rider.test.annotations.TestEnvironment
import com.jetbrains.rider.test.base.BaseTestWithMarkup
import com.jetbrains.rider.test.env.enums.SdkVersion
Expand All @@ -22,7 +23,8 @@ private fun BaseTestWithMarkup.doTest() {
}


@TestEnvironment(solution = "CoreConsoleApp", sdkVersion = SdkVersion.DOT_NET_6)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_6)
@Solution("CoreConsoleApp")
class FSharpLanguageInjectionTest : BaseTestWithMarkup() {
@Test
fun testInjectionByCommentInRegularStrings() = doTest()
Expand Down Expand Up @@ -56,7 +58,8 @@ class FSharpLanguageInjectionTest : BaseTestWithMarkup() {
fun testInjectionByFunction() = doTest()
}

@TestEnvironment(solution = "FableApp", sdkVersion = SdkVersion.DOT_NET_6)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_6)
@Solution("FableApp")
class FSharpFrontendFrameworksTest : BaseTestWithMarkup() {
@Test
fun testInjectionByExternalAnnotation() = doTest()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.jetbrains.rider.plugins.fsharp.test.cases.markup.injections

import com.jetbrains.rider.test.annotations.Solution
import com.jetbrains.rider.test.annotations.TestEnvironment
import com.jetbrains.rider.test.base.RiderSqlInjectionTestBase
import com.jetbrains.rider.test.env.enums.SdkVersion
import org.testng.annotations.Test

@TestEnvironment(solution = "CoreConsoleApp", sdkVersion = SdkVersion.DOT_NET_6)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_6)
@Solution("CoreConsoleApp")
class FSharpSqlAutomaticInjectionTest : RiderSqlInjectionTestBase() {
@Test
fun `test auto injections`() = doTest()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.jetbrains.rider.plugins.fsharp.test.cases.markup.injections

import com.jetbrains.rider.test.annotations.Solution
import com.jetbrains.rider.test.annotations.TestEnvironment
import com.jetbrains.rider.test.base.BaseTestWithMarkup
import com.jetbrains.rider.test.env.enums.SdkVersion
Expand All @@ -8,7 +9,8 @@ import com.jetbrains.rider.test.waitForDaemon
import org.testng.annotations.Test

@Test
@TestEnvironment(solution = "CoreConsoleApp", sdkVersion = SdkVersion.DOT_NET_7)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_7)
@Solution("CoreConsoleApp")
class UrlInStringsTest : BaseTestWithMarkup() {
private fun doTest() {
doTestWithMarkupModel("Program.fs", "Program.fs") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.jetbrains.rider.projectView.ProjectEntityView
import com.jetbrains.rider.projectView.solutionName
import com.jetbrains.rider.projectView.workspace.ProjectModelEntity
import com.jetbrains.rider.projectView.workspace.getProjectModelEntity
import com.jetbrains.rider.test.annotations.Solution
import com.jetbrains.rider.test.annotations.TestEnvironment
import com.jetbrains.rider.test.asserts.shouldNotBeNull
import com.jetbrains.rider.test.base.ProjectModelBaseTest
Expand All @@ -22,7 +23,8 @@ import org.testng.annotations.Test
@Test
class FSharpMoveProviderExtensionTest : ProjectModelBaseTest() {
@Test
@TestEnvironment(solution = "MoveProviderSolution1", sdkVersion = SdkVersion.DOT_NET_CORE_3_1)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_CORE_3_1)
@Solution("MoveProviderSolution1")
fun testAllowPaste01_Mix() {
doTest { provider ->
val compileBeforeFile = findFile("Project", "CompileBeforeFile.fs")
Expand All @@ -42,7 +44,8 @@ class FSharpMoveProviderExtensionTest : ProjectModelBaseTest() {
}

@Test
@TestEnvironment(solution = "MoveProviderSolution2", sdkVersion = SdkVersion.DOT_NET_CORE_3_1)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_CORE_3_1)
@Solution("MoveProviderSolution2")
fun testAllowPaste02_DifferentFiles() {
doTest { provider ->
val files = arrayListOf(
Expand Down Expand Up @@ -102,7 +105,8 @@ class FSharpMoveProviderExtensionTest : ProjectModelBaseTest() {
}

@Test
@TestEnvironment(solution = "MoveProviderSolution3", sdkVersion = SdkVersion.DOT_NET_CORE_3_1)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_CORE_3_1)
@Solution("MoveProviderSolution3")
fun testAllowPaste03_DifferentFilesInFolders() {
doTest { provider ->
val rootFile = findFileView("TargetProject", "File3.fs")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ package com.jetbrains.rider.plugins.fsharp.test.cases.projectModel

import com.jetbrains.rd.ide.model.RdDndOrderType
import com.jetbrains.rider.plugins.fsharp.test.fcsHost
import com.jetbrains.rider.test.annotations.Issue
import com.jetbrains.rider.test.annotations.Issues
import com.jetbrains.rider.test.annotations.Mute
import com.jetbrains.rider.test.annotations.TestEnvironment
import com.jetbrains.rider.test.annotations.*
import com.jetbrains.rider.test.base.ProjectModelBaseTest
import com.jetbrains.rider.test.env.enums.SdkVersion
import com.jetbrains.rider.test.framework.TestProjectModelContext
Expand Down Expand Up @@ -51,10 +48,8 @@ class FSharpProjectModelTest : ProjectModelBaseTest() {

@Test
@Mute("RIDER-110482")
@TestEnvironment(
solution = "FSharpProjectTree",
sdkVersion = SdkVersion.DOT_NET_5
)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_5)
@Solution("FSharpProjectTree")
fun testFSharpProjectStructure() {
doTestDumpProjectsView {
dump2("Init", false, false) {
Expand Down Expand Up @@ -182,10 +177,8 @@ class FSharpProjectModelTest : ProjectModelBaseTest() {
}

@Test
@TestEnvironment(
solution = "FsprojWithTwoFiles",
sdkVersion = SdkVersion.DOT_NET_5
)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_5)
@Solution("FsprojWithTwoFiles")
fun testManualFsprojChange() {
doTestDumpProjectsView {
dump2("Init", false, false) { }
Expand All @@ -203,10 +196,8 @@ class FSharpProjectModelTest : ProjectModelBaseTest() {
}

@Test(description = "RIDER-107198")
@TestEnvironment(
solution = "SolutionWithDuplicateTargets",
sdkVersion = SdkVersion.DOT_NET_5
)
@TestEnvironment(sdkVersion = SdkVersion.DOT_NET_5)
@Solution("SolutionWithDuplicateTargets")
fun doNoneItemDuplicatesTest() {
doTestDumpProjectsView {
dump2("Init", checkSlnFile = false, compareProjFile = false) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import com.jetbrains.rider.projectView.workspace.containingProjectEntity
import com.jetbrains.rider.projectView.workspace.getId
import com.jetbrains.rider.projectView.workspace.getProjectModelEntity
import com.jetbrains.rider.test.annotations.Mute
import com.jetbrains.rider.test.annotations.Solution
import com.jetbrains.rider.test.annotations.TestEnvironment
import com.jetbrains.rider.test.base.ProjectModelBaseTest
import com.jetbrains.rider.test.env.enums.SdkVersion
import com.jetbrains.rider.test.framework.assertAllProjectsWereLoaded
import com.jetbrains.rider.test.framework.frameworkLogger
import com.jetbrains.rider.test.scriptingApi.*
import com.jetbrains.rider.test.waitForDaemon
import com.jetbrains.rider.util.idea.syncFromBackend
import org.testng.annotations.AfterMethod
import org.testng.annotations.BeforeMethod
Expand Down Expand Up @@ -109,7 +109,7 @@ class FcsModuleReaderTest : ProjectModelBaseTest() {


@Mute("RIDER-102738")
@TestEnvironment(solution = "ProjectReferencesCSharp")
@Solution("ProjectReferencesCSharp")
fun testUnloadReloadCSharp() {
executeWithGold(testGoldFile) {
withNonFSharpProjectReferences {
Expand Down Expand Up @@ -137,7 +137,7 @@ class FcsModuleReaderTest : ProjectModelBaseTest() {
}

@Mute("Temporary because of RIDER-20984")
@TestEnvironment(solution = "ProjectReferencesCSharp")
@Solution("ProjectReferencesCSharp")
fun testTypeInsideClassUnloadReload() {
executeWithGold(testGoldFile) {
withNonFSharpProjectReferences {
Expand Down Expand Up @@ -190,7 +190,7 @@ class FcsModuleReaderTest : ProjectModelBaseTest() {
}

@Mute
@TestEnvironment(solution = "ProjectReferencesCSharp")
@Solution("ProjectReferencesCSharp")
fun testTypeOutsideClassUnloadReload() {
executeWithGold(testGoldFile) {
withNonFSharpProjectReferences {
Expand All @@ -216,7 +216,7 @@ class FcsModuleReaderTest : ProjectModelBaseTest() {


@Mute("RIDER-102738")
@TestEnvironment(solution = "ProjectReferencesCSharp2")
@Solution("ProjectReferencesCSharp2")
fun testLoadReferenced() {
executeWithGold(testGoldFile) {
withNonFSharpProjectReferences {
Expand All @@ -236,7 +236,7 @@ class FcsModuleReaderTest : ProjectModelBaseTest() {
override val backendLoadedTimeout: Duration
get() = Duration.ofMinutes(20)

@TestEnvironment(solution = "ProjectReferencesCSharp2")
@Solution("ProjectReferencesCSharp2")
fun testGotoUsagesFromCSharp() {
withNonFSharpProjectReferences {
assertAllProjectsWereLoaded(project)
Expand All @@ -248,7 +248,7 @@ class FcsModuleReaderTest : ProjectModelBaseTest() {
}
}

@TestEnvironment(solution = "ProjectReferencesCSharp3")
@Solution("ProjectReferencesCSharp3")
fun testGotoUsagesFromCSharpChangeCSharp() {
withNonFSharpProjectReferences {
assertAllProjectsWereLoaded(project)
Expand All @@ -261,7 +261,7 @@ class FcsModuleReaderTest : ProjectModelBaseTest() {
}
}

@TestEnvironment(solution = "ProjectReferencesCSharp3")
@Solution("ProjectReferencesCSharp3")
fun testGotoUsagesFromCSharpChangeCSharp2() {
withNonFSharpProjectReferences {
assertAllProjectsWereLoaded(project)
Expand Down
Loading
Loading