ionide / FsAutoComplete

F# language server using Language Server Protocol
Other
385 stars 151 forks source link
emacs fsharp language-server language-server-protocol lsp vim visual-studio-code

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:

Building and testing

Requirements:

  1. Restore dotnet tools to install local Paket dotnet tool restore
  2. Build FSAC with dotnet build

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

Creating a new code fix

Checkout this guide to start with a new code fix.

Releasing

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

Custom endpoints

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

Supported LSP notifications

Custom notifications

Additional startup options

Initialization options

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

Settings

Debug Settings

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

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: