Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tag annot does'nt work #5226

Closed
vicuna opened this issue Feb 17, 2011 · 10 comments
Closed

tag annot does'nt work #5226

vicuna opened this issue Feb 17, 2011 · 10 comments

Comments

@vicuna
Copy link

vicuna commented Feb 17, 2011

Original bug ID: 5226
Reporter: daweil
Assigned to: @xclerc
Status: closed (set by meyer on 2012-09-10T03:25:35Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: any
OS: any
OS Version: any
Version: 3.12.0
Target version: 4.00.1+dev
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Monitored by: mehdi @Chris00

Bug description

because the file which is annoted is not the source file but the copy of the source file in the "_build" directory

Steps to reproduce

  1. add the folliwing line in your _tags file :
    <**/*.ml>: annot

  2. Compile : ocamlbuild main.byte

  3. Select a piece of code and type "C-c C-t" in emacs. Message "No annotation file : you should compile with option -dtypes" is printed instead of signature.

@vicuna
Copy link
Author

vicuna commented Feb 21, 2011

Comment author: @xclerc

Can you be a bit more specific?
Is the ".annot" file not generated, or generated but in the "_build" directory?

In latter case, it may be regarded as a bug but is consistent for example
with the way documentation is generated through ocamldoc.

@vicuna
Copy link
Author

vicuna commented Feb 21, 2011

Comment author: daweil

Yes, it is generated but it is unusable as the only way to get the signature of a fonction in emacs by C-c C-t is to open the copy of the source file in the _build directory.

@vicuna
Copy link
Author

vicuna commented Feb 21, 2011

Comment author: @xclerc

[a temporary workaround is to copy every '.annot' file from the '_build'
directory into your source directory after each build]

What do you think should be the behavior of ocamlbuild in this case?
Automate the aforementioned copy, create symbolic links, another option?

@vicuna
Copy link
Author

vicuna commented Feb 22, 2011

Comment author: @ygrek

IMHO this is not the problem of ocamlbuild, but of an editor. E.g. vim plugin searches .annot files in _build directory too.

@vicuna
Copy link
Author

vicuna commented Feb 22, 2011

Comment author: daweil

The workaround to copy .annot file into the source directory should work, but isn't it against the spirit of ocamlbuild which is to keep clean the source directory?

Do you mean that the editor should know where is the _build directory? (which is not necessary in the currrent directory) ?

How is it possible to tell emacs where is the _build directory?
This may be related to the other issue I have raised as "feature" for ocamlbuild :in a multi-directory project, how to call ocamlbuild from a sub-directory?
It would need some concept of "Root-directory" from which ocamlbuild is always called, and where the 'top' _tags file is define.
Emacs should be aware of this "Root-directory" for finding the .annot files.

@vicuna
Copy link
Author

vicuna commented Feb 22, 2011

Comment author: @ygrek

I for one prefer to work from the "root" directory. But editor could simply search all the hierarchy up to the fs root for the _build subdir (the same way as e.g. git finds .git subdir).

@vicuna
Copy link
Author

vicuna commented Feb 23, 2011

Comment author: @xclerc

I do agree that copying ".annot" file is against the philosophy
underlying ocamlbuild. Creating symlinks would be coherent
with documentation generation, but there would be a bunch
of such links.

So, which other options are on the table?

I would incline to think that ygrek is right when stating that
the problem is more likely to be handled by the editor.
The emacs/vi modes were designed before ocamlbuild came
to existence, and maybe updated to take the new tool into account.

@vicuna
Copy link
Author

vicuna commented Jul 19, 2011

Comment author: daweil

Back with ocamlbuild and the -annot option: you're right. The correction should be in the editor, more precisely in the tuareg.el files. I had a quick look in it. It seems that the the correction could be somewhere in the "caml-types-preprocess" function of tuareg-el, but I'm not an emacs expert...
Why not transfering the bug to the tuareg project :http://tuareg.forge.ocamlcore.org/
?

@vicuna
Copy link
Author

vicuna commented Jul 18, 2012

Comment author: berenger

It seems that recent GNU Emacs modes handle this properly
(the .annot files are looked for under the _build directory).

I tried on Ubuntu squeeze/sid with
ii ocaml-mode 3.11.2-1
ii tuareg-mode 1:1.45.6-2

@vicuna
Copy link
Author

vicuna commented Sep 10, 2012

Comment author: meyer

berenger, thanks, I'm closing it.

@vicuna vicuna closed this as completed Sep 10, 2012
@vicuna vicuna added this to the 4.00.1 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant