aboutsummaryrefslogtreecommitdiff
path: root/ide/ideutils.ml
AgeCommit message (Collapse)Author
2020-06-02Move CoqIDE to its own folderMaxime Dénès
The will make it possible to put a VsCoq toplevel in `ide/vscoq`.
2020-04-03Merge PR #11664: Encoding string list as a string with application to the ↵Emilio Jesus Gallego Arias
parsing of coqtop arguments in coqide Reviewed-by: ejgallego
2020-03-18Update headers in the whole code base.Théo Zimmermann
Add headers to a few files which were missing them.
2020-03-15Adding a function to encode/decode string list into a single string.Hugo Herbelin
This encodes/decodes a list of string into a string in a way compatible with shell interpretation. On the contrary of Filename.quote which is for computer consumption, it introduces quotes for human consumption. The strategy is to split each string into substrings separated by simple quotes. Each substring is surrounted by single quotes if it contains a space. Otherwise, each backslash in the substring is doubled. The substrings are concatenated separated by backslash-protected single quote. The strings are then concatenated separated with spaces. The decoding is shell-like in the sense that it follows the rules of single quote, backslash and space.
2020-02-16CoqIDE: allow opening multiple files at onceErika
2019-11-21[coq] Untabify the whole ML codebase.Emilio Jesus Gallego Arias
We also remove trailing whitespace. Script used: ```bash for i in `find . -name '*.ml' -or -name '*.mli' -or -name '*.mlg'`; do expand -i "$i" | sponge "$i"; sed -e's/[[:space:]]*$//' -i.bak "$i"; done ```
2019-09-10CoqIDE: Letting flash notices being treated sequentially.Hugo Herbelin
2019-06-17Update ml-style headers to new year.Théo Zimmermann
2019-03-19CoqIDE: Ensuring that load/save windows are not hidden by their parent.Hugo Herbelin
2019-03-19CoqIDE: Moving last use of gtk2-only FileSelection to FileChooserDialog.Hugo Herbelin
2019-03-19CoqIDE: Ensuring that gtk is initialized before other inits done in ideutils.ml.Hugo Herbelin
This seems fragile: does it depend on the order files are loaded? (It was working for gtk2 when gtk initialization was in coqide_main.ml but it does not work anymore for CoqIDE built on gtk3). Eventually, it might be needed to centralize all initialization side effects in one place.
2019-02-27[ide] only use Coq_config for the URL of the manualEnrico Tassi
2018-12-09[doc] Enable Warning 50 [incorrect doc comment] and fix comments.Emilio Jesus Gallego Arias
This is a pre-requisite to use automated formatting tools such as `ocamlformat`, also, there were quite a few places where the comments had basically no effect, thus it was confusing for the developer. p.s: Reading some comments was a lot of fun :)
2018-09-06Merge PR #8394: Print the entire string to the CoqIDE screen, e.g. for ↵Pierre-Marie Pédrot
"Print Options"
2018-09-05[bin] Fix binary location procedure to work with symlinks.Emilio Jesus Gallego Arias
In #7860 `Sys.executable_name` was introduced to locate coq private binaries; however, this breaks use cases with symlinks, such as Dune. In order to fix this, we adopt a simpler strategy; we will always adapt the name originally provided by the user, and only add a directory if it was originally present. This should work (hopefully) in all cases. This fixes `coqide` not working on Dune builds.
2018-09-03Fix for issue #8378. If the string matches the regex, output theJim Fehrle
part before the regex match with full highlights. (Duh)
2018-07-23Displays the differences between successive proof steps in coqtop and CoqIDE.Jim Fehrle
Proof General requires minor changes to make the diffs visible, but this code shouldn't break the existing version of PG. Diffs are computed for the hypotheses and conclusion of the first goal between the old and new proofs. Strings are split into tokens using the Coq lexer, then the list of tokens are diffed using the Myers algorithm. A fixup routine (Pp_diff.shorten_diff_span) shortens the span of the diff result in some cases. Diffs can be enabled with the Coq commmand "Set Diffs on|off|removed." or "-diffs on|off|removed" on the OS command line. The "on" option shows only the new item with added text, while "removed" shows each modified item twice--once with the old value showing removed text and once with the new value showing added text. The highlights use 4 tags to specify the color and underline/strikeout. These are "diffs.added", "diffs.removed", "diffs.added.bg" and "diffs.removed.bg". The first two are for added or removed text; the last two are for unmodified parts of a modified item. Diffs that span multiple strings in the Pp are tagged with "start.diff.*" and "end.diff.*", but only on the first and last strings of the span.
2018-05-21[stm] Make toplevels standalone executables.Emilio Jesus Gallego Arias
We turn coqtop "plugins" into standalone executables, which will be installed in `COQBIN` and located using the standard `PATH` mechanism. Using dynamic linking for `coqtop` customization didn't make a lot of sense, given that only one of such "plugins" could be loaded at a time. This cleans up some code and solves two problems: - `coqtop` needing to locate plugins, - dependency issues as plugins in `stm` depended on files in `toplevel`. In order to implement this, we do some minor cleanup of the toplevel API, making it functional, and implement uniform build rules. In particular: - `stm` and `toplevel` have become library-only directories, - a new directory, `topbin`, contains the new executables, - 4 new binaries have been introduced, for coqide and the stm. - we provide a common and cleaned up way to locate toplevels.
2018-03-08coqide: queries from the query window are routed there (fix #5684)Enrico Tassi
We systematically use Wg_MessageView for both the message panel and each Query tab; we register all MessageView in a RoutedMessageViews where the default route (0) is the message panel. Queries from the Query panel pick a non zero route to have their feedback message delivered to their MessageView
2018-02-27Update headers following #6543.Théo Zimmermann
2018-01-19update location on tab switch, issue 6624Paul Steckler
2017-11-13[ci] [coq] Complete 4.06.0 support.Emilio Jesus Gallego Arias
Due to an API change in laglgtk, we need to update CoqIDE. We use a makefile hack so it can compile with lablgtk < 2.8.16, another option would be to require 2.8.16 as a minimal dependency. We also refactor travis to test more lablgtk versions. We also need to account for improved attribute handling in 4.06.0, in particular module aliases will propagate the deprecation status. Fixes #6140.
2017-07-27deprecate Pp.std_ppcmds type aliasMatej Košík
2017-07-04Bump year in headers.Pierre-Marie Pédrot
2017-05-29Relying on computation done in Envars to discover the installation directories.Hugo Herbelin
This allows to share the test for possible relocalisation done in envars.ml.
2017-04-27Remove some unused values and typesGaetan Gilbert
2017-04-27Fix omitted labels in function callsGaetan Gilbert
2017-03-21[pp] [ide] Minor cleanups in pp code.Emilio Jesus Gallego Arias
- We avoid unnecessary use of Pp -> string conversion functions. and the creation of intermediate buffers on logging. - We rename local functions that share the name with the Coq stdlib, this is usually dangerous as if the normal function is removed, code may pick up the one in the stdlib, with different semantics.
2017-03-21[ide] richpp clenaupEmilio Jesus Gallego Arias
We remove the "abstraction breaking" primitives and reduce the file to the used fragment.
2017-03-21[pp] Make feedback the only logging mechanism.Emilio Jesus Gallego Arias
Previously to this patch, Coq featured to distinct logging paths: the console legacy one, based on `Pp.std_ppcmds` and Ocaml's `Format` module, and the `Feedback` one, intended to encapsulate message inside a more general, GUI-based feedback protocol. This patch removes the legacy logging path and makes feedback canonical. Thus, the core of Coq has no dependency on console code anymore. Additionally, this patch resolves the duplication of "document" formats present in the same situation. The original console-based printing code relied on an opaque datatype `std_ppcmds`, (mostly a reification of `Format`'s format strings) that could be then rendered to the console. However, the feedback path couldn't reuse this type due to its opaque nature. The first versions just embedded rending of `std_ppcmds` to a string, however in 8.5 a new "rich printing" type, `Richpp.richpp` was introduced. The idea for this type was to be serializable, however it brought several problems: it didn't have proper document manipulation operations, its format was overly verbose and didn't preserve the full layout, and it still relied on `Format` for generation, making client-side rendering difficult. We thus follow the plan outlined in CEP#9, that is to say, we take a public and refactored version of `std_ppcmds` as the canonical "document type", and move feedback to be over there. The toplevel now is implemented as a feedback listener and has ownership of the console. `richpp` is now IDE-specific, and only used for legacy rendering. It could go away in future versions. `std_ppcmds` carries strictly more information and is friendlier to client-side rendering and display control. Thus, the new panorama is: - `Feedback` has become a very module for event dispatching. - `Pp` contains a target-independent box-based document format. It also contains the `Format`-based renderer. - All console access lives in `toplevel`, with console handlers private to coqtop. _NOTE_: After this patch, many printing parameters such as printing width or depth should be set client-side. This works better IMO, clients don't need to notify Coq about resizing anywmore. Indeed, for box-based capable backends such as HTML or LaTeX, the UI can directly render and let the engine perform the word breaking work. _NOTE_: Many messages could benefit from new features of the output format, however we have chosen not to alter them to preserve output. A Future commits will move console tag handling in `Pp_style` to `toplevel/`, where it logically belongs. The only change with regards to printing is that the "Error:" header was added to console output in several different positions, we have removed some of this duplication, now error messages should be a bit more consistent.
2017-03-14[safe-string] ideEmilio Jesus Gallego Arias
No functional change, one extra copy introduced but it seems hard to avoid.
2016-08-30Fix bug #5051: Large outputs are garbled.Pierre-Marie Pédrot
Instead of relying on the current position of the cursor, we rather use a dedicated mark in the message view.
2016-08-29Fix inefficiency in CoqIDE display of tagged text.Pierre-Marie Pédrot
The helper code in LablGTK is algorithmically slow, so that we rather reimplement it as a small helper function.
2016-07-26Adding a flag in CoqIDE to configure UNIX/Windows line ending.Pierre-Marie Pédrot
Fixes both bugs #4924 and #4437.
2016-06-25[feedback] Remove unused tag on `Debug` level.Emilio Jesus Gallego Arias
IMO level indicators are not the proper place to store this information.
2016-05-31Feedback cleanupEmilio Jesus Gallego Arias
This patch splits pretty printing representation from IO operations. - `Pp` is kept in charge of the abstract pretty printing representation. - The `Feedback` module provides interface for doing printing IO. The patch continues work initiated for 8.5 and has the following effects: - The following functions in `Pp`: `pp`, `ppnl`, `pperr`, `pperrnl`, `pperr_flush`, `pp_flush`, `flush_all`, `msg`, `msgnl`, `msgerr`, `msgerrnl`, `message` are removed. `Feedback.msg_*` functions must be used instead. - Feedback provides different backends to handle output, currently, `stdout`, `emacs` and CoqIDE backends are provided. - Clients cannot specify flush policy anymore, thus `pp_flush` et al are gone. - `Feedback.feedback` takes an `edit_or_state_id` instead of the old mix. Lightly tested: Test-suite passes, Proof General and CoqIDE seem to work.
2016-01-21Merge branch 'v8.5'Pierre-Marie Pédrot
2016-01-20Update copyright headers.Maxime Dénès
2016-01-02Remove some useless type declarations.Guillaume Melquiond
2016-01-02Avoid warnings about loop indices.Guillaume Melquiond
2015-09-20Rich printing of messages.Pierre-Marie Pédrot
2015-09-20Adding rich printing primitives.Pierre-Marie Pédrot
2015-09-20Pluging in tag preferences into buffer printing.Pierre-Marie Pédrot
2015-08-26Replacing old-style preferences in CoqIDE.Pierre-Marie Pédrot
There is no remaining global preference record anymore, every preference is now defined in the new event-based style.
2015-08-16Turning CoqIDE preferences into new style.Pierre-Marie Pédrot
Some old style references remain because all type converters are not implemented yet.
2015-07-28Use open_utf8_file_in for opening files in the IDE. (Fix bug #2874)Guillaume Melquiond
File system.ml seemed like a better choice than util.ml for sharing the code, but it was bringing a bunch of useless dependencies to the IDE. There are presumably several other tools that would benefit from using open_utf8_file_in instead of open_in, e.g. coqdoc.
2015-04-03Use the directory of the current session for selecting files to open.Guillaume Melquiond
The old behavior was extremely annoying, especially when using coqide from the command line, since the "open" box would then point to a seemingly random point of the filesystem rather than to the directory of the files currently being edited (since they were passed on the command line rather than by point-and-click). The new behavior matches the one of mainstream editors, e.g. emacs, gedit.
2015-02-23Fix some typos in comments.Guillaume Melquiond
2015-02-15CoqIDE now remembers the path of the last opened project.Pierre-Marie Pédrot
Fixes bug #2762.
2015-02-13Hardcode how coqide have to look for coqtop in MacOS bundlePierre Boutillier
Sorry, that is ugly. Please revert if you see a better way to do it.