So there aren't a lot of discussions here
Can someone guide a noob how to try the plugin locally?
hi! the room is fairly new ;)
for a noob, I'd recommend to wait for a few days that we do a marketplace release
but if you really can't wait, you can build the plugin and use vscode --install-extension
on the produced .vsix
file
"wait for a few days" :heart_eyes: :heart_eyes: :heart_eyes:
Hi, thanks a lot. Are you looking for feedbacks from users? For me the main drawback is that I have to open an instance for each _CoqProject I have in my project to have it at the root.
Otherwise I'm impressed, and in several respects it's better than Proof General, so thanks again.
Are you looking for feedbacks from users?
Sure!
For me the main drawback is that I have to open an instance for each _CoqProject I have in my project to have it at the root.
Good point. I believe VsCode has a notion of multi root projects, but I still haven't explored it.
Ok, good to know. :)
Thanks for the feedback!
Also, whenever I use the shortcuts to compile, I get a motherboard beep, even when it succeeds.
oh! which shortcuts do you mean?
"Interpret to point" and "Step forward" (maybe it's only on macOS where they are ctrl + command + arrow).
ah! yeah, it must be platform-dependent, I don't have this problem under Linux
we should probably change the default bindings on macOS then
don't hesitate to open a PR, if you find some keybindings that work better
they are defined around here: https://github.com/coq-community/vscoq/blob/d298a4ef686a0f69060ad16ef4a058717d20c8e7/client/package.json#L342
Yeah, I'll think about it. What is the bindng on linux where there is no command?
Ok!
on Linux, it's ALT instead of command
although the navigation ones are just ALT + key (no CTRL), otherwise it clashes with some desktop environments like gnome
Yeah, there's that to think about. I don't think ctrl + alt + arrow does much on macOS so that might be an option.
but as you can see in the file, we can define each binding per platform
so we are quite free in the choice
It might be related to your issue, but where is the information about remaining obligations supposed to be displayed?
you mean when using Program
?
Yes (or Equations in my case).
hmm not sure, let me test it
I can blindly type Next Obligation.
Thanks.
indeed I don't see them
would you mind opening an issue? I'll try to fix it.
Ok!
@Théo Winterhalter How did you call vscode under OS X (I installed the .app, I suppose you did as well)
Found it: using option "install code in PATH"
Is vscoq still maintained ? Last commit is from 2 years ago, and pr seems not examinated
it is maintained here: https://github.com/coq-community/vscoq
Thanks !
we haven't released a new version based on this fork, though
hopefully this week!
@Maxime Dénès It seems 'Open proof view" doesn't reopen the view any more, once I close it...
ah! it is true that I haven't tested in since the switch to webview
would you mind opening an issue? I'll try to fix it
@Maxime Dénès do you have some build instruction ? Or are they the same as previously ? I tried to hack the extension last year but I had to remove/upgrade some things in the package.yml before
client code seems compatible with typescript 3+, but not the ones in html_views and server
I'm quite impressed with the editor and functionality, great job @Maxime Dénès (and Christian J. Bell before)
@vlj make seems to do the job here
You'll then need https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix for installing @vlj
ok thanks
do you know how to run the tests ?
No, but I'd look into running npm test
, maybe in the folders with a test
directory? npm test
in server
does something, but seems to fail very early?
Error: Connection input stream is not set. Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'
I'm quite impressed with the editor and functionality, great job Maxime Dénès (and Christian J. Bell before)
Thanks a lot, @Matthieu Sozeau. Hopefully, this is just the beginning ;)
do you know how to run the tests ?
I haven't updated the tests, so I imagine they must be completely outdated.
I don't think we want to invest energy there at this time, at least not for the server-side, since we are going to re-architect a lot of things including inside Coq.
I'm experiencing a new problem on my side, in one of my files, stepping forward/backward or to point takes some time after I started writing something. It only happens in this one file (other files of the project don't seem to have this problem).
It's a bit hard to identify though…
Are there a lot of Equations / Program in between the points ?
It might be that the STM has more trouble handling these (just a guess)
No, it's not this.
The only thing I see is that I'm close to heavy unicode character expressions. Now that I'm working further in the file, the issue no longer appears.
@Maxime Dénès is it ok to submit a PR that port the code to typescript 3 ? With typescript 3 you can have a single "main" project and client, html_views, servers behaving as subproject, which in turn simplify the dev dependencies/ scripts/... since they are shared
@vlj sounds very good, I had also planned to use webpack for the main project, instead of just html_views
I'm experiencing a new problem on my side, in one of my files, stepping forward/backward or to point takes some time after I started writing something. It only happens in this one file (other files of the project don't seem to have this problem).
It's a bit hard to identify though…
If it is reproducible, even with some dependencies, feel free to open an issue, I can investigate.
@Maxime Dénès I'll try to make a smaller example than metacoq. :)
I’m wondering if it might be related to autocomplete/suggestions.
It seems to be waiting for the window to popup before stepping.
Unrelated, there is nothing that displays when goals are shelved. Only the error at Qed time.
It seems vscode does not work with 8.9.0, is that expected?
it is not expected, but it hasn't been tested much
do you get an error message ?
Nope, I couldn't gather anything. the coqidetop and proof worker are apparently running but nothing happens in the UI
No problems with 8.8.2 that I've been using (and @Théo Winterhalter as well)
I can make 8.9.1 work here
I can try 8.9.0
if you look at the "output" tab and select "Coq Language Server", do you see anything?
ah no but wait, my test was wrong
this time, I confirm it works for me even with 8.9.0
Ok, I'll try again
Fwiw, the released vscoq works up to 8.8 (with old vscode), any chance that's what you installed?
good point!
it's probably time to make a release to avoid this confusion
we can fix the remaining problems afterwards
do you have any idea how to retrieve the os in typescript ? using maybe vscode api
actually it's not necessary, vscode launch .exe even without extension on windows which is nice
@Maxime Dénès I opened a PR : https://github.com/coq-community/vscoq/pull/64 feel free to add comments so that I can update the code before merging
Coq cannot find coqidetop
when only coqidetop.opt
and coqidetop.bc
are installed (when building Coq locally using dune
). I don't see how to configure that
The workaround I use is to ln -s coqidetop.opt coqidetop
but that's quickly getting old :)
@Maxime Dénès about https://github.com/coq-community/vscoq/pull/64#pullrequestreview-294671858 I changed the way we generate the css and js path, it uses the uri + .with scheme, I saw in the webview sample git history that it was the previous way of doing (https://github.com/microsoft/vscode-extension-samples/commit/708bc3090845be767c92b0fe53fe855a0fdca985), the .AsWebviewUri function was apparently added quite recently to the vscode api.
with previous way it seems to work
when webpacking client I think I hit this issue : https://github.com/Microsoft/vscode/issues/70308 (ie error code 1 when starting server)
another info https://github.com/microsoft/vscode-extension-samples/issues/191
@vlj I see, wasn't aware of it. Maybe we should wait to get an upstream update on this issue, then.
the README.md files are the same in root directory and client ones ?
is there a way to ask coqtop to dump all the theorem/definition it has currently in its context ?
@Matthieu Sozeau VsCoq should now work fine with a Dune-built Coq
I just did a marketplace release. It is my first one, so I'm expecting some issues. Feedback is very welcome: https://marketplace.visualstudio.com/items?itemName=maximedenes.vscoq
Hooray!
@Maxime Dénès Thanks for the release! I'm eager to try it, however I'm having an issue: https://gist.github.com/jad-hamza/133698e142367e805025be85c440380b
(I also tried compiling the extension from master)
Woo, congratulations on the release! :tada:
@Brendan Zabarauskas Thanks!
@Jad Hamza do you have a coqidetop.opt
in the same directory as coqtop
?
@Maxime Dénès I'm now trying with a fresh install with coq dev (from opam), and I have both of these in my path. However now I'm getting coqtop is not running
in the status bar
@Maxime Dénès In the console, now I see it's calling coqidetop.opt -main-channel 127.0.0.1:port1:port2 -control-channel 127.0.0.1:port3:port4 -async-proofs on -Q . MyProject -R . Top
, and then an error saying coqtop-stderr: Don't know what to do with -R . Top
I reinstalled the extension and I'm not having this last error with coqtop is not running
, but still having the original one with Message: Request textDocument/documentSymbol failed unexpectedly without providing any details.
and then an error saying coqtop-stderr: Don't know what to do with -R . Top
This looks like the real problem, but it is super strange
why would Coq not recognize a -R
flag?
what do you have in your _CoqProject
?
I have the -Q . MyProject
I guess it recognizes the -R
flag but doesn't know what to do with it because there is already -Q
I can't reproduce it, though. coqtop
accepts -Q
followed by -R
could you post the full content of your _CoqProject
file in a gist?
@Maxime Dénès it is just one line, with -Q . MyProject
. To be clear I also cannot reproduce the error with -R . Top
at the moment, the only error I get is this now: https://gist.github.com/jad-hamza/133698e142367e805025be85c440380b
@Jad Hamza could it be a permission error? it seems that vscode can't launch coqidetop.opt
(see the EACCES error)
do you have a coqidetop.opt in the same directory as coqtop?
can you confirm it is the case?
could it be that coqidetop.opt
is installed only by the coqide
package? This would make no sense, as coqidetop
is really part of Coq, but...
@Maxime Dénès Here they're in the same directory:
user@pc:~/path$ eval $(opam env)
user@pc:~/path$ coqtop --version
The Coq Proof Assistant, version 8.10+alpha (October 2019)
compiled on Oct 3 2019 15:54:54 with OCaml 4.09.0
user@pc:~/path$ coqidetop.opt --version
The Coq Proof Assistant, version 8.10+alpha (October 2019)
compiled on Oct 3 2019 15:54:54 with OCaml 4.09.0
user@pc:~/path$ which coqtop
/home/user/.opam/ocaml-4.09.0-coq-dev/bin/coqtop
user@pc:~/path$ which coqidetop.opt
/home/user/.opam/ocaml-4.09.0-coq-dev/bin/coqidetop.opt
user@pc:~/path$ ls -l /home/user/.opam/ocaml-4.09.0-coq-dev/bin/coqidetop.opt
-rwxr-xr-x 1 user user 26692368 oct. 3 16:02 /home/user/.opam/ocaml-4.09.0-coq-dev/bin/coqidetop.opt
It seems coqidetop.opt
was installed when I installed the coq
package in opam
, should I also install the coqide
package?
I'm trying it now, to see if I can reproduce
(I'm not using opam usually)
I would hope that installing the coqide package is not necessary
Thanks! Do you install from source?
no, I use nix usually
btw, we should also check what's stored in the preferences
if you open the vscode preferences, and look in the vscoq ones, more precisely: "Coqtop: bin path"
is anything set there?
(file > preferences > settings then you can type coqtop in the filter)
No it's empty
hmmm
I'll try to set it to the above folder
so indeed, coqidetop.opt
is installed by the coq
opam package
unfortunately, I can't reproduce your problem
I just launched Coq 8.9.1 from VsCoq, after installing it using opam
and it worked fine
let's try coq.dev
maybe
I found where the -R . Top
was coming from (I had set it in the preferences in coq.args
from an old attempt at using vscoq :(
Seems to be working fine now! Sorry for the wasted time
still, the message was a bit strange, maybe there's something to improve there
were the arguments incorrectly parsed?
do you mean coqtop.args
?
Hm I closed vs code and cannot ctrl+z to see what was there, but I think I had: "coqtop.args": [ "-R . Top" ]
. Instead should have been [ "-R", ".", "Top" ]
maybe?
I think so, yes
I tried with the first value, and indeed coq does not start, although the error message is not exactly the same
I get "coqtop-stderr: Unknown option -R . Top"
which is clearer than the one you were getting, so still something strange going on
Have you tried in conjunction with a -Q . MyProject
from _CoqProject
?
ah no, right!
still the same error message
but ok, never mind I guess
at least it works ;)
:)
Yes thanks!
I'm looking at key bindings now, I see duplicate Step forward
, Step backward
, etc. (with different When
conditions), is that normal?
I'm not completely sure. They were there before (in the original VsCoq). I've noticed it, but not investigated (because there were more pressing issues to fix).
Feedback welcome if you figure out why they are here :)
Alright :) And one last thing, the steps forward and backward are working but not interpret to point
(nothing happens when I press the corresponding key combinations, which I have tried to change)
oh, that's again strange
when you right click and use "interpret to point" in the menu, does it work?
I tried once and it didn't work, then I tried again and it worked, and now the binding is working again (even after restarting code). Thanks!
you're welcome!
is it possible to ask coqtop for the definition/theorem not loaded by an Import ? To fill the "outline" view of vscode
it's likely possible with some regex but I fear some corner cases
@vlj Require foo. Print foo.
does it without an import, but Require
has still side effects, so _at least_ you'd want to do it in a separate coqtop
(side effects: foo
is in scope, and some declaration in foo
have effects — like typeclass instances from it)
ok
also I'm just a fellow user, maybe there's a smarter way? but it's more robust than regexes for sure
@Paolo G. Giarrusso but it doesn't list the symbol currently in the environment ?
I mean to Require and Print a symbol you must know that it exists
coq source code is a bit hard to read without experience in ocaml
@vlj oh, you want to know all theorems in some codebase. Ask on https://coq.discourse.group/.
I fear you’d have to find all .vo files in some directory, and require each of them. At least, I think you would get every Gallina definition in submodules. (Not sure you get non-Gallina definitions like Ltac etc.)
@vlj also, maybe https://github.com/Karmaki/coq-dpdgraph has useful code — that computes a dependency graph, but it must first find all theorems.
Still, > Advice: you need to use Require to load the module that you want to explore, but don't use any Import/Export command because the tool is then unable to properly group the nodes by modules.
hmm it looks like the parser of coq code in server doesn't work to retrieve symbols
@Maxime Dénès I have a webpacked version of server (not of client unfortunatly) : https://github.com/coq-community/vscoq/pull/69
parsing coq code on the vscode side is impossible
Coq's parsing is extensible
that's why I'm working on the separation of parsing and execution in Coq, so that IDEs can use Coq to parse documents
parsing coq code on the vscode side is impossible
(without reimplementing half of Coq in vscode)
:sparkling_heart:
(also it'd be great if functionality were kept on the coq side and shared across editors, tho I'm aware working on coq is hard)
OT: also based on the experience in Scala 2, it feels like typecheckers are the best argument for limiting mutable state
I get a lot of « Anomaly "cannot find Ascii in module Coq.Strings.Ascii."
Please report at http://coq.inria.fr/bugs/. » at random places.
Triggers here for instance https://github.com/MetaCoq/metacoq/blob/tauto/examples/tauto.v#L78 but also at several points in the file (this is the first occurrence).
It only happens if I interpret to point somewhere later in the file. If I go step by step I get no error.
What if you import ascii explicitely?
@Théo Winterhalter would you mind trying the same thing in CoqIDE?
it should be a good indicator of whether the bug is on the Coq side or the VsCoq side
I have to install it then.
ah ah :) sorry about that
I can’t really manage to make coqIDE work. But at least I was able to pinpoint the problem from the sole From MetaCoq.Template Require Import All.
(the problem appears when I only import this, and it doesn’t without).
The problem still happens with Require Import Ascii.
(I installed the CoqIDE dmg for the same version of coq I have but it still complains about inconsistent assumptions when loading metacoq.)
Ate you sure your install is consistent? E.g you don’t have an old MetaCoq somewhere in user-contrib or so?
Don’t think so. Even so, if proof-general and vscoq manage to import metacoq, so should coqide.
It might not like that I didn’t install coqide together with coq.
Yes, probably a version incompatibility
I don’t really want to debug coqide for this. Does jscoq support asynchronous compiling?
Oh it could be wrong initialization of ML-side references in the MetaCoq plugin
If we load (and use?) the plugin before importing ascii
Switching to coqlib would fix this
@Théo Winterhalter indeed the CoqIDE dmg has its own Coq and doesn't find libraries installed for the default one. Maybe share a minimized example?
It’s going to be hard since it seems metacoq has to be involved.
@Théo Winterhalter the alternative is opam install coqide
(if coq is opam-installed) :-|
Yeah I’ll do that.
Alright, the error is also present in coqide, sorry for bringing it up here.
no worries!
thanks for testing
@Maxime Dénès where does the coq parser split from main codebase happen ? I mean us there a branch ?
oh, it's not a split from the main codebase
it's a phase separation, rather
what do you mean by phase separation ?
So that one can request Coq to parse a document without executing it.
exactly
I heard that original author went to Facebook and never use coq after graduation. LOL
Things like this happen all the time. I'm not sure what exactly you find funny. Some people wish they could find a job related to Coq after graduation but do not always have such luck, while some others want to switch to other topics.
Thanks for the precision.
I'd like to change the highlighting colors in my vscoq, how do I know how to modify e.g. the text in the ProofView pane? All my hyps are flashy green which is a bit too flashy for me
No offence. Sorry about my word. I didn’t mean it’s funny. I think it’s a pity that great contributors will leave for such reasons. I hope coq(or such great things) could be, at least, a part time hobby, even without that luck.
@Matthieu Sozeau I made all colors themable, so if I didn't forget any, you should be able to customize them
you can "open workspace settings"
then use workbench.colorCustomizations
the color names are here: https://github.com/coq-community/vscoq/blob/d36f1b55e4ce19b7e55c129fa767cdb4a2976321/package.json#L524
if you're proud of your setup, you can even contribute VsCoq themes :)
Yep, I figured it out!
Not proud yet :)
I'm really starting to seriously wonder if people were saying Coq was slow in comparison to e.g. Lean just because the Emacs interface was SO slow. Developing proofs in VSCoq is a real breeze!
No offence. Sorry about my word. I didn’t mean it’s funny. I think it’s a pity that great contributors will leave for such reasons. I hope coq(or such great things) could be, at least, a part time hobby, even without that luck.
None taken. Indeed, for many people Coq continues to be a hobby after graduation, even when they cannot find a job around it either in research or industry. And fortunately, Coq is becoming more and more popular in industry which means that more and more people can actually find a job related to it, sometimes after having spent a few years on other topics. But in the case of C.J., I wouldn't be able to tell you, because I have never met them or talked to them personally.
@Maxime Dénès Fail Check foo bar
doesn't display the error in the output / notices buffer, strangely
Typing (*
inserts (**))
(two ending parens)
can you open issues? so that we don't forget
I've been fixing some in the past days, so it's really worth reporting
After I finish preparing my lecture :)
@Matthieu Sozeau For the second one, just type Cmd + / to comment a line, and Alt + Shift + A to comment selection.
The first will just open (* *)
on a new line.
Nice one
Anyone knows how to avoid the editor from highliting similar words when my cursor is on something. E.g. if my cursor is on Type
, all Types
in the document are highlighted and this is distracting.
Nevermind, found it, Selection Highlight
And Occurrences Highlight
@Matthieu Sozeau the speed issue is indeed why I gave up on Proof General
@Matthieu Sozeau re the missing output, it should be in the Info
view, but that's not shown automatically because of https://github.com/coq-community/vscoq/issues/55
@Maxime Dénès btw, while Matthieu run into https://github.com/coq-community/vscoq/issues/55, I'd like to gently plead for it if possible
and as I mention there, it's not clear the plans you describe are related/needed for fixing the more urgent UX issues
About speed issues, for large proof (like gappa generated one) it looks like vscoq struggle when opening file because it triés to par se it via pegjs
And pegjs parser almost never return anything useful, there is no symbole listing at all
yeah, we can probably simplify a lot the logic
if you have an example large file, don't hesitate to open an issue
Since it Will be superseeded by some coqtop feedback anyways does it make sense to remove pegjs parser completly ?
Ok
you still need to parse sentences for now
but yeah, we can probably do it very efficiently
I’m wondering again, why do we not want foo is defined
in vscoq if we want them in coqide and proof general?
why do we want them in coqide and PG?
in CoqIDE, it even prevents you from reading the error feedback while processing async proofs...
because the thing keeps jumping to the other tab
@Maxime Dénès I also think we want those
what's the use case?
first, "multiple tab" isn't convincing in practice
Proof General has only one, and it's better than what we have today in vscoq
I agree, but that doesn't explain why we need these info feedback
second, "foo is defined" is only redundant in the rare case where foo
literally appears in the source.
the rare case?
well, "rare" is provocative, but I'm typing some examples
Inductive foo := .
is the first counterexample
I'm lost
I'm pretty sure I can read foo
in your example
it generates foo_ind and whatsnot
ah lol ok
depending on the sort
so I think calling literal occurrences rare case is just wrong
that's provocative, but another example is coming...
For a better one, take:
Require Import stdpp.base.
Inductive foo := .
Section foo.
Context `(R: relation A) `{!Reflexive R}.
second, you still didn't say what was the use case for the "foo_ind is defined" message
that's honestly how I first learned about those things
similarly, in my example, I get Reflexive0 is declared
lol
I still think the outline would be better than these messages
maybe. But third, my actual worry is about using vscoq today, before the Info
are reclassified as Notice
or whatever
yeah, this we can talk about, we may want some kind of temporary measure
the Reflexive0
foo example, I'm really not convinced btw
either the name matters, and it should be written by the user
can I hijack this bikeshedding thread to ask how to actually add arguments to the coqtop invocation?
or it doesn't and you wouldn't care about the message
there is an option in the list but it only lets me edit the JSON
ah, good question
which lets me a bit clueless
the "temporary measure" is the most important part anyway :-)
on to Pierre's Q :-)
maybe the first question is why you want a VsCoq specific flag
?
i.e. why not put it in _CoqProject
oh
because I don't believe in the neoliberal project bullshit paradigm
not saying there are no use case
open quote close quote
sorry?
like, I want a scratchpad
to quickly typecheck stuff
usually I just fire up coqIDE
I'm afraid we support mainly project-centered stuff
and there is a neat option to change the flags
ga
even PG lets you do that -_-
@Pierre-Marie Pédrot seems you want sth. like "coqtop.args": []
plus, there are use cases even inside a project
yeah yeah, I'm not saying there are none, I
e.g. selectively enabling type-in-type
I'm explaining the state of affairs
ok
(I just did "Copy Settings as JSON")
well, having your IDE pass type in type but not coqc is a bit strange, no?
wdym?
is "coqtop.args": ["-type-in-type"]
the right syntax?
I think so
AFAIK there is no way to selectively compile a file with some flag
now I remember using it
using _CoqProject
ah!
nice XY problem, that's actually a good point
is there an open issue about it?
not that I know of
type-in-type has become local, right?
yes-ish
the kind of broken SR local
oh?!
well that's expected
like you do foo := bar
you can't just break locally the invariants of a type theory and expect that everything is fine
where bar has been compiled with type-in-type
yes
that breaks if you unfold
then when you unfold foo
you get in trouble
I hadn't realized that when I merged it
which is why the unimath people should be using well-scoped resize rules
but that's another story
you also didn't say it on the PR, did you?
didn't I?
at least we track it
maybe I preferred the global behavior then
the same issue goes for fixpoint checking
argh
it should be stored in the fixpoint, not in the definition
yeah, right
this is nonsense
like Private Inductive also
but it's the kind of broken-by-design feature
yeah
(people on coq/coq might also be interested ;-)
so, I'm not waging a lost in advance war
anyways
although the type-in-type à la impredicative-set was a bit better in this respect
lol yeah, wrong channel :D
back to my question, the answer is that there is currently no neat way to have specific flags
you can edit coqtop.args in the JSON
as suggested, right?
mkay
not super user-friendly but I can live with that
thx
let's try
it's fairly typical in the vscode world
AFAIK it's like PG where you edit the lisp...
screaming "JSON" running around is not going to convince me
neither does "ELISP!"
(... at least in CoqIDE we have a buffer-local set of values for that)
more concretely, there's IDE support for JSON editing which makes it less bad
(but I guess a PR for a nicer widget would be accepted)
(I have to learn typescript for that first)
(btw I thought that the OCaml folks had written BuckleScript bindings for VSCode)
(that would allow for the use of some more reasonable language)
for the client part, I think the language doesn't matter so much
for the server, though, I would definitely prefer a saner language
@Pierre-Marie Pédrot let us know if you succeeded in passing the flags
yep that worked thanks
I think it's possible to have on memory buffer in vscode
@vlj how do you mean?
@Maxime Dénès anyway, thanks a lot for your work here
There is this extension that seems to let you have scratch buffer https://marketplace.visualstudio.com/items?itemName=awesomektvn.scratchpad and there is a "virtual document" sample (but it's read only)
Hi, I've been using proof-general and company-coq in emacs, and am tryingout VSCoq. Very nice work so far! Something I'm missing is the ability to read the documentation like one does with company-coq with ctrl-h. Is this on the horizon or does one get that functionality in some other way in VSCode?
No idea, afaik company coq generate thé help file by running sphinx on coq doc and then par se thé html which is a bit complicated
But the doc is always in sync with coq features
@larsr Feel free to open a feature request. Maybe someone can contribute some feature like this. Maybe the interesting company-coq parts can be ported to VsCoq.
Hmm, I need an option to configure the coqtop called by vscoq to use hoqtop instead for coq-hott
@Matthieu Sozeau good point, feel free to open an issue
is there a hoqidetop.opt
installed by coq-hott?
hoqc
is just a script that sets -coqlib
and a few options, I understand because coq_makefile is not so flexible?
would be better to actually detect the right settings for the project instead of the current hackery
@Matthieu Sozeau as a quick hack, you can create another folder with binaries with standard names, and change the PATH through existing vscode settings
Any idea what are the color names associated to the "processed" part of the .v file, I'd like to change the background?
@Matthieu Sozeau unfortunately, this color seems to be hardcoded: https://github.com/coq-community/vscoq/blob/379e4fc9ef11af6f55165710cb7d5c3a8ce3097c/client/src/Decorations.ts#L59
I see, I don't know enough JS yet to try and make it configurable. Should not be impossible though, right?
it should be easy, yes
it's TS, not JS ;)
Right
Did someone succeed with vscoq + copies of hoq\* executables renamed in coq\* in the PATH ?
@Rehan MALAK I'd suggest just to set vscoq to call coqc -coqlib $hotts_stdlib
retried today without more success ... (changing coqtop.binPath
or coqtop.args
in package.json)
what do you get?
@Maxime Dénès
It works with a coqidetop.opt
in the PATH which mimics the hoqtop hoqchk hoqdep hoqc scripts...
:point_up: October 31, 2019 11:02 PM
Modifying coqtop.args
in package.json made the plugin entirely unusable but I don't want to modify the plugin configuration anyway.
@Matthieu Sozeau Have a look at https://github.com/coq-community/vscoq/pull/97 -- HoTT now ships with hoqidetop (https://github.com/HoTT/HoTT/pull/1176)
I've tested it, and can confirm that it works.
I’ve been wondering, the output window often opens with 61288:proofworker:35:0 STM: sending back a fat state
and it’s fairly annoying, especially since it overwrites what I might have been reading in the output window.
Is it normal?
@Théo Winterhalter not really, do you have a repro case?
I think it happens every time I’m working in a big file, and it fills the Output window with them (10 or so sometimes).
it must depend on the kind of tactics you use
or the commands inside a proof, I don't remember
Oh. I’ll try to see which ones do it.
maybe abstract
?
I don’t use it.
the message is emitted by the STM, but it is a bit surprising that it does so in non-debug mode
and anyway, we should handle it in a way that does not disturb the user, on the VsCoq side
I don’t know what STM stands for. Anyway, it doesn’t happen when I go through the script sequentially, it only works asynchronously it seems.
STM is the Coq component which handles async proofs ;)
Ok
I can’t manage to pinpoint where it comes from.
@Ramkumar Ramachandra nice!
@Matthieu Sozeau Unfortunately, I made a mess of https://github.com/coq-community/vscoq/pull/89, which my branch depends on. @Maxime Dénès is currently cleaning it up so it's suitable to merge (progress: https://github.com/coq-community/vscoq/pull/100). So, it'll be a while before https://github.com/coq-community/vscoq/pull/97 is rebased and merged: if you don't want to wait, I recommend you just use my branch for now.
@Maxime Dénès how hard would it be to handle multiple _CoqProject files (just being able to configure the _CoqProject to use per folder would be enough in my case) ?
not sure what this would mean, aren't we supposed to have one _CoqProject
file per project?
are the various folders corresponding to different projects?
For metacoq we build several stuff and each have its own _CoqProject
in different folders yes.
I didn't now this was supported on the Coq side, TBH
the documentation seems to be written assuming there's only one such file per project, no? https://coq.inria.fr/distrib/current/refman/practical-tools/utilities.html?highlight=_coqproject
where is the multiple project files layout documented?
(it doesn't seem too hard to support, but of course I need a spec of which settings apply where)
You can just think of it as having one repository with two folders each with its own _CoqProject file. The same issue already appears when you want to process files in _build_ci in Coq: each project might have its own _CoqProject.
What I would like is that when I open a file in folder foo/ I get the options in foo/_CoqProject. Basically taking the "closest" _CoqProject file would do
Note that PG already handles this (I don’t know how though).
I also would like to have this for projects that use submodules (certicoq uses that for example)
I think from the VsCoq perspective, we'd need to support multi project workspaces
https://code.visualstudio.com/docs/editor/multi-root-workspaces
Yep, that's another way
well, from the name, I imagine _CoqProject
was intended as a description of a project, no?
@Matthieu Sozeau did you try to open one of the folders, and then add the other to your workspace?
maybe this way it picks up the right _CoqProject
for each file, depending on which project it belongs to
if it doesn't, I guess we can consider it a VsCoq bug
What I mean is: if you were to look for _CoqProject
at the root of each project in a multi-root workspace it could work too. But that wouldn't handle the submodule case
why wouldn't it work for the submodule case?
(I'm not very familiar with all this stuff, and I've always found the Coq documentation very sparse on it, so sorry if my questions are naive)
The documentation has always been severly lacking indeed. And all of this might go away soon with Dune...
In the submodule case I was thinking we would not use multi-root workspaces, but allow to get the closest _CoqProject instead
well, the submodule is usually another project, really, no?
but I don't know if vscode would allow adding it to the workspace as an independent project
The coqtop will point to the enclosing Coq though...
Yep, not sure either
coqtop?
do you use several copies of coq?
The coqtop with which you will want to run the submodule code
I'm a bit lost, what does coqtop have anything to do with this?
you mean vscoqtop? and do you really have different copies, or do you simply mean the options that should be passed to it?
I'm just saying the two projects are linked somehow. If I want to build/run interactively something in _build_ci/ with the coqtop that is in _build/
Hi, I was wondering what is the planned release schedule or whatever, it seems there were a lot of modifications recently so I wondered if you planned on releasing them soonish.
Anyway there are serious synchronisation problems when files are large.
(This is a video showing the problem, because I don’t know how to reproduce it, I think it’s linked to synchronisation because the problem only occurs after edits of the text. Most of the time it’s faster to reload vscoq entierly!)
yeah, I also restart vscoq periodically; it’s hard to tell which issues are due to async proofs, and which are due to vscoq specifically
(but restarting vscoq still seems faster than using proof general :-| )
(but let’s see if that’s the same issue I have)
Yeah it’s still faster than PG haha. But that means there is potential for something much much faster.
there were a lot of modifications recently
not really, were there?
but yeah, master has an important fix related to sync issues
so expect a release very soon
but the fixed issue is only when you use vscode's undo
so I'm not sure if it is your problem
I've also made significant progress on the document manager
getting rid of the server in VsCoq should fix a lot of these issues
Well I use vscode's undo often, so hurrah! (In fact, I also use the undo from a vim emulation plugin, which seems visibly separate).
prettify-symbols-mode often malfunctions for me, although reloading the window often fixes the issue.
How can we get rid of the VsCoq server though? IIUC, coqidetop doesn't speak LSP.
I also use the undo from a vim emulation plugin
Yeah, this one did not have the bug, that's why I didn't notice it initially
How can we get rid of the VsCoq server though? IIUC, coqidetop doesn't speak LSP.
I'm implementing another toplevel on the Coq side, based on a document manager, which speaks LSP
Oh, nice! Can you point me to the branch or PR?
it's not usable yet, and the code is unreadable https://github.com/maximedenes/coq/tree/document-manager
Ok cool! I’m looking forward to this. Thanks a lot!
Cool. Looks like it's going to take a while.
So there are going to be four toplevels: coqtop
, coqtop -emacs
, codeidetop
, and vscoqtop
. After the merge, I hope more users move to vscoqtop
-- all editors have lsp support (some via packages), and it's a well-designed protocol.
well, that's not LSP, it's LSP + extension
but yeah, the idea is to make the life of all IDEs easier
IIUC, you'll need to augment LSP with some extra commands for ProofState and the like.
well, it is more or less the protocol that the VsCoq client speaks already
Right.
Btw, I cleaned up a few of my PRs, and they should be easy to review. Let me know when you get around to them: I can clean up the build-flattening part from #89 too, after #101 is merged.
yeah, I'll try to have a look quickly
like this week
Okay.
Everytime I open a file I get the error:
[Error - 10:50:42 AM] Request textDocument/documentSymbol failed.
Message: Request textDocument/documentSymbol failed unexpectedly without providing any details.
Code: -32603
Is this normal?
@Théo Winterhalter I think it is not. Most likely VsCoq fails to declare that it does not support textDocument/documentSymbol
would you mind opening an issue?
Ok!
Hi folks! New user coming to Coq from Scala/OCaml/etc. Very happy to be able to develop proofs inside VSCode. I have some questions regarding missing features. I am happy to create as issues and also help work on myself!
Are these features straightforward/mechanical to add? Case split seems to be the only one that requires semantic information.
@Narek Asadorian some of the data for completion lives in data files in the plugin
IIRC there's an issue about generating them automatically, but I'm not sure how much progress on them there was.
Thanks @Paolo G. Giarrusso, yes I see the JSON file with the "snippets". I can manually add some and create a PR.
Automated does sound a lot nicer though.
Does the case split thing sound feasible at all?
Dunno, but luckily I'm not the maintainer. I'm not aware of that feature in CoqIDE either tho.
I see, I should try out CoqIDE to get a feeling for what's possible.
Have not tried Proof General either, but I'm not an emacs person :)
Hello everyone. While walking through proofs, after a few minutes, this error appears at the end of lemma declarations, right before Proof.
:
coqtop-stderr: 1496:proofworker:1:0] Slave: critical exception: Anomaly
"cannot find D0 in module Coq.Numbers.Cyclic.Int31.Int31."
Please report at http://coq.inria.fr/bugs/.
Does anyone have an idea how to solve this issue? Thanks in advance.
This looks like a Coq bug, but you can open an issue on the VsCoq repo with instructions on how to reproduce
I can have a look and forward to Coq or fix in VsCoq, depending on the nature of the bug
I’m unsure how to reproduce the bug, it just randomly appears when I am opening Coq files. I have tried reinstalling Coq, but that doesn’t fix it. Should I reinstall VSCode too, in your opinion?
I would be surprised if reinstalling fixes it
But it probably isn't really random
maybe triggered by a complex chain of actions
I’ll try on simple proofs first, and might open an issue if I can reproduce the bug correctly. Thanks for the advice.
Sorry for the inconvenience
One cannot solve every single bug
And I asked before even trying to find the source, in case the bug already happened before.
I’ll keep you updated! :)
It is both linked to the SMTCoq library and VSCoq. I submitted an issue about that:
https://github.com/coq-community/vscoq/issues/114
Thanks, I'll try to have a look when I can
@Maxime Dénès Is there any hope of having a release soon? The sync problem is really annoying. It’s a shame there is no beta channel on the vscode marketplace.
sure, I was planning to do one today
sorry for the delay
Nice!
It would be great to make the coqtop binary configurable and not just its path, e.g. for HoTT :)
there's a PR for that, but I'm afraid it introduces a regression on Windows (not sure), I'll comment there
@Matthieu Sozeau see https://github.com/coq-community/vscoq/pull/97
Is there a reliable way to quit / kill coqtop from vscoq?
For now the fastest seems to use « Developer: Reload widow ». « Coq: Reset », « Coq: Quit », and « Coq: Finish computations » seem to all wait for some things to finish when I want to interupt because of sync problems.
finish is something else, but I would expect reset and quit to terminate Coq even in the middle of a computation
not sure what the difference is between the two
Ok well, when I’m waiting for some sync to happen after edit, it seems I have to wait for it to be done before it quits.
I'd be interested in a repro case, if you manage to get one, but I imagine it is difficult
Maybe it’ll all go away with the next update.
But I still haven’t found out what was the origin of the problem. I used to think it was large files, but that’s not the case, in the same project I have a 8000+ lines file where this problem doesn’t occur.
I'm afraid there's a fundamental problem
Coq's interaction model assumes some regions are untouchable
i.e. cannot be edited, in certain states
I’m trying to pintpoint the problem again.
Usually when I have the problem, some regions will be green-coloured for some time before Coq realises they should not. Sometimes it’s old code that is after new editions, sometimes it’s new code that being typed.
But the main case is when I’m writing a proof, so I’m not editing untouchable region, I’m editing where I should be I think.
I think (but I'm not sure), that in the model there are some states (e.g. Coq computes / parses) where you are supposed to edit nowhere
the clean way to fix this is to lift these restrictions from Coq by implementing a proper document manager (this is what VsCoq's server emulates)
I started to work on it, but I need more time to complete it
Yeah I know.
meanwhile, I think I'm going to make a release even without #97, since this important sync fix has been waiting for too long already
we can anyway make a new release soon
I really can’t manage to find a reason for the bug. I tried taking only prefixes of the file to find the smallest with the problem, but I can’t find a clear turning point, there are different degrees of delays…
I also failed to reproduce it :(
it does occur in https://github.com/coq-community/vscoq/issues/116 though
fairly reliably
I'm going to study that performance problem, hoping it could also explain the out-of-sync scenarios
It might be the same kind of problem yes.
@Maxime Dénès I've fixed #97, but don't have a Windows machine to test the changes: would you like to take a look?
@Ramkumar Ramachandra thanks, I'll have a look next week. If it works properly, I'll integrate and make a new release.
(I did one today for the important undo-related fix)
Thanks for the update! :)
Unfortunately, my problem is still present, stepping forward afer writing idtac.
still takes 20s. I guess it’s the same as #116. (But again, I’m not convinced that files being large is the only thing at fault here, I have large files without troubles, and one of my office mates reports having the issue with pretty small files as well, I’ll try to get my hands on such files.)
@Maxime Dénès @Théo Winterhalter for me, as soon as Coq diverges, often Coq: Reset
will "reset" Coq but leave the old one running — I usually notice when my fan spins up.
does any of you have code where Coq: Reset
works?
Not really…
okay, so @Maxime Dénès must have such an example.
@Théo Winterhalter are you also on Mac? I've seen my share of Mac-specific bugs
Yeah I’m on macOS.
But my officemates aren’t and they also report issues like this. They seem to complain about it more than I do.
(They’re on Ubutun/Debian)
Actually, is there a way to set a default timeout for tactics, other than by overriding each of them? Right now when a tactic loops and I restart VsCoq, I manually type timeout 1
before trying again.
Hello, how can I find the name of the colors to customize, for instance for the (green) background of the already processed part of the file? I looked in https://github.com/coq-community/vscoq/blob/master/package.json but it doesn't look like this color is defined here
Looks like it's hard-coded? https://github.com/coq-community/vscoq/blob/6123dc9777a7d499f9b75cc0be298918182ade89/client/src/Decorations.ts#L59
Speaking about colors, the Qed
keyword sometimes takes the incomplete
color from this Decorations.ts
file, even when there are no errors, is this a known issue?
@Jad Hamza I thought that purple was just "proof checked by a parallel worker", based on its behavior
but the comment suggests that's not intended so you're right
Looks like it's hard-coded? https://github.com/coq-community/vscoq/blob/6123dc9777a7d499f9b75cc0be298918182ade89/client/src/Decorations.ts#L59
Modifying this worked for the background color, I also made it highlight the whole line for processed regions (instead of just the text) as in proof general
When a command takes a long time, is there a away to stop/interrupt it without losing the progress in the file? Coq: Interrupt
seems to have no effect, and Coq: Reset
and Coq: Quit
come back to the beginning
@Jad Hamza I thought the Qed not changing color was due to the proof not being "joined back" to the main process, but maybe it's a bug
@Jad Hamza If I understand correctly, currently there is no hook to tell coqtop
to interrupt the current computation so vscoq can only kill it. It should be implemented at some point in the future.
@Matthieu Sozeau yes I see it only happen when Qed
"finishes" before its proof I think
@Théo Winterhalter Ah cool! How does it work in Proof General and CoqIde?
I don’t know. :-/
The message which is displayed in Proof General when interrupting ("User interrupt.") comes from here: https://github.com/coq/coq/blob/3449c8a088e9a902ebc73478667f4f25d6c08d2a/checker/checker.ml#L252 so maybe it's enough to send a signal to the coqtop
process?
(or here: https://github.com/coq/coq/blob/3449c8a088e9a902ebc73478667f4f25d6c08d2a/vernac/himsg.ml#L1373)
Hmm VsCoq does send a SIGINT signal to coqtop
@Jad Hamza I either use timeout
first if I know (e.g. Ltac firstorder := timeout 1 firstorder
) or “Cmd-Shift-P -> Developer: Reload Window”. You don’t even need to save files.
I know by heart because it’s a regular part of my workflow.
:worried:
(and I still prefer vscoq over proof general because of async proofs, despite vscode's inferior unicode input methods, vim emulation, and vscoq bugs)
Yes reload window works nice, but it loses progress :( What does interrupt do for you?
I have a workaround that works for me: https://github.com/coq-community/vscoq/issues/123
@Jad Hamza wat
(I’ve only ever tried the red button on the status bar at the bottom, and it never worked)
do you know what coqide does? hopefully that’s correct (since coq devs use linux and coqide is apparently usable there)
I also see the "User interrupt." message in CoqIde so probably also a SIGINT signal?
The red button (or the Coq: Interrupt
command used with a shortcut) works with this workaround
@Jad Hamza send a PR and let's have somebody familiar with CoqIDE review it? If I have time I'll try that soon
I don't think it's the right way to do it, I completely removed the XML part, I thought that could be discussed in the issue
on Coq: Interrupt
, a month passed, so I took the liberty to file a PR with that fix, since this is a critical major bug in practice: https://github.com/coq-community/vscoq/pull/127.
It does work under some minimal testing.
Thanks :)
Hi, I am in the process of exporting gitter channels (public) data to zulip, (it can be done only once, during the creation of the zulip chatroom), do you wish that I export the data of this channel too?
what's the zulip server?
@Cyril Cohen why not, I couldn't catch up with the discussion yet
Last updated: Jun 04 2023 at 23:30 UTC