fsautocomplete 0.74.1
dotnet tool install --global fsautocomplete --version 0.74.1
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local fsautocomplete --version 0.74.1
#tool dotnet:?package=fsautocomplete&version=0.74.1
nuke :add-package fsautocomplete --version 0.74.1
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:
- FSharp.Compiler.Service for F# language info.
- Ionide.ProjInfo for project/solution management.
- FSharpLint for the linter feature.
- Fantomas for F# code formatting.
Building and testing
Requirements:
- .NET SDK, see global.json for the exact version. Minimum: >= 6.0, Recommended: >= 7.0
- Restore dotnet tools to install local Paket
dotnet tool restore
- Build FSAC with
dotnet build
- To build release fsautocomplete binaries in
~/bin
directory, use theLocalRelease
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!
Creating a new code fix
Checkout this guide to start with a new code fix.
Releasing
- Update CHANGELOG.md with the release notes from the current release in the
Unreleased
section. Use section headings likeAdded
,Fixed
, etc from keepachangelog.com. - For individual section items in the Changelog, use headings like
BUGFIX
,FEATURE
, andENHANCEMENT
followed by a link to the PR with the PR title. - Run the
Promote
FAKE target via thePromote
target to create the appropriate release version from the currentUnreleased
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.
OpenTelemetry
FsAutocomplete is using System.Diagnostics.Activity to create traces.
To export traces, run Jaeger
docker run -d --name jaeger \
-e COLLECTOR_ZIPKIN_HOST_PORT=9411 \
-e COLLECTOR_OTLP_ENABLED=true \
-p 6831:6831/udp \
-p 6832:6832/udp \
-p 5778:5778 \
-p 16686:16686 \
-p 4317:4317 \
-p 4318:4318 \
-p 14250:14250 \
-p 14268:14268 \
-p 14269:14269 \
-p 9411:9411 \
jaegertracing/all-in-one:latest
Then configure your environment
OTEL_EXPORTER_OTLP_ENDPOINT = "http://localhost:4317"
Start FsAutocomplete (either by code .
or dotnet fsautocomplete
)
Do some actions like opening documents, saving, getting tooltips, etc.
Then open http://localhost:16686/
to inspect traces.
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 forIDisposable
- Generate cases for all DU case in pattern matching
- Generate empty interface implementation
- Fixes suggested by FSharpLint
- Remove unused
textDocument/codeLens
&codeLens/resolve
:- signature Code Lenses
- reference number Code Lenses
textDocument/formatting
- powered by fantomastextDocument/references
textDocument/documentHighlight
textDocument/signatureHelp
textDocument/documentSymbol
textDocument/inlayHint
textDocument/inlineValue
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
- acceptsTextDocumentPositionParams
, returns signature of symbol at given position as a formatted stringfsharp/signatureData
- acceptsTextDocumentPositionParams
, returns signature of symbol at given position as DTOfsharp/lineLens
- acceptsProjectParms
(Project
filed contain F# file path), returns locations where LineLenses should be displayedfsharp/compilerLocation
- no input, returns paths to FCS, FSI and MsBuildfsharp/compile
- acceptsProjectParms
, tries to compile project, returns list of errors and exit status codefsharp/workspacePeek
- acceptsWorkspacePeekRequest
, returns list of possible workspaces (resolved solution files, or list of projects if there are no solution files)fsharp/workspaceLoad
- acceptsWorkspaceLoadParms
, loads given list of projects in the background, partial result notified byfsharp/notifyWorkspace
notificationfsharp/project
- acceptsProjectParms
, loads given projectfsharp/fsdn
- acceptsProjectParms
(Project
filed contain query string), query FSDN and returns list of functionsfsharp/f1Help
- acceptsTextDocumentPositionParams
, returns URL to MSDN documentation for symbol at given positionfsharp/documentation
- acceptsTextDocumentPositionParams
, returns documentation data about symbol at given position, used for InfoPanelfsharp/documentationSymbol
- acceptsDocumentationForSymbolReuqest
, returns documentation data about given symbol from given assembly, used for InfoPanelfsproj/moveFileUp
- acceptsDotnetFileRequest
, move the file down of 1 line in the project filefsproj/moveFileDown
- acceptsDotnetFileRequest
, move the file up of 1 line in the project filefsproj/addFileAbove
- acceptsDotnetFile2Request
, create the file if needed and add it above the reference file in the project if not already presentfsproj/addFileBelow
- acceptsDotnetFile2Request
, create the file if needed and add it below the reference file in the project if not already presentfsproj/addFile
- acceptsDotnetFileRequest
, create the file if needed and add it to the project if not already presentfsproj/addExistingFile
- acceptsDotnetFileRequest
, add existing file to a project if not already presentfsproj/removeFile
- acceptsDotnetFileRequest
, remove the file from the projectfsproj/renameFile
- acceptsDotnetRenameFileRequest
, rename the file from the project
Supported LSP notifications
window/showMessage
window/logMessage
textDocument/publishDiagnostics
Custom notifications
fsharp/notifyWorkspace
- notification for workspace/solution/project loading eventsfsharp/notifyWorkspacePeek
- notification for initial workspace peek
Additional startup options
--state-directory dir
- a workspace-specific directory for keeping language server states.--verbose
- passing this flag enables additional logging being printed out instderr
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 totrue
will start Workspace Loading without need to runfsharp/workspacePeek
andfsharp/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, insertopen
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 unusedopen
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 (addopen
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
otherwiseFSharp.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
- Extra parameters for FSI: use only
FSharp.FSIExtraParameters
on its own or a combination ofFSharp.FSIExtraInteractiveParameters
andFSharp.FSIExtraSharedParameters
. The former is expected to be deprecated in favor of the second two. See #1210 for more detail. FSAC will send a warning if you mix usage improperly.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.FSIExtraInteractiveParameters
- currently unused by FSAC, but available to editor plugins for interactivedotnet fsi
parameters that are not shared by the compiler. Future intentions are to manage the interpreter from FSAC, at which point FSAC will utilize this parameter. Check this reference for parameters that are interactive-only or shared with the compiler.FSharp.FSIExtraSharedParameters
- an array of additional runtime arguments that are passed to FSI; specifically parameters that are shared with the compiler. 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. Check this reference for parameters that are interactive-only or shared with the compiler."FSharp.fsiExtraSharedParameters": ["--langversion:preview"] "FSharp.fsiExtraInteractiveParameters": ["--readline-"]
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 LSPtextDocument/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:
Previous maintainers:
Product | Versions 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 is compatible. 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. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
0.74.1 | 10,859 | 9/7/2024 |
0.74.0 | 3,554 | 8/19/2024 |
0.73.2 | 6,963 | 6/17/2024 |
0.73.1 | 3,853 | 5/23/2024 |
0.73.0 | 1,979 | 5/15/2024 |
0.72.3 | 1,987 | 5/5/2024 |
0.72.2 | 754 | 4/30/2024 |
0.72.1 | 858 | 4/25/2024 |
0.71.0 | 7,719 | 3/7/2024 |
0.70.1 | 3,303 | 2/13/2024 |
0.70.0 | 1,414 | 2/6/2024 |
0.69.0 | 2,347 | 1/14/2024 |
0.68.0 | 7,459 | 11/17/2023 |
0.67.0 | 2,954 | 10/28/2023 |
0.66.1 | 2,884 | 10/15/2023 |
0.66.0 | 1,752 | 10/15/2023 |
0.65.0 | 2,112 | 10/10/2023 |
0.64.1 | 2,296 | 10/6/2023 |
0.64.0 | 2,633 | 9/28/2023 |
0.63.1 | 2,674 | 9/18/2023 |
0.63.0 | 2,917 | 9/7/2023 |
0.62.0 | 4,162 | 8/21/2023 |
0.61.1 | 5,518 | 7/23/2023 |
0.61.0 | 2,941 | 7/16/2023 |
0.60.1 | 3,128 | 7/1/2023 |
0.60.0 | 2,372 | 6/15/2023 |
0.59.6 | 3,570 | 4/21/2023 |
0.59.5 | 1,607 | 4/21/2023 |
0.59.4 | 3,274 | 3/19/2023 |
0.59.3 | 1,744 | 3/19/2023 |
0.59.2 | 2,054 | 3/12/2023 |
0.59.1 | 2,765 | 2/26/2023 |
0.59.0 | 2,423 | 2/20/2023 |
0.58.4 | 2,470 | 2/4/2023 |
0.58.3 | 1,700 | 2/4/2023 |
0.58.2 | 4,632 | 11/8/2022 |
0.58.1 | 2,304 | 10/20/2022 |
0.58.0 | 2,094 | 10/9/2022 |
0.57.4 | 1,905 | 9/30/2022 |
0.57.3 | 2,072 | 9/27/2022 |
0.57.2 | 1,771 | 9/24/2022 |
0.57.1 | 1,566 | 9/23/2022 |
0.57.0 | 1,942 | 9/5/2022 |
0.56.2 | 2,202 | 8/19/2022 |
0.56.0 | 2,669 | 7/23/2022 |
0.55.0 | 2,084 | 7/12/2022 |
0.54.0 | 4,938 | 5/29/2022 |
0.53.2 | 2,278 | 5/13/2022 |
0.53.1 | 2,215 | 5/1/2022 |
0.53.0 | 1,643 | 4/30/2022 |
0.52.1 | 2,306 | 4/17/2022 |
0.52.0 | 3,096 | 4/14/2022 |
0.51.0 | 3,691 | 3/13/2022 |
0.50.1 | 1,933 | 3/12/2022 |
0.50.0 | 2,776 | 1/23/2022 |
0.49.6 | 1,892 | 1/16/2022 |
0.49.5 | 1,947 | 12/2/2021 |
0.49.4 | 2,691 | 11/20/2021 |
0.49.3 | 2,124 | 11/19/2021 |
0.49.1 | 1,913 | 11/14/2021 |
0.49.0 | 1,648 | 11/8/2021 |
0.48.2 | 1,988 | 10/27/2021 |
0.48.1 | 1,707 | 10/24/2021 |
0.48.0 | 1,726 | 10/23/2021 |
0.47.2 | 2,391 | 9/9/2021 |
0.47.1 | 1,832 | 8/5/2021 |
0.47.0 | 1,691 | 7/25/2021 |
0.46.7 | 1,860 | 6/29/2021 |
0.46.6 | 1,726 | 6/27/2021 |
0.46.5 | 1,747 | 6/21/2021 |
0.46.4 | 1,683 | 6/18/2021 |
0.46.3 | 1,892 | 6/17/2021 |
0.46.2 | 2,079 | 6/13/2021 |
0.46.1 | 1,824 | 6/9/2021 |
### Added
* * [Allow generating match cases for DU cases when the match is empty](https://github.com/ionide/FsAutoComplete/pull/1309) (thanks @gbtb!)
### Changed
* * [Update Fantomas.Client to get fixes for global fantomas installs](https://github.com/ionide/FsAutoComplete/pull/1320) (thanks @nojaf!)
### Fixed
* * [Fix the floating code lens issues reported by many users](https://github.com/ionide/FsAutoComplete/pull/1319) (thanks @TheAngryByrd!)