caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christian Lindig <lindig@cs.uni-sb.de>
To: Caml List <caml-list@inria.fr>
Subject: Announce: annot looks up types in *.annot files
Date: Wed, 17 May 2006 11:12:01 +0200	[thread overview]
Message-ID: <e5137f1ebc8bc508a64473c901b5cc20@cs.uni-sb.de> (raw)


To lookup types of identifiers from within Vim, I have implemented a 
small tool in Ocaml called annot:

	$ annot -type 30 20 main.annot
   	string list

Given a cursor position (line 30, column 20) it looks up the type 
annotation for that position in main.annot. It is trivial to hook this 
to a key in Vim, and probably most other editors.

function! OCamlType()
     let col  = col('.')
     let line = line('.')
     let file = expand("%:p:r")
     echo system("annot -n -type " . line . " " . col . " " . file . 
".annot")
endfunction
map ,t :call OCamlType()<return>

I'm well aware that Vim and Emacs have their own solutions, using their 
own scripting languages, but I think it is better to have one general 
solution.

You can download the tool from my subversion repository; it is released 
under a BSD-style license.

	svn co svn://svn.vistabella.de/annot

The tool should build on Unix systems, comes with ./configure, and a 
manual page. Let me know if there are any problems. Of course, positive 
feedback is also welcome.

-- Christian

--
http://www.st.cs.uni-sb.de/~lindig/


             reply	other threads:[~2006-05-17  9:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-17  9:12 Christian Lindig [this message]
2006-06-03 17:25 ` [Caml-list] " Nathaniel Gray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e5137f1ebc8bc508a64473c901b5cc20@cs.uni-sb.de \
    --to=lindig@cs.uni-sb.de \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).