We clone the vscode repository, we lay down a customized product.json that has Microsoft specific functionality (telemetry, gallery, logo, etc.), and then produce a build that we release under our license. When we build Visual Studio Code, we do exactly this.
According to this comment from a Visual Studio Code maintainer:
Tab complete identifier, option, filename, etc.Microsoft’s vscode source code is open source (MIT-licensed), but the product available for download (Visual Studio Code) is licensed under this not-FLOSS license and contains telemetry/tracking.
Return to original position (requires Emacs 25) Jump to definition in source file ( lean-find-definition) Some of the main key bindings are summarized in the table below. Inserting an #exit therefore prevents Lean from checking the file beyond that point. In Lean, the #exit command halts processing of a file abruptly. If for some reason the Lean background process does not seem to be responding (for example, the information line no longer shows you type information), type C-c C-r or M-x lean-server-restart-process, or choose “restart lean process” from the Lean menu, and with luck that will set things right again.
Here is another useful trick: if you see some notation in a Lean file and you want to know how to enter it from the keyboard, put the cursor on the symbol and type C-c C-k. In tactic mode, if you put your cursor on a tactic (or the keyword begin or end) and type C-c C-g, Emacs will show you the goal in the lean-info buffer. If you have Emacs 25 or later, you can then press M-, to go back to the original location. This works even in an autocompletion popup window: if you start typing an identifier, press the tab key, choose a completion from the list of options, and press M-., you are taken to the symbol’s definition. If you put your cursor on an identifier and hit M-., Emacs will take you to the identifier’s definition, whether it is in the same file, in another file in your project, or in the library. As described in the previous section, this provides a convenient way to construct terms and proof interactively. Typing an underscore in an expression asks Lean to infer a suitable value for the expression and fill it in automatically. Pressing C-c C-n again toggles the mode off.Īs with VSCode, the Emacs mode provides context-sensitive tab completion.
You can position this window anywhere you want using Emacs commands for splitting windows and loading buffers. The keystrokes C-c C-n toggle Lean-Next-Error mode, in which the next message (or all the messages that occur on the line that the cursor is on, if there are any) appears in a buffer named lean-info. It is often inconvenient to have to put the cursor on a highlighted identifier to see an error message or the outcome of a #print or #check command. You can get to a help menu that lists these key bindings by clicking on the Fl圜 tag. For example, C-c ! n moves the cursor to the next error, and C-c ! p moves the cursor to the previous error. Flycheck offers a number of commands that begin with C-c !. Lean mode uses an Emacs package named Flycheck, as evidenced by the letters Fl圜 that appear in the information line.
Assuming the proof is correct modulo these missing pieces of information, the error message at an unfilled underscore tells you the type of the term you need to construct, typically an assertion you need to justify. You can start typing a proof sketch, using either sorry or an underscore for details you intend to fill in later. This can be extremely useful when constructing proofs incrementally. In cases where Lean is unable to determine a value for the argument, the underscore is highlighted, and the error message indicates the type of the “hole” that needs to be filled. Typing ctrl-shift-enter opens up a message window which shows you error messages, warnings, output, and goal information when in tactic mode. You can see the commands provided by the Lean extension by typing ctrl-shift-P on Windows/Linux or cmd-shift-P on a Mac, and then typing lean into the search bar to filter the list. You can enter Unicode characters with a backslash. These are context sensitive: if you are typing an identifier, it suggests suitable completions for identifiers, after import, it suggests modules to import, after set_option, it suggests suitable options, and so on.
VSCode Intellisense suggests completions as you type.