Giter Club home page Giter Club logo

nbcoq's Introduction

nbcoq : Coq plugin for Netbeans

NOTE: This plugin was delveloped for Coq version 8.4pl2. It does NOT work with 8.4pl3 or later versions because the xml communication protocol for coqtop was changed.

Key features :

  1. All of netbeans's features. I regularly use features like (regexp) search (and replace) content in a project (not just individual files), multiple windows (usually on multiple screens), live version control information. Given the drastic variation in pixel densities screens, the font of the proof window can be adjusted independently of the editor (click on the + or - button)

  2. Entering unicode content by entering the corresponding latex. This uses https://github.com/tomtung/latex2unicode . ((see keyboard shortcut below)

  3. Drag and drop gestures for working on proofs. My proof scripts have often too long variable names. It jused to be a pain to type them manually.

  4. Hypothesis with same type are bunched together. Saves a lot of space while working on messy proofs.

  5. Experimental support for jumping to definition (see keyboard shortcut below)

  6. A drop down for entering queries like SearchAbout, Check, Print , e.t.c. The dropdown remembers old queries. There is a checkbox to display query output on a separate popup window. This is useful to compare definitions.

  7. Experimental support for coqdoc-like syntax hihglihgitng using .glob files ; color categories include Variables, theorems, definitions, inductive definitions, constructors of (coInductive) types. If an uptodate .glob file is present, one can click SH to do syntax highlighting. After that, deleting contents preserves .glob based syntax highlighting. So does insertion and modification, except that the new text is not highlighted. For that, one has to compile again to create fresh .glob file and then click SH again. It should be possible to automate the compilation part.

Installation:

Download netbeans+java bundle http://www.oracle.com/technetwork/java/javase/downloads/jdk-netbeans-jsp-142931.html (If you already have JDK installed, you may just download netbeans (https://netbeans.org/). I've used (tested) this plugin ony with Oracle's JDK.)

Open netbeans. Click on team | git and clone this repo. It will find this netbeans project and ask if you wish to open it. Say yes.

Right click on the project node and click Install in Development IDE.

Prediodically, you might want to go a git pull to get the latest features (and bugs). If you do that, Right click on the project node and click Install in Development IDE and restart the IDE once the reload is finished (might take ~20 seconds to build).

There is an old and outdated video demonstration/documentation of this plugin at http://www.youtube.com/watch?v=94D5RVK-cQg (watch the video in HD to avoid blurred text)

You might want to go to Tools | Options | Fonts & Colors and set the profile to Norway Today. The highlighting colors are currently designed to work with this setting and cannot be customized w/o changing the plugin code. If you prefer a white backgroud, set ProofError.DARK to false in ProofSubgoal.java There is no syntax highlighting at the moment.

A list of known issues can be found at: https://github.com/aa755/nbcoq/issues?state=open Feel free to file bugs and feature requests if you encounter one.

If you make changes to the code fo this plugin, you can click Debug in netbeans menu for this project. It will open another instance of netbeans and let you debug the plugin code. You can visually set breakpoints, view variables and watches, e.t.c.

Shortcuts:

  1. for buttons, look at their tooltip text

  2. select and middle click in proof/message window to copy it into editor

  3. Ctrl+Alt+o : jump to definition. Issues a Locate command to coqtop internally.

  4. Ctrl+Alt+p : If nothing is selected, it Prints the item under cursor(works even in proof/mesg window). Otherwise, it issues a Check command on the selection.

  5. Ctrl+Alt+l : SearchAbout the item under cursor

  6. click on hyp-name button to copy in into editor

  7. drag and drop hyp-buttons to apply one hypothesis to another

  8. select and drag lemma name from any place (e.g. editor,the window which shows SearchAbout o/p) to hyp-button to apply

  9. Ctrl+Alt+l to convert selected latex text to unicode.

For another IDE built with many similar goals, checkout Coqoon http://itu.dk/research/tomeso/coqoon/

nbcoq's People

Contributors

aa755 avatar

Stargazers

Clément Pit-Claudel avatar Konstantin Sokolov avatar

Watchers

 avatar James Cloos avatar

nbcoq's Issues

misalignment on rewind

sometimes, rewind causes misalignment between IDE's state and coqtop's state(about green area).
unable to reproduce the bug right now; turned back on logging coqtop communication.

need to handle case when coqtop hangs.

kill the coqtop process, start a new one and compile to the last successfully compiled offset?
right now; the editor seems to become slightly unresponsive when this unhappens.
cursor movement works, but cannot type anything.
Check if it is possible to handle coqio in a thread which does not mess up with editor's core functions.
Probably, once I was not able to save the file when coqtop hanged -- this is really bad.

right now, coq io is done in a thread created by org.openide.util.RequestProcessor;

Jump to Definition when target in Large Files

Jump to Defn handler needs to wait till file is opened before searching in it.
When the target is in a large file which is not yet opened
, it cause NullPointerException because file isn't loaded yet.

Workaround : try again when the file containing is already opened.

selected item in subgoal list not updated

selected item in subgoal list not updated when state of the proof is changed.
need to reset it to 0 whenever on rewind/compilestep.
additionally, it would be good to scroll the list down to the bottom, so the number of subgoals becomes known

closing and reopening a file

  1. the associated coqtop state is intact : good
  2. keyboard shortcuts dont work anymore : bad. workaround : restart IDE

stopping coqtop externally in linux does not work

Unlike in Windows, where if coqtop is taking too long, one can find out the PID of the process (usually a coqtop process with max CPU usage) and stop it. This unlocks the compilation actions in the IDE navigator window so that one can issue fresh commands to coqtop. Nothing happens in linux.

HoTT-coq XML forest parse error

Queries like Print/ SearchAbout
do not output an XML tree, but a forest.
This violates one of the assumptions XML parser library.

Soln: artificially add a root node before sending it off to the parser

wierd IDE exception when remotely logging(RDP) into the computer running this pugin

java.lang.NullPointerException
at com.sun.java.swing.plaf.windows.XPStyle$Skin.getWidth(XPStyle.java:517)
at com.sun.java.swing.plaf.windows.XPStyle$Skin.getWidth(XPStyle.java:521)
at com.sun.java.swing.plaf.windows.WindowsScrollBarUI.paintThumb(WindowsScrollBarUI.java:193)
at javax.swing.plaf.basic.BasicScrollBarUI.paint(BasicScrollBarUI.java:429)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
at javax.swing.JComponent.paintComponent(JComponent.java:778)
at javax.swing.JComponent.paint(JComponent.java:1054)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5221)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1508)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1439)

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.