Skip to content
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 .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
global-json-file: global.json
dotnet-version: |
8.x
9.x
10.x
- name: Run build
run: dotnet build -c Release src
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
global-json-file: global.json
dotnet-version: |
8.x
9.x
10.x

- name: Restore tools
run: dotnet tool restore
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "9.0.100",
"version": "10.0.100",
"rollForward": "latestMinor"
}
}
}
4 changes: 0 additions & 4 deletions src/ClientServer.cg.fs
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,11 @@ type ILspServer =
/// response is of type {@link FoldingRangeList} or a Thenable
/// that resolves to such.
abstract TextDocumentFoldingRange: FoldingRangeParams -> AsyncLspResult<option<array<FoldingRange>>>

/// A request to resolve the type definition locations of a symbol at a given text
/// document position. The request's parameter is of type {@link TextDocumentPositionParams}
/// the response is of type {@link Declaration} or a typed array of {@link DeclarationLink}
/// or a Thenable that resolves to such.
abstract TextDocumentDeclaration: DeclarationParams -> AsyncLspResult<option<U2<Declaration, array<DeclarationLink>>>>

/// A request to provide selection ranges in a document. The request's
/// parameter is of type {@link SelectionRangeParams}, the
/// response is of type {@link SelectionRange SelectionRange[]} or a Thenable
Expand Down Expand Up @@ -239,7 +237,6 @@ type ILspServer =
/// server constantly fails on this request. This is done to keep the save fast and
/// reliable.
abstract TextDocumentWillSaveWaitUntil: WillSaveTextDocumentParams -> AsyncLspResult<option<array<TextEdit>>>

/// Request to request completion at a given text document position. The request's
/// parameter is of type {@link TextDocumentPosition} the response
/// is of type {@link CompletionItem CompletionItem[]} or {@link CompletionList}
Expand All @@ -250,7 +247,6 @@ type ILspServer =
/// request. However, properties that are needed for the initial sorting and filtering, like `sortText`,
/// `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.
abstract TextDocumentCompletion: CompletionParams -> AsyncLspResult<option<U2<array<CompletionItem>, CompletionList>>>

/// Request to resolve additional information for a given completion item.The request's
/// parameter is of type {@link CompletionItem} the response
/// is of type {@link CompletionItem} or a Thenable that resolves to such.
Expand Down
4 changes: 2 additions & 2 deletions src/Ionide.LanguageServerProtocol.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@
so if you happen to read some content during a Restore, that content won't be re-read during a
subsequent Build
-->
<MSBuild Projects="@(_GeneratorProject)" Targets="Restore">
<MSBuild Projects="@(_GeneratorProject)" Targets="Restore" RemoveProperties="TargetFramework">
<Output TaskParameter="TargetOutputs" ItemName="_GeneratorApp" />
</MSBuild>
<MSBuild Projects="@(_GeneratorProject)" Targets="Build">
<MSBuild Projects="@(_GeneratorProject)" Targets="Build" RemoveProperties="TargetFramework">
<Output TaskParameter="TargetOutputs" ItemName="_GeneratorApp" />
</MSBuild>

Expand Down
6 changes: 1 addition & 5 deletions src/Types.cg.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ open System.Runtime.Serialization
open System.Diagnostics
open Newtonsoft.Json
open Newtonsoft.Json.Linq

/// URI's are transferred as strings. The URI's format is defined in https://tools.ietf.org/html/rfc3986
///
/// See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#uri
Expand Down Expand Up @@ -1635,7 +1634,6 @@ type WorkspaceDiagnosticParams = {
///
/// @since 3.17.0
type WorkspaceDiagnosticReport = { Items: WorkspaceDocumentDiagnosticReport[] }

/// A partial result for a workspace diagnostic report.
///
/// @since 3.17.0
Expand Down Expand Up @@ -3326,7 +3324,6 @@ type WorkDoneProgressEnd = {
}

type SetTraceParams = { Value: TraceValues }

type LogTraceParams = { Message: string; Verbose: string option }

type CancelParams = {
Expand Down Expand Up @@ -4485,8 +4482,7 @@ type Diagnostic = {

[<DebuggerBrowsable(DebuggerBrowsableState.Never); JsonIgnore>]
member x.DebuggerDisplay =
$"[{defaultArg x.Severity DiagnosticSeverity.Error}] ({x.Range.DebuggerDisplay}) {x.Message} ({Option.map string x.Code
|> Option.defaultValue String.Empty})"
$"[{defaultArg x.Severity DiagnosticSeverity.Error}] ({x.Range.DebuggerDisplay}) {x.Message} ({Option.map string x.Code |> Option.defaultValue String.Empty})"

/// Contains additional information about the context in which a completion request is triggered.
type CompletionContext = {
Expand Down
4 changes: 2 additions & 2 deletions tests/Ionide.LanguageServerProtocol.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>

Expand Down
17 changes: 17 additions & 0 deletions tools/MetaModelGenerator/Common.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
namespace MetaModelGenerator

module Formatting =
open Fantomas.Core

let formatConfig = {
FormatConfig.Default with
IndentSize = 2
MaxRecordWidth = 80
MaxValueBindingWidth = 120
MaxFunctionBindingWidth = 120
MaxDotGetExpressionWidth = 120
MaxInfixOperatorExpression = 10
ArrayOrListMultilineFormatter = MultilineFormatterType.NumberOfItems
MultilineBracketStyle = MultilineBracketStyle.Stroustrup
MultiLineLambdaClosingNewline = true
InsertFinalNewline = false
}


module FileWriters =
open System.IO
Expand Down
4 changes: 3 additions & 1 deletion tools/MetaModelGenerator/GenerateClientServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module GenerateClientServer =
open Fantomas.Core


let private formatConfig = Formatting.formatConfig

let generateClientServer (parsedMetaModel: MetaModel.MetaModel) outputPath =
async {
printfn "Generating generateClientServer"
Expand Down Expand Up @@ -312,7 +314,7 @@ module GenerateClientServer =
let! formattedText =
oak
|> Gen.mkOak
|> CodeFormatter.FormatOakAsync
|> fun oak -> CodeFormatter.FormatOakAsync(oak, formatConfig)

do! FileWriters.writeIfChanged outputPath formattedText

Expand Down
8 changes: 5 additions & 3 deletions tools/MetaModelGenerator/GenerateTypes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module GenerateTypes =
open type Fabulous.AST.Ast

open Fantomas.FCS.Syntax
open Newtonsoft.Json.Linq


let getIdent (x: IdentifierOrDot list) =
x
Expand All @@ -27,7 +27,7 @@ module GenerateTypes =
|> String.concat ""


let JToken = LongIdent(nameof JToken)
let JToken = LongIdent "JToken"

let createOption (t: WidgetBuilder<Type>) = Ast.OptionPostfix t

Expand Down Expand Up @@ -866,6 +866,8 @@ module GenerateTypes =
}


let private formatConfig = Formatting.formatConfig

/// The main entry point to generating types from a metaModel.json file
let generateType (parsedMetaModel: MetaModel.MetaModel) outputPath =
async {
Expand Down Expand Up @@ -965,7 +967,7 @@ See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17
let! formattedText =
oak
|> Gen.mkOak
|> CodeFormatter.FormatOakAsync
|> fun oak -> CodeFormatter.FormatOakAsync(oak, formatConfig)

do! FileWriters.writeIfChanged outputPath formattedText
}
Loading
Loading