Skip to content

Commit

Permalink
Merge branch 'main' into test-explorer-stability
Browse files Browse the repository at this point in the history
  • Loading branch information
baronfel authored Aug 19, 2023
2 parents e882c87 + e783e48 commit 61e938c
Show file tree
Hide file tree
Showing 12 changed files with 229 additions and 45 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Build Pull Requests

on:
push:
branches:
- '*'
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
env:
nuget-key: ${{ secrets.NUGET_KEY }}
github-user: ${{ github.event.inputs.username }}
github-pw: ${{ secrets.USER_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
vsce-token: ${{ secrets.VSCE_TOKEN }}
user-email: ${{ github.event.inputs.email }}
run: dotnet run --project build -- -t Release
Expand Down
20 changes: 15 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For issue reporting, use [Github Issues](https://github.com/ionide/ionide-vscode
- [Submitting **Bug Reports**](#bug-reports)
- [Submitting **Feature Requests**](#feature-requests)

Personal support request should be discussed on [F# Software Foundation Slack](https://fsharp.org/guides/slack/).
Personal support request (or getting contribution help) should be discussed on [F# Software Foundation Slack](https://fsharp.org/guides/slack/) or [the F# Discord](https://discord.gg/R6n7c54).

## Getting Started

Expand Down Expand Up @@ -131,11 +131,21 @@ Note: Step 1 starts a new "Watch" task that rebuilds Ionide in the background wh

If you're curious what's going on, you can view the log output for this task by running `Tasks: Show Running Tasks` from the command palette.

### Working with FSAC
### Working with FSAC (FSharpAutoComplete)
Most Ionide bugs are actually from there. This repo only stores the glue code between FSAC and Visual Studio Code - not the actual implementation of behaviours you would experience when using Ionide in Visual Studio Code which are implemented in FSAC.
1. **Fork the FSAC repo** https://github.com/fsharp/FsAutoComplete on github.

1. Open FSAC from a new instance of VSCode from the directory: `paket-files/github.com/fsharp/FsAutoComplete`
2. Build the FSAC solution and copy the dll output from the output log, it should be something like: `paket-files/github.com/fsharp/FsAutoComplete/src/FsAutoComplete/bin/Debug/net5.0/fsautocomplete.dll`.
3. In the instance of VSCode that you have Ionide open, open settings (`CMD ,` or `Ctrl ,`), and find the section `FSharp > Fsac: Net Core Dll Path` and paste the output you copied from step 3.
1. **Clone your fork**:
```bash
git clone [email protected]:YOUR_GITHUB_USER/FsAutoComplete.git
```
or if you don't use ssh:
```bash
git clone https://github.com/YOUR_GITHUB_USER/FsAutoComplete.git
```
2. Follow the [FSAC build instructions](https://github.com/fsharp/FsAutoComplete#building-and-testing) and copy the dll output from the output log, it should be a path inside the FSAC repo ending with `src/FsAutoComplete/bin/Release/net6.0/fsautocomplete.dll`. (Alternatively, delete the `net6.0/fsautocomplete.dll` part and it will also work.) Note that `Release` may be substituted with `Debug` if you build with that configuration instead. Also, note that `net6.0` may be replaced with another .NET version like `net7.0` as FsAutoComplete targets a newer .NET version.
3. In the instance of VSCode that you have Ionide open, open settings (`CMD ,` or `Ctrl ,` by default), and find the section `FSharp > Fsac: Net Core Dll Path` and paste the output you copied from step 3.
4. Now find the section `FSharp > Fsac: Attach Debugger` and check the check box.
5. Close settings
6. Goto the debug section and hit `Build and Launch extension`, after a while another instance of VSCode will start, you can use this instance to test Ionide/FsAutoComplete.
Expand Down
14 changes: 14 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
### 7.8.5 - 26.07.2023
* [Disable GCHeapCount and GCNoAffinitize for net6.0](https://github.com/ionide/ionide-vscode-fsharp/pull/1900) (Thanks @TheAngryByrd!)

### 7.8.4 - 22.07.2023
* [Adds GCNoAffinitize setting](https://github.com/ionide/ionide-vscode-fsharp/pull/1898) (Thanks @TheAngryByrd!)

### 7.8.3 - 22.07.2023
* Updates FSAC to 0.61.1. Check out the [release notes](https://github.com/fsharp/FsAutoComplete/releases/tag/v0.61.1) for more details.
* [Adds Garbage Collector settings](https://github.com/ionide/ionide-vscode-fsharp/pull/1896) (Thanks @TheAngryByrd!)

### 7.8.2 - 21.07.2023
* Updates FSAC to 0.61.0. Check out the [release notes](https://github.com/fsharp/FsAutoComplete/releases/tag/v0.61.0) for more details.
* [Fixed Inline type hints don't update accurately](https://github.com/ionide/ionide-vscode-fsharp/pull/1894) (Thanks @TheAngryByrd!)

### 7.7.1 - 01.07.2023

* Updates FSAC to 0.60.1, which brings enhancements to the XML Documentation codefix as well as new settings for optimizing the built-in Analyzers and text handling. Check out the [release notes](https://github.com/fsharp/FsAutoComplete/releases/tag/v0.60.1) for more details.
Expand Down
18 changes: 12 additions & 6 deletions build/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ let releaseNotesData = File.ReadAllLines "RELEASE_NOTES.md" |> ReleaseNotes.pars

let release = List.head releaseNotesData

let githubToken = Environment.environVarOrNone "GITHUB_TOKEN"

// --------------------------------------------------------------------------------------
// Helper functions
// --------------------------------------------------------------------------------------
Expand Down Expand Up @@ -227,11 +229,6 @@ let releaseGithub (release: ReleaseNotes.ReleaseNotes) =
| s when not (String.IsNullOrWhiteSpace s) -> s
| _ -> UserInput.getUserInput "Email: "

let pw =
match Environment.environVarOrDefault "github-pw" "" with
| s when not (String.IsNullOrWhiteSpace s) -> s
| _ -> UserInput.getUserPassword "Password: "

let remote =
CommandHelper.getGitResult "" "remote -v"
|> Seq.filter (fun (s: string) -> s.EndsWith("(push)"))
Expand All @@ -249,9 +246,16 @@ let releaseGithub (release: ReleaseNotes.ReleaseNotes) =

let files = !!("./temp" </> "*.vsix")

let token =
match githubToken with
| Some s -> s
| _ ->
failwith
"please set the github_token environment variable to a github personal access token with repo access."

// release on github
let cl =
GitHub.createClient user pw
GitHub.createClientWithToken token
|> GitHub.draftNewRelease
gitOwner
gitName
Expand Down Expand Up @@ -367,6 +371,8 @@ let initTargets () =
Target.create "Release" ignore

let buildTargetTree () =
Option.iter (TraceSecrets.register "<GITHUB_TOKEN>") githubToken

let (==>!) x y = x ==> y |> ignore

"YarnInstall" ==>! "RunScript"
Expand Down
2 changes: 1 addition & 1 deletion paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,4 @@ STORAGE: PACKAGES
RESTRICTION: == netstandard2.0
NUGET
remote: https://api.nuget.org/v3/index.json
fsautocomplete (0.60.1)
fsautocomplete (0.61.1)
14 changes: 14 additions & 0 deletions release/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
### 7.8.5 - 26.07.2023
* [Disable GCHeapCount and GCNoAffinitize for net6.0](https://github.com/ionide/ionide-vscode-fsharp/pull/1900) (Thanks @TheAngryByrd!)

### 7.8.4 - 22.07.2023
* [Adds GCNoAffinitize setting](https://github.com/ionide/ionide-vscode-fsharp/pull/1898) (Thanks @TheAngryByrd!)

### 7.8.3 - 22.07.2023
* Updates FSAC to 0.61.1. Check out the [release notes](https://github.com/fsharp/FsAutoComplete/releases/tag/v0.61.1) for more details.
* [Adds Garbage Collector settings](https://github.com/ionide/ionide-vscode-fsharp/pull/1896) (Thanks @TheAngryByrd!)

### 7.8.2 - 21.07.2023
* Updates FSAC to 0.61.0. Check out the [release notes](https://github.com/fsharp/FsAutoComplete/releases/tag/v0.61.0) for more details.
* [Fixed Inline type hints don't update accurately](https://github.com/ionide/ionide-vscode-fsharp/pull/1894) (Thanks @TheAngryByrd!)

### 7.7.1 - 01.07.2023

* Updates FSAC to 0.60.1, which brings enhancements to the XML Documentation codefix as well as new settings for optimizing the built-in Analyzers and text handling. Check out the [release notes](https://github.com/fsharp/FsAutoComplete/releases/tag/v0.60.1) for more details.
Expand Down
34 changes: 31 additions & 3 deletions release/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@
"FSharp.fsac.conserveMemory": {
"default": false,
"description": "Configures FsAutoComplete with settings intended to reduce memory consumption. Requires restart.",
"type": "boolean"
"type": "boolean",
"deprecationMessage": "This setting is deprecated. Use FSharp.fsac.gc.conserveMemory instead."
},
"FSharp.fsac.dotnetArgs": {
"default": [],
Expand All @@ -542,6 +543,33 @@
},
"type": "array"
},
"FSharp.fsac.gc.conserveMemory": {
"markdownDescription": "Configures the garbage collector to [conserve memory](https://learn.microsoft.com/en-us/dotnet/core/runtime-config/garbage-collector#conserve-memory) at the expense of more frequent garbage collections and possibly longer pause times. Acceptable values are 0-9. Any non-zero value will allow the [Large Object Heap](https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/large-object-heap) to be compacted automatically if it has too much fragmentation. Requires restart.",
"type": "integer",
"minimum": 0,
"maximum": 9
},
"FSharp.fsac.gc.heapCount": {
"default": 2,
"markdownDescription": "Limits the number of [heaps](https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals#the-managed-heap) created by the garbage collector. Applies to server garbage collection only. See [Middle Ground between Server and Workstation GC](https://devblogs.microsoft.com/dotnet/middle-ground-between-server-and-workstation-gc/) for more details. This can allow FSAC to still benefit from Server garbage collection while still limiting the number of heaps. [Only available on .NET 7 or higher](https://github.com/ionide/ionide-vscode-fsharp/issues/1899#issuecomment-1649009462). Requires restart.",
"type": "integer",
"required": [
"FSharp.fsac.gc.server"
]
},
"Fsharp.fsac.gc.noAffinitize": {
"default": true,
"type": "boolean",
"markdownDescription": "Specifies whether to [affinitize](https://learn.microsoft.com/en-us/dotnet/core/runtime-config/garbage-collector#affinitize) garbage collection threads with processors. To affinitize a GC thread means that it can only run on its specific CPU.. Applies to server garbage collection only. See [GCNoAffinitize](https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/gcnoaffinitize-element#remarks) for more details. [Only available on .NET 7 or higher](https://github.com/ionide/ionide-vscode-fsharp/issues/1899#issuecomment-1649009462). Requires restart.",
"required": [
"FSharp.fsac.gc.server"
]
},
"FSharp.fsac.gc.server": {
"default": true,
"markdownDescription": "Configures whether the application uses workstation garbage collection or server garbage collection. See [Workstation vs Server Garbage Collection](https://devblogs.microsoft.com/premier-developer/understanding-different-gc-modes-with-concurrency-visualizer/#workstation-gc-vs-server-gc) for more details. Workstation will use less memory but Server will have more throughput. Requires restart.",
"type": "boolean"
},
"FSharp.fsac.netCoreDllPath": {
"default": "",
"description": "The path to the \u0027fsautocomplete.dll\u0027, a directory containing TFM-specific versions of fsautocomplete.dll, or a directory containing fsautocomplete.dll. Useful for debugging a self-built FSAC. If a DLL is specified, uses it directly. If a directory is specified and it contains TFM-specific folders (net6.0, net7.0, etc) then that directory will be probed for the best TFM to use for the current runtime. This is useful when working with a local copy of FSAC, you can point directly to the bin/Debug or bin/Release folder and it\u0027ll Just Work. Finally, if a directory is specified and there are no TFM paths, then fsautocomplete.dll from that directory is used. Requires restart.",
Expand Down Expand Up @@ -713,7 +741,7 @@
},
"FSharp.openTelemetry.enabled": {
"default": false,
"description": "Enables OpenTelemetry exporter. See https://opentelemetry.io/docs/reference/specification/protocol/exporter/ for environment variables to configure for the exporter. Requires Restart.",
"markdownDescription": "Enables OpenTelemetry exporter. See [OpenTelemetry Protocol Exporter](https://opentelemetry.io/docs/reference/specification/protocol/exporter/) for environment variables to configure for the exporter. Requires Restart.",
"type": "boolean"
},
"FSharp.pipelineHints.enabled": {
Expand Down Expand Up @@ -1725,5 +1753,5 @@
"type": "git",
"url": "https://github.com/ionide/ionide-vscode-fsharp.git"
},
"version": "7.7.1"
"version": "7.8.5"
}
16 changes: 10 additions & 6 deletions src/Components/LineLens.fs
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,15 @@ module DecorationUpdate =

let private getSignature (uri: Uri) (range: DTO.Range) =
async {
let! signaturesResult =
LanguageService.signatureData uri range.StartLine (range.StartColumn - 1)
|> Async.AwaitPromise

return signaturesResult |> Option.map (fun r -> range, formatSignature r.Data)
try
let! signaturesResult =
LanguageService.signatureData uri range.StartLine (range.StartColumn - 1)
|> Async.AwaitPromise

return signaturesResult |> Option.map (fun r -> range, formatSignature r.Data)
with e ->
logger.Error("Error getting signature %o", e)
return None
}

let private signatureToDecoration (doc: TextDocument) (range: DTO.Range, signature: string) =
Expand All @@ -223,7 +227,7 @@ module DecorationUpdate =
let! signatures =
interesting
|> Array.map (getSignature uri)
|> Async.Sequential // Need to be sequential otherwise we'll flood the server with requests causing threapool exhaustion
|> Async.Sequential // Need to be sequential otherwise we'll flood the server with requests causing threadpool exhaustion
|> Async.StartAsPromise
|> Promise.map (fun s -> s |> Array.choose (id))

Expand Down
Loading

0 comments on commit 61e938c

Please sign in to comment.