Skip to content

core: python cargo feature, compile_permissive, error positions on RtlCompileError#4

Merged
shigarov merged 1 commit into
mainfrom
rtl-lsp-core
Jul 11, 2026
Merged

core: python cargo feature, compile_permissive, error positions on RtlCompileError#4
shigarov merged 1 commit into
mainfrom
rtl-lsp-core

Conversation

@shigarov

Copy link
Copy Markdown
Contributor

Prerequisites for the standalone RTL language server (vscode-rtl plan §3.2):

  • Cargo feature python (default on) gates every pyo3 touch point: the py module, CoreErr::Py, PyFunc (an uninhabited enum without the feature), EvalEnv.py_table (via the PyTableHandle alias) and External/Custom callback dispatch. cargo build --no-default-features yields the pure-Rust core; CI now runs clippy + tests in that mode.
  • Enum pyclass attributes moved to cfg_attr with class-level rename_all = "SCREAMING_SNAKE_CASE" (variant-level #[pyo3(name)] helpers do not survive cfg_attr); Python-visible names are unchanged — the full pytest suite (1908 tests) passes.
  • compile_permissive(rtl): an unbound EXT('name') becomes the always-true ExternalUnbound stub instead of a compile error, for standalone editing without host-runtime Bindings; everything else is checked exactly as in compile.
  • RtlCompileError exposes .line (1-based) / .col (0-based) attributes, None when unknown.

Consumed by regtab/vscode-rtl (server/, rtl-lsp).

🤖 Generated with Claude Code

…lCompileError

Prerequisites for rtl-lsp (vscode-rtl plan §3.2):

- New cargo feature `python` (default on) gates every pyo3 touch point:
  the py module, CoreErr::Py, PyFunc (uninhabited enum without the feature),
  EvalEnv.py_table (via the PyTableHandle alias) and the External/Custom
  callback dispatch. `cargo build --no-default-features` yields the pure-Rust
  core; CI runs clippy + tests in that mode.
- Enum pyclass attributes moved to cfg_attr with class-level
  rename_all = "SCREAMING_SNAKE_CASE" (variant-level #[pyo3(name)] helpers
  do not survive cfg_attr); Python-visible names are unchanged (pytest: 1908).
- compile_permissive(rtl): unbound EXT('name') becomes the always-true
  ExternalUnbound stub instead of a compile error, for standalone editing
  without host-runtime Bindings; everything else is checked as in compile.
- RtlCompileError now exposes .line (1-based) / .col (0-based) attributes,
  None when unknown.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@shigarov
shigarov merged commit 49017c3 into main Jul 11, 2026
5 checks passed
@shigarov
shigarov deleted the rtl-lsp-core branch July 11, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant