GithubHelp home page GithubHelp logo

modulexcite / fsautocomplete Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ionide/fsautocomplete

0.0 1.0 0.0 4.88 MB

F# compiler service API exposed via a console application

License: Other

F# 99.28% Batchfile 0.27% Shell 0.45%

fsautocomplete's Introduction

FsAutoComplete

This project provides a command-line interface to the FSharp.Compiler.Service project. It is intended to be used as a backend service for rich editing or 'intellisense' features for editors. Currently it is used by:

This README is targeted at developers.

Build Status

Travis Travis build status

The configuration is contained in .travis.yml.

AppVeyor AppVeyor build status

The configuration is contained in appveyor.yml.

Required software

  • F# 3.1
  • MSBuild 12

Windows

This can be obtained by installing Visual Studio 2013 or downloading:

Mono

  • Required: Mono >= 3.10
  • Recommended: Mono >= 4.0.2

Building and testing

There is a FAKE script with chain-loaders for *nix and Windows. This can be used for both building and running the unit and integration tests. It is also the core of the CI builds running on Travis and AppVeyor, and so also has the ability to run the Emacs unit and integration tests.

The integration tests use a simple strategy of running a scripted session with fsautocomplete.exe and then comparing the output with that saved in the repository. This requires careful checking when the test is first constructed. On later runs, absolute paths are removed using regular expressions to ensure that the tests are machine-independent.

There are unit tests for FSharp.CompilerBinding, which smoothes the integration with FSharp.Compiler.Service. The tests are simply constructed using NUnit.

Communication protocol

It is expected that the editor will launch this program in the background and communicate over a pipe. It is possible to use interactively, although due to the lack of any readline support it isn't pleasant, and text pasted into the buffer may not be echoed. As a result, use this only for very simple debugging. For more complex scenarios it is better to write another integration test by copying an existing one.

The available commands can be listed by running fsautocomplete.exe --commands. Commands are all on a single line, with the exception of the parse command, which should be followed by the current text of the file to parse (which may differ from the contents on disk), and terminated with a line containing only <<EOF>>.

Data is returned as JSON. An example of a simple session is:

project "Test1.fsproj"
{"Kind":"project","Data":{"Files":["<absolute path removed>/Program.fs"],"Output":"<absolute path removed>/bin/Debug/Test1.exe"}}
parse "Program.fs"
module X =
  let func x = x + 1

let val2 = X.func 2
<<EOF>>
{"Kind":"INFO","Data":"Background parsing started"}
completion "Program.fs" 4 13
{"Kind":"completion","Data":["func"]}

Each response is exactly one line, which simplifies the application of a JSON parser. For further insight into the communication protocol, have a look over the integration tests, which have examples of all the features. Each folder contains one or more *Runner.fsx files which specify a sequence of commands to send, and *.json files, which contain the output.

Maintainers

Tha maintainers of this repository appointed by the F# Core Engineering Group are:

fsautocomplete's People

Contributors

1tgr avatar 7sharp9 avatar alfonsogarciacaro avatar ashtonkj avatar berdario avatar bjwbell avatar dmohl avatar dsyme avatar forki avatar fsgit avatar funnelweb avatar gitter-badger avatar guillermooo avatar isiguta avatar kjnilsson avatar knocte avatar krzysztof-cieslak avatar migueldeicaza avatar nrolland avatar rneatherway avatar rojepp avatar satyagraha avatar slluis avatar tpetricek avatar vvilhonen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.