-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add signature files for FSharpLspClient, Parser and UnionPatternMatch…
…CaseGenerator. (#1213)
- Loading branch information
Showing
6 changed files
with
99 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/FsAutoComplete.Core/UnionPatternMatchCaseGenerator.fsi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/// Original code from VisualFSharpPowerTools project: https://github.com/fsprojects/VisualFSharpPowerTools/blob/master/src/FSharp.Editing/CodeGeneration/UnionPatternMatchCaseGenerator.fs | ||
module FsAutoComplete.UnionPatternMatchCaseGenerator | ||
|
||
open FSharp.Compiler.Syntax | ||
open FSharp.Compiler.Text | ||
open FSharp.Compiler.Symbols | ||
|
||
[<NoEquality; NoComparison>] | ||
type PatternMatchExpr = | ||
{ | ||
/// Range of 'match x with' or 'function' | ||
MatchWithOrFunctionRange: Range | ||
/// The whole pattern match expression | ||
Expr: SynExpr | ||
Clauses: SynMatchClause list | ||
} | ||
|
||
[<NoComparison>] | ||
type UnionMatchCasesInsertionParams = | ||
{ InsertionPos: Position | ||
IndentColumn: int } | ||
|
||
val shouldGenerateUnionPatternMatchCases: patMatchExpr: PatternMatchExpr -> entity: FSharpEntity -> bool | ||
|
||
val tryFindUnionDefinitionFromPos: | ||
codeGenService: ICodeGenerationService -> | ||
pos: Position -> | ||
document: Document -> | ||
Async<(PatternMatchExpr * FSharpEntity * UnionMatchCasesInsertionParams) option> | ||
|
||
val formatMatchExpr: | ||
insertionParams: UnionMatchCasesInsertionParams -> | ||
caseDefaultValue: string -> | ||
patMatchExpr: PatternMatchExpr -> | ||
entity: FSharpEntity -> | ||
string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
namespace FsAutoComplete.Lsp | ||
|
||
open Ionide.LanguageServerProtocol | ||
open Ionide.LanguageServerProtocol.Server | ||
open Ionide.LanguageServerProtocol.Types | ||
open FsAutoComplete.LspHelpers | ||
open System | ||
open IcedTasks | ||
|
||
type FSharpLspClient = | ||
new: sendServerNotification: ClientNotificationSender * sendServerRequest: ClientRequestSender -> FSharpLspClient | ||
inherit LspClient | ||
member ClientCapabilities: ClientCapabilities option with get, set | ||
override WindowShowMessage: ShowMessageParams -> Async<unit> | ||
override WindowShowMessageRequest: ShowMessageRequestParams -> AsyncLspResult<MessageActionItem option> | ||
override WindowLogMessage: LogMessageParams -> Async<unit> | ||
override TelemetryEvent: Newtonsoft.Json.Linq.JToken -> Async<unit> | ||
override ClientRegisterCapability: RegistrationParams -> AsyncLspResult<unit> | ||
override ClientUnregisterCapability: UnregistrationParams -> AsyncLspResult<unit> | ||
override WorkspaceWorkspaceFolders: unit -> AsyncLspResult<WorkspaceFolder array option> | ||
override WorkspaceConfiguration: ConfigurationParams -> AsyncLspResult<Newtonsoft.Json.Linq.JToken array> | ||
override WorkspaceApplyEdit: ApplyWorkspaceEditParams -> AsyncLspResult<ApplyWorkspaceEditResponse> | ||
override WorkspaceSemanticTokensRefresh: unit -> Async<unit> | ||
override TextDocumentPublishDiagnostics: PublishDiagnosticsParams -> Async<unit> | ||
///Custom notification for workspace/solution/project loading events | ||
member NotifyWorkspace: p: PlainNotification -> Async<unit> | ||
///Custom notification for initial workspace peek | ||
member NotifyWorkspacePeek: p: PlainNotification -> Async<unit> | ||
member NotifyCancelledRequest: p: PlainNotification -> Async<unit> | ||
member NotifyFileParsed: p: PlainNotification -> Async<unit> | ||
member NotifyDocumentAnalyzed: p: DocumentAnalyzedNotification -> Async<unit> | ||
member NotifyTestDetected: p: TestDetectedNotification -> Async<unit> | ||
member CodeLensRefresh: unit -> Async<unit> | ||
override WorkDoneProgressCreate: ProgressToken -> AsyncLspResult<unit> | ||
override Progress: ProgressToken * 'Progress -> Async<unit> | ||
|
||
type ServerProgressReport = | ||
new: lspClient: FSharpLspClient * ?token: ProgressToken -> ServerProgressReport | ||
member Token: ProgressToken | ||
member Begin: title: string * ?cancellable: bool * ?message: string * ?percentage: uint -> CancellableTask<unit> | ||
member Report: ?cancellable: bool * ?message: string * ?percentage: uint -> CancellableTask<unit> | ||
member End: ?message: string -> CancellableTask<unit> | ||
interface IAsyncDisposable | ||
interface IDisposable | ||
|
||
/// <summary>listener for the the events generated from the fsc ActivitySource</summary> | ||
type ProgressListener = | ||
new: lspClient: FSharpLspClient * traceNamespace: string array -> ProgressListener | ||
interface IDisposable | ||
interface IAsyncDisposable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace FsAutoComplete | ||
|
||
open System.CommandLine.Parsing | ||
|
||
module Parser = | ||
val parser: Parser |