Skip to content

v2.6.0

Choose a tag to compare

@github-actions github-actions released this 30 Nov 22:58
3376bd4
  • Security (GHSA-85q3-whq8-63qq): opening a Coconut file no longer runs code from the workspace. The language server started its compile worker with python -m in its working directory (in VS Code, the workspace), and Pyright and mypy with python -m in its mirror of the workspace, so a coconut package in the workspace, or a pyright.py or mypy.py next to an open file, was imported instead of the real one. It now starts them without the workspace on sys.path, and in auto mode only uses Coconut's own coconut --lsp if it does the same (Coconut 3.4.0 and later).
  • Type checking with Pyright, Coconut's recommended type checker: the new coconut.languageServer.pyright setting (pyright in Sublime Text) type checks on open and save, by default whenever Pyright is installed ("auto"), with errors mapped back to the Coconut source. mypy is still available with coconut.languageServer.mypy.
  • The coconut_check MCP tool type checks with Pyright by default when it's installed (pyright: false skips it), and the CLI's check takes --pyright.
  • Hover, completion, and the other language features work with the compiled code of newer Coconut versions, whose header has a # pyright: ignore comment.
  • VS Code: run code in the Coconut interpreter (evhub/coconut#668). As with Python files in the Jupyter extension, # %% lines split a file into cells, with Run Cell and Run Above/Below links on each. Ctrl+Enter (Cmd+Enter on macOS) runs the cell at the cursor, and Shift+Enter runs it and moves to the next cell. Without cells, Shift+Enter runs the selection, or the top-level statement at the cursor and moves to the next one. Code runs in a Coconut interpreter in the terminal, which keeps its state between runs; Open Coconut Interpreter now opens that same interpreter.
  • The bundled language server leaves infer_variance out of compiled TypeVars when type checking with mypy (which doesn't support it), with Coconut versions that infer variance, as coconut --lsp does, and shows Coconut's documentation when hovering over names imported from coconut.builtins.
  • Updated hover documentation from Coconut 3.4.0.