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

Fix Tests for AdaptiveLspServer #1053

Merged
merged 16 commits into from Feb 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Expand Up @@ -10,6 +10,7 @@ jobs:
build:
env:
TEST_TIMEOUT_MINUTES: 30
FSAC_TEST_DEFAULT_TIMEOUT : 120000 #ms, individual test timeouts
baronfel marked this conversation as resolved.
Show resolved Hide resolved
timeout-minutes: 30 # we have a locking issue, so cap the runs at ~20m to account for varying build times, etc
strategy:
matrix:
Expand Down
54 changes: 20 additions & 34 deletions paket.lock

Large diffs are not rendered by default.

55 changes: 29 additions & 26 deletions src/FsAutoComplete.Core/Commands.fs
Expand Up @@ -88,6 +88,7 @@ type NotificationEvent =
| TestDetected of file: string<LocalPath> * tests: TestAdapter.TestAdapterEntry<range>[]

module Commands =
open System.Collections.Concurrent
let fantomasLogger = LogProvider.getLoggerByName "Fantomas"
let commandsLogger = LogProvider.getLoggerByName "Commands"

Expand Down Expand Up @@ -836,7 +837,7 @@ module Commands =
return Choice1Of2(declarationRanges, usageRanges)

| SymbolDeclarationLocation.Projects (projects, isInternalToProject) ->
let symbolUseRanges = ImmutableArray.CreateBuilder()
let symbolUseRanges = ConcurrentBag<_>()
baronfel marked this conversation as resolved.
Show resolved Hide resolved
let symbolRange = symbol.DefinitionRange.NormalizeDriveLetterCasing()
let symbolFile = symbolRange.TaggedFileName

Expand Down Expand Up @@ -967,30 +968,6 @@ module Commands =
highlights |> Array.collect expandParents)
|> Array.sortBy startToken

type Commands(checker: FSharpCompilerServiceChecker, state: State, hasAnalyzers: bool, rootPath: string option) =
let fileParsed = Event<FSharpParseFileResults>()

let fileChecked = Event<ParseAndCheckResults * string<LocalPath> * int>()

let scriptFileProjectOptions = Event<FSharpProjectOptions>()

let disposables = ResizeArray()

let mutable workspaceRoot: string option = rootPath
let mutable linterConfigFileRelativePath: string option = None
// let mutable linterConfiguration: FSharpLint.Application.Lint.ConfigurationParam = FSharpLint.Application.Lint.ConfigurationParam.Default
let mutable lastCheckResult: ParseAndCheckResults option = None

let notify = Event<NotificationEvent>()

let fileStateSet = Event<unit>()
let commandsLogger = LogProvider.getLoggerByName "Commands"

let checkerLogger = LogProvider.getLoggerByName "CheckerEvents"

let fantomasLogger = LogProvider.getLoggerByName "Fantomas"




let analyzerHandler (file: string<LocalPath>, content, pt, tast, symbols, getAllEnts) =
Expand Down Expand Up @@ -1038,6 +1015,32 @@ type Commands(checker: FSharpCompilerServiceChecker, state: State, hasAnalyzers:

[||]


type Commands(checker: FSharpCompilerServiceChecker, state: State, hasAnalyzers: bool, rootPath: string option) =
baronfel marked this conversation as resolved.
Show resolved Hide resolved
let fileParsed = Event<FSharpParseFileResults>()

let fileChecked = Event<ParseAndCheckResults * string<LocalPath> * int>()

let scriptFileProjectOptions = Event<FSharpProjectOptions>()

let disposables = ResizeArray()

let mutable workspaceRoot: string option = rootPath
let mutable linterConfigFileRelativePath: string option = None
// let mutable linterConfiguration: FSharpLint.Application.Lint.ConfigurationParam = FSharpLint.Application.Lint.ConfigurationParam.Default
let mutable lastCheckResult: ParseAndCheckResults option = None

let notify = Event<NotificationEvent>()

let fileStateSet = Event<unit>()
let commandsLogger = LogProvider.getLoggerByName "Commands"

let checkerLogger = LogProvider.getLoggerByName "CheckerEvents"

let fantomasLogger = LogProvider.getLoggerByName "Fantomas"



do
disposables.Add
<| state.ProjectController.Notifications.Subscribe(NotificationEvent.Workspace >> notify.Trigger)
Expand Down Expand Up @@ -1105,7 +1108,7 @@ type Commands(checker: FSharpCompilerServiceChecker, state: State, hasAnalyzers:
| true, fileData ->

let res =
analyzerHandler (
Commands.analyzerHandler (
file,
fileData.Lines.ToString().Split("\n"),
parseAndCheck.GetParseResults.ParseTree,
Expand Down
10 changes: 10 additions & 0 deletions src/FsAutoComplete.Core/Consts.fs
@@ -0,0 +1,10 @@
namespace FsAutoComplete.Core

module ProjectLoader =
[<Literal>]
let ProduceReferenceAssembly = "ProduceReferenceAssembly"

let globalProperties =
[
// For tooling we don't want to use Reference Assemblies as this doesn't play well with type checking across projects
ProduceReferenceAssembly, "false" ]
baronfel marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 1 deletion src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj
Expand Up @@ -9,6 +9,7 @@
<TrimmerRootAssembly Include="FsAutoComplete.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Consts.fs" />
<Compile Include="Workaround/ServiceParseTreeWalk.fs" />
<Compile Include="Debug.fs" />
<Compile Include="Utils.fs" />
Expand Down Expand Up @@ -45,4 +46,4 @@
<Compile Include="Commands.fs" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
</Project>