fsautocomplete 0.57.4

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global fsautocomplete --version 0.57.4
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local fsautocomplete --version 0.57.4
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=fsautocomplete&version=0.57.4
nuke :add-package fsautocomplete --version 0.57.4

FsAutoComplete

NuGet version (FsAutoComplete)

The FsAutoComplete project (FSAC) provides a backend service for rich editing or intellisense features for editors.

It can be hosted using the Language Server Protocol.

Currently it is used by:

It's based on:

Required software

FsAutoComplete can run on .NET/mono or .NET Core. We highly recommend using .Net Core version of FSAC as we plan to remove the "full framework" version soon - read more

FSAC .NET Core

  • .NET Core Sdk (Required: >= 2.1, Recommended: >= 3.0 )

Building and testing

Requirements:

  • .NET Core Sdk, see global.json for the exact version.
  1. Restore dotnet tools to install local Paket dotnet tool restore
  2. Build FSAC with dotnet run --project build
  3. Optionally specify a target with the -t parameter: dotnet run --project build -t ....
  • To build release fsautocomplete binaries in ~/bin directory, use the LocalRelease target
  • To build, run all tests and create packages, use the All target

DevContainer

The repository additionally provides DevContainer definition that can be used with VSCode's Remote Containers extension - use it to get stable development environment

Gitpod.io

This repository is prepared to use Gitpod for a web-based VSCode-style IDE. Click the button below to begin!

Gitpod Ready-to-Code

Releasing

  • Update CHANGELOG.md with the release notes from the current release in the Unreleased section. Use section headings like Added, Fixed, etc from keepachangelog.com.
  • For individual section items in the Changelog, use headings like BUGFIX, FEATURE, and ENHANCEMENT followed by a link to the PR with the PR title.
  • Run the Promote FAKE target via the Promote target to create the appropriate release version from the current Unreleased section and stamp the date, as well as create a commit and tag for this promotion
  • push this commit and tag to main
  • the CI pipeline will publish a release from the tag.

Communication protocol

FsAutoComplete supports LSP as a communication protocol.

Supported LSP endpoints

  • initialize
  • textDocument/didOpen
  • textDocument/didChange
  • textDocument/didSave
  • textDocument/hover
  • textDocument/completion & completionItem/resolve
  • textDocument/rename
  • textDocument/definition
  • textDocument/typeDefinition
  • textDocument/implementation
  • textDocument/codeAction:
    • Remove unused open
    • Resolve namespace/module
    • Replace unused symbol with _
    • Fix typo based on error message
    • Remove redundant qualifier
    • Add missing new keyword for IDisposable
    • Generate cases for all DU case in pattern matching
    • Generate empty interface implementation
    • Fixes suggested by FSharpLint
  • textDocument/codeLens & codeLens/resolve:
    • signature Code Lenses
    • reference number Code Lenses
  • textDocument/formatting - powered by fantomas
  • textDocument/references
  • textDocument/documentHighlight
  • textDocument/signatureHelp
  • textDocument/documentSymbol
  • workspace/didChangeWatchedFiles
  • workspace/didChangeConfiguration
  • workspace/symbol

Custom endpoints

Custom endpoints are using (for messages body) PlainNotification type and string format serialized with exactly same serialization format as old JSON protocol

  • fsharp/signature - accepts TextDocumentPositionParams, returns signature of symbol at given position as a formatted string
  • fsharp/signatureData - accepts TextDocumentPositionParams, returns signature of symbol at given position as DTO
  • fsharp/lineLens - accepts ProjectParms (Project filed contain F# file path), returns locations where LineLenses should be displayed
  • fsharp/compilerLocation - no input, returns paths to FCS, FSI and MsBuild
  • fsharp/compile - accepts ProjectParms, tries to compile project, returns list of errors and exit status code
  • fsharp/workspacePeek - accepts WorkspacePeekRequest, returns list of possible workspaces (resolved solution files, or list of projects if there are no solution files)
  • fsharp/workspaceLoad - accepts WorkspaceLoadParms, loads given list of projects in the background, partial result notified by fsharp/notifyWorkspace notification
  • fsharp/project - accepts ProjectParms, loads given project
  • fsharp/fsdn - accepts ProjectParms (Project filed contain query string), query FSDN and returns list of functions
  • fsharp/f1Help - accepts TextDocumentPositionParams, returns URL to MSDN documentation for symbol at given position
  • fsharp/documentation - accepts TextDocumentPositionParams, returns documentation data about symbol at given position, used for InfoPanel
  • fsharp/documentationSymbol - accepts DocumentationForSymbolReuqest, returns documentation data about given symbol from given assembly, used for InfoPanel
  • fsproj/moveFileUp - accepts DotnetFileRequest, move the file down of 1 line in the project file
  • fsproj/moveFileDown - accepts DotnetFileRequest, move the file up of 1 line in the project file
  • fsproj/addFileAbove - accepts DotnetFile2Request, create the file if needed and add it above the reference file in the project if not already present
  • fsproj/addFileBelow - accepts DotnetFile2Request, create the file if needed and add it below the reference file in the project if not already present
  • fsproj/addFile - accepts DotnetFileRequest, create the file if needed and add it to the project if not already present
  • fsproj/addExistingFile - accepts DotnetFileRequest, add existing file to a project if not already present
  • fsproj/removeFile - accepts DotnetFileRequest, remove the file from the project

Supported LSP notifications

  • window/showMessage
  • window/logMessage
  • textDocument/publishDiagnostics

Custom notifications

  • fsharp/notifyWorkspace - notification for workspace/solution/project loading events
  • fsharp/notifyWorkspacePeek - notification for initial workspace peek

Additional startup options

  • --state-directory dir - a workspace-specific directory for keeping language server states.
  • --background-service-enabled - passing this flag enables background service feature, increasing FSAC responsiveness by moving some of the operations (especially background type checking) to other process. It results in increased memory usage. Used by default in Ionide.
  • --verbose - passing this flag enables additional logging being printed out in stderr
  • DOTNET_ROOT - setting this environment variable will set the dotnet SDK root, which is used when finding references for FSX scripts.

Initialization options

Options that should be send as initializationOptions as part of initialize request.

  • AutomaticWorkspaceInit - setting it to true will start Workspace Loading without need to run fsharp/workspacePeek and fsharp/workspaceLoad commands. It will always choose top workspace from the found list - all projects in workspace if 0 .sln files are found, .sln file if 1 .sln file was found, .sln file with most projects if multiple .sln files were found. It's designed to be used in clients that doesn't allow to create custom UI for selecting workspaces.

Settings

  • FSharp.keywordsAutocomplete - provides keywords in autocomplete list, recommended default value: true

  • FSharp.ExternalAutocomplete - provides autocomplete for symbols from not opened namespaces/modules, insert open on accept, recommended default value: false

  • FSharp.Linter - enables FSharpLint integration, provides additional warnings and code action fixes, recommended default value: true

  • FSharp.UnionCaseStubGeneration - enables code action to generate pattern matching cases, recommended default value: true

  • FSharp.UnionCaseStubGenerationBody - defines dummy body used by pattern matching generator, recommended default value: "failwith \"Not Implemented\""

  • FSharp.RecordStubGeneration - enables code action to generate record stub, recommended default value: true

  • FSharp.RecordStubGenerationBody - defines dummy body used by record stub generator, recommended default value: "failwith \"Not Implemented\""

  • FSharp.InterfaceStubGeneration - enables code action to generate interface stub, recommended default value: true

  • FSharp.InterfaceStubGenerationObjectIdentifier - defines object identifier used by interface stub generator,recommended default value: "this"

  • FSharp.InterfaceStubGenerationMethodBody - defines dummy body used by interface stub generator, recommended default value: "failwith \"Not Implemented\""

  • FSharp.UnusedOpensAnalyzer - enables unused open detections, recommended default value: true

  • FSharp.UnusedDeclarationsAnalyzer - enables unused symbol detection, recommended default value: true

  • FSharp.UseSdkScripts - enables the use of .Net Core SDKs for script file type-checking and evaluation, otherwise the .Net Framework reference lists will be used. Recommended default value: true. Current default value: true

  • FSharp.SimplifyNameAnalyzer - enables simplify name analyzer and remove redundant qualifier quick fix, recommended default value: false

  • FSharp.ResolveNamespaces - enables resolve namespace quick fix (add open if symbol is from not yet opened module/namespace), recommended default value: true

  • FSharp.EnableReferenceCodeLens - enables reference count code lenses, recommended default value: true if --background-service-enabled is used by default, false otherwise

  • FSharp.dotNetRoot - sets the root path for finding dotnet SDK references. Primarily used for FSX Scripts. Default value: operating-system dependent. On windows, C:\Program Files\dotnet; on Unix, /usr/local/share/dotnet

  • FSharp.fsiExtraParameters - an array of additional runtime arguments that are passed to FSI. These are used when typechecking scripts to ensure that typechecking has the same context as your FSI instances. An example would be to set the following parameters to enable Preview features (like opening static classes) for typechecking.

        "FSharp.fsiExtraParameters": ["--langversion:preview"]
    
Debug Settings

Settings to change internal behavior. Intended for debugging purposes and not for normal use.

  • FSharp.Debug.DontCheckRelatedFiles - usually checking a file involves checking related files too. This prevents this and limits file checking to just the current file.
    Default: false
  • FSharp.Debug.CheckFileDebouncerTimeout - Duration (in ms) of no user write activity (in practice: no LSP textDocument/didChange notification) before file checking gets triggered.
    Default: 250
  • FSharp.Debug.LogDurationBetweenCheckFiles: Logs duration between the start of to consecutive file checks.
    Default: false
  • FSharp.Debug.LogCheckFileDuration: Logs duration of file checking operation.
    Default: false

Troubleshooting

FileWatcher exceptions

You may see a stack trace finishing with System.IO.IOException: kqueue() error at init, error code = ’0’. This is due to a limitation in the number of file handles that the Mono file watchers can keep open. Restarting FsAutoComplete or the hosting editor should help. If not, try setting export MONO_MANAGED_WATCHER=disabled in your ~/.bash_profile. Note that on OSX, this setting will only take effect if you launch emacs from the terminal.

Maintainers

The maintainers of this repository are:

The primary maintainer for this repository is Krzysztof Cieślak)

Previous maintainers:

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.71.0 3,476 3/7/2024
0.70.1 2,965 2/13/2024
0.70.0 1,113 2/6/2024
0.69.0 1,890 1/14/2024
0.68.0 7,024 11/17/2023
0.67.0 2,657 10/28/2023
0.66.1 2,626 10/15/2023
0.66.0 1,408 10/15/2023
0.65.0 1,809 10/10/2023
0.64.1 2,038 10/6/2023
0.64.0 2,317 9/28/2023
0.63.1 2,355 9/18/2023
0.63.0 2,680 9/7/2023
0.62.0 3,880 8/21/2023
0.61.1 5,273 7/23/2023
0.61.0 2,671 7/16/2023
0.60.1 2,837 7/1/2023
0.60.0 2,128 6/15/2023
0.59.6 3,366 4/21/2023
0.59.5 1,337 4/21/2023
0.59.4 3,139 3/19/2023
0.59.3 1,515 3/19/2023
0.59.2 1,804 3/12/2023
0.59.1 2,573 2/26/2023
0.59.0 2,111 2/20/2023
0.58.4 2,260 2/4/2023
0.58.3 1,487 2/4/2023
0.58.2 4,413 11/8/2022
0.58.1 2,151 10/20/2022
0.58.0 1,933 10/9/2022
0.57.4 1,701 9/30/2022
0.57.3 1,860 9/27/2022
0.57.2 1,674 9/24/2022
0.57.1 1,400 9/23/2022
0.57.0 1,799 9/5/2022
0.56.2 2,021 8/19/2022
0.56.0 2,433 7/23/2022
0.55.0 1,869 7/12/2022
0.54.0 4,727 5/29/2022
0.53.2 2,076 5/13/2022
0.53.1 2,007 5/1/2022
0.53.0 1,393 4/30/2022
0.52.1 2,046 4/17/2022
0.52.0 2,869 4/14/2022
0.51.0 3,485 3/13/2022
0.50.1 1,753 3/12/2022
0.50.0 2,579 1/23/2022
0.49.6 1,756 1/16/2022
0.49.5 1,719 12/2/2021
0.49.4 2,483 11/20/2021
0.49.3 1,903 11/19/2021
0.49.1 1,731 11/14/2021
0.49.0 1,417 11/8/2021
0.48.2 1,807 10/27/2021
0.48.1 1,481 10/24/2021
0.48.0 1,515 10/23/2021
0.47.2 2,198 9/9/2021
0.47.1 1,622 8/5/2021
0.47.0 1,463 7/25/2021
0.46.7 1,682 6/29/2021
0.46.6 1,534 6/27/2021
0.46.5 1,538 6/21/2021
0.46.4 1,425 6/18/2021
0.46.3 1,589 6/17/2021
0.46.2 1,861 6/13/2021
0.46.1 1,683 6/9/2021

### Fixed

* * [Update LSP library so Code Actions calls don't crash anymore](https://github.com/fsharp/FsAutoComplete/pull/1018)