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

Update long secondary constructor parameters. #3038

Merged
merged 10 commits into from
Jan 27, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]
},
"fsdocs-tool": {
"version": "20.0.0-alpha-010",
"version": "20.0.0-alpha-018",
"commands": [
"fsdocs"
]
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Changelog

## Unreleased
## 6.3.0-alpha-007 - 2024-01-27

### Changed
* Update FCS to 'Parser: parse primary ctor params as normal patterns', commit e2496896c128ccfde33c92f45bbe0d2aa738873a [#3034](https://github.com/fsprojects/fantomas/pull/3034)
* Multiline secondary constructor. [#3037](https://github.com/fsprojects/fantomas/issues/3037) [style guide](https://github.com/dotnet/docs/pull/39096)

## 6.3.0-alpha-006 - 2024-01-09

Expand Down
33 changes: 2 additions & 31 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#r "nuget: Humanizer.Core, 2.14.1"

open System
open System.Text.Json
open System.IO
open Fun.Build
open CliWrap
Expand All @@ -28,34 +27,6 @@ let cleanFolders (input: string seq) =
Directory.Delete(dir, true))
}

/// Workaround for https://github.com/dotnet/sdk/issues/35989
let restoreTools (ctx: Internal.StageContext) =
async {
let json = File.ReadAllText ".config/dotnet-tools.json"
let jsonDocument = JsonDocument.Parse(json)
let root = jsonDocument.RootElement
let tools = root.GetProperty("tools")

let! installs =
tools.EnumerateObject()
|> Seq.map (fun tool ->
let version = tool.Value.GetProperty("version").GetString()
ctx.RunCommand $"dotnet tool install %s{tool.Name} --version %s{version}")
|> Async.Sequential

let failedInstalls =
installs
|> Array.tryPick (function
| Ok _ -> None
| Error error -> Some error)

match failedInstalls with
| None -> return 0
| Some error ->
printfn $"%s{error}"
return 1
}

let benchmarkAssembly =
"src"
</> "Fantomas.Benchmarks"
Expand Down Expand Up @@ -90,7 +61,7 @@ let analysisReportsDir = "analysisreports"

pipeline "Build" {
workingDir __SOURCE_DIRECTORY__
stage "RestoreTools" { run restoreTools }
stage "RestoreTools" { run "dotnet tool restore" }
stage "Clean" {
run (
cleanFolders
Expand Down Expand Up @@ -200,7 +171,7 @@ pipeline "PushClient" {
pipeline "Docs" {
workingDir __SOURCE_DIRECTORY__
stage "Prepare" {
run restoreTools
run "dotnet tool restore"
run "dotnet build -c Release src/Fantomas/Fantomas.fsproj"
}
stage "Watch" {
Expand Down
3 changes: 3 additions & 0 deletions docs/content/configuration.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ h3 {
padding-inline: var(--spacing-100);
font-size: var(--font-300);
max-width: calc(100% - var(--configuration-icon-size) - var(--configuration-icon-size) - var(--spacing-100) - var(--spacing-100));
& a {
padding-top: var(--spacing-600);
}
}

p > fantomas-setting, p > copy-to-clipboard {
Expand Down
2 changes: 1 addition & 1 deletion docs/content/fsdocs-theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ h1,h2,h3,h4,h5,h6 {
}
}

#fsdocs-page-menu {
#fsdocs-page-menu ul li {
& a {
color: var(--fantomas-600);
}
Expand Down
190 changes: 99 additions & 91 deletions docs/content/webcomponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,21 @@ class Navigation extends LitElement {

a {
margin-top: var(--spacing-200);
color: var(--link-color);
color: var(--fantomas-800);
display: inline-block;
text-decoration: none;
background-color: var(--fantomas-200);
padding: var(--spacing-50) var(--spacing-100);
}

a:hover {
background-color: var(--fantomas-400);
color: var(--fantomas-50);
}

a:only-child {
text-align: center;
flex: 1;
margin-inline: auto;
}
`;

Expand Down Expand Up @@ -93,7 +101,7 @@ class CopyToClipboard extends LitElement {
margin: 0;
transition: all 200ms;
position: absolute;
z-index: 1;
z-index: 101;
left: 50%;
transform: translateX(-50%);
bottom: 100%;
Expand Down Expand Up @@ -146,113 +154,113 @@ class FantomasSetting extends LitElement {
}

static styles = css`
:host {
display: inline-block;
}
:host {
display: inline-block;
}

:host([green]) iconify-icon {
color: #92DC84;
}
:host([green]) iconify-icon {
color: #92DC84;
}

:host([green]) .tooltip {
background-color: #92DC84;
}
:host([green]) .tooltip {
background-color: #92DC84;
}

:host([green]) .tooltip::after {
border-color: #92DC84 transparent transparent transparent;
}
:host([green]) .tooltip::after {
border-color: #92DC84 transparent transparent transparent;
}

:host([orange]) iconify-icon {
color: #F5BF4F;
}
:host([orange]) iconify-icon {
color: #F5BF4F;
}

:host([orange]) .tooltip {
background-color: #F5BF4F;
}
:host([orange]) .tooltip {
background-color: #F5BF4F;
}

:host([orange]) .tooltip::after {
border-color: #F5BF4F transparent transparent transparent;
}
:host([orange]) .tooltip::after {
border-color: #F5BF4F transparent transparent transparent;
}

:host([red]) iconify-icon {
color: #EA7268;
}
:host([red]) iconify-icon {
color: #EA7268;
}

:host([red]) .tooltip {
background-color: #EA7268;
}
:host([red]) .tooltip {
background-color: #EA7268;
}

:host([red]) .tooltip::after {
border-color: #EA7268 transparent transparent transparent;
}
:host([red]) .tooltip::after {
border-color: #EA7268 transparent transparent transparent;
}

:host([gr]) iconify-icon {
color: #00A8E2;
}
:host([gr]) iconify-icon {
color: #00A8E2;
}

:host([gr]) .tooltip {
background-color: #00A8E2;
}
:host([gr]) .tooltip {
background-color: #00A8E2;
}

:host([gr]) .tooltip::after {
border-color: #00A8E2 transparent transparent transparent;
}
:host([gr]) .tooltip::after {
border-color: #00A8E2 transparent transparent transparent;
}

div {
height: var(--configuration-icon-size);
position: relative;
}
div {
height: var(--configuration-icon-size);
position: relative;
}

img {
box-sizing: border-box;
padding: 4px;
background-color: #00A8E2;
height: var(--configuration-icon-size);
width: var(--configuration-icon-size);
border-radius: 12px;
display: inline-block;
}
img {
box-sizing: border-box;
padding: 4px;
background-color: #00A8E2;
height: var(--configuration-icon-size);
width: var(--configuration-icon-size);
border-radius: 12px;
display: inline-block;
}

img, iconify-icon {
position: relative;
cursor: pointer;
img, iconify-icon {
position: relative;
cursor: pointer;

&:hover + .tooltip {
visibility: visible;
opacity: 1;
&:hover + .tooltip {
visibility: visible;
opacity: 1;
}
}
}

.tooltip {
visibility: hidden;
opacity: 0;
white-space: nowrap;
font-size: 14px;
line-height: 1.5;
background-color: rgba(0, 0, 0, .95);
color: #FFF;
text-align: center;
border-radius: var(--radius);
padding: var(--spacing-100);
margin: 0;
transition: all 200ms;
position: absolute;
z-index: 1;
left: 50%;
transform: translateX(-50%);
bottom: 100%;

&::after {
content: " ";
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
border-width: var(--radius);
border-style: solid;
border-color: rgba(0, 0, 0, .95) transparent transparent transparent;
.tooltip {
visibility: hidden;
opacity: 0;
white-space: nowrap;
font-size: 14px;
line-height: 1.5;
background-color: rgba(0, 0, 0, .95);
color: #FFF;
text-align: center;
border-radius: var(--radius);
padding: var(--spacing-100);
margin: 0;
transition: all 200ms;
position: absolute;
z-index: 101;
left: 50%;
transform: translateX(-50%);
bottom: 100%;

&::after {
content: " ";
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
border-width: var(--radius);
border-style: solid;
border-color: rgba(0, 0, 0, .95) transparent transparent transparent;
}
}
}
`;

constructor(props) {
Expand Down
8 changes: 8 additions & 0 deletions docs/docs/end-users/Configuration.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,14 @@ type D() =
aThirdVeryLongParam: AVeryLongTypeThatYouNeedToUse
) : ReturnType =
42

type E() =
new
(
aVeryLongType: AVeryLongTypeThatYouNeedToUse,
aSecondVeryLongType: AVeryLongTypeThatYouNeedToUse,
aThirdVeryLongType: AVeryLongTypeThatYouNeedToUse
) = E()
"""
{ FormatConfig.Default with
AlternativeLongMemberDefinitions = true }
Expand Down
5 changes: 1 addition & 4 deletions src/Fantomas.Core.Tests/AlignedMultilineBracketStyleTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1050,10 +1050,7 @@ type RequestParser<'ctx, 'a> =
}

static member internal Create
(
consumedFields,
parse : 'ctx -> Request -> Async<Result<'a, Error list>>
)
(consumedFields, parse : 'ctx -> Request -> Async<Result<'a, Error list>>)
: RequestParser<'ctx, 'a>
=
{
Expand Down
Loading
Loading