GithubHelp home page GithubHelp logo

longde123 / vscode-ocaml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hackwaly/vscode-ocaml

0.0 2.0 0.0 1.57 MB

An extension for VS Code which provides support for the OCaml language.

TypeScript 100.00%

vscode-ocaml's Introduction

OCaml support for VS Code

This is an VS Code extension that provides OCaml language support.

Contributions are welcome. github repo

Features

  • Basic syntax highlighting for *.ml, *.mli, *.mly and *.mll. ported from textmate
  • Auto-completion (aka. IntelliSense). powered by ocamlmerlin
  • Error check on the fly (aka. Lint). powered by ocamlmerlin
  • Show type information on hover. powered by ocamlmerlin
  • Peek and goto definition (also provide a symbol list). powered by ocamlmerlin
  • Auto indent on your type. powered by ocp-indent
  • Debugger integrated. powered by ocamldebug
  • UTop integrated. since v0.6.2

features

debugger

Requirements

opam install merlin
opam install ocp-indent

Extension Settings

This extension contributes the following settings:

  • ocaml.ocpIndentPath: Path to ocp-indent.
  • ocaml.merlinPath: Path to ocamlmerlin.
  • ocaml.replPath.windows or ocaml.replPath.unix: Path to ocaml REPL, eg "ocaml.exe", "utop".
  • ocaml.lintDelay: Time to delay lint when made changes.
  • ocaml.lintOnChange: Do lint when made changes.
  • ocaml.lintOnSave: Do lint when save document.

Tips

1). In VS Code, *.ml is associated to F# by default, You need manually config this in settings.json to make OCaml mode work with *.ml file.

	"files.associations": {
		"*.ml": "ocaml",
		"*.mli": "ocaml"
	}

2). You need build with -bin-annot flag and set build folder in .merlin to get goto definitions works cross files.

3). Did you know vscode-ocaml works perfect with .vscode/tasks.json. Here is an example:

# Makefile
build:
	ocamlbuild -use-ocamlfind main.d.byte
clean:
	ocamlbuild -clean
.PHONY: build clean
// .vscode/tasks.json
{
	"version": "0.1.0",
	"command": "make",
	"showOutput": "always",
	"tasks": [{
		"taskName": "clean"
	}, {
		"taskName": "build",
		"problemMatcher": "$ocamlc"
	}]
}
// .vscode/launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "OCaml",
            "type": "ocamldebug",
            "request": "launch",
            "program": "${workspaceRoot}/main.d.byte",
            "stopOnEntry": false,
            "preLaunchTask": "build" // Build before launch
        }
    ]
}

Known Issues

See https://github.com/hackwaly/vscode-ocaml/issues?q=is%3Aopen+is%3Aissue+label%3Abug

Release Notes

0.6.0

Support launch debug target in Integrated Terminal. Add a command to switch between module implementation/signature. Support Find references in file. UTop integrated. More Info

0.5.0

Support debug variable paging. Support highlight occurrences and refactor in file. More Info

0.4.0

Add Windows debug support. Add remote debug support.

0.3.0

Add keywords completion. Add Menhir syntax over OCamlyacc syntax.

0.2.0

Add debugger (ocamldebug) support.

0.1.0

First published version.

vscode-ocaml's People

Contributors

hackwaly avatar db4 avatar bergus avatar gama11 avatar tcoopman avatar

Watchers

paling avatar James Cloos 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.