Summary
scip-python 0.6.6 (latest) does not generate SymbolInformation for @dataclass class symbols themselves (only for their fields/methods), nor for many standard library symbols. When scip expt-convert (v0.8.1) encounters a definition occurrence with an enclosing range for one of these missing symbols, it hard-errors with "has definition occurrence, but no SymbolInformation" and aborts the entire conversion, making the index unusable.
Reproduction
Minimal two-file project:
pyproject.toml
[project]
name = "scip-final-repro"
version = "0.1.0"
contracts.py
"""File A: defines a @dataclass with self-validation in __post_init__."""
from __future__ import annotations
from dataclasses import dataclass
from numbers import Real
import math
def _validate(value: object) -> None:
if not isinstance(value, Foo):
raise ValueError("must be Foo")
if not isinstance(value.x, Real) or not math.isfinite(value.x):
raise ValueError("x must be finite real")
@dataclass(frozen=True)
class Foo:
x: float
def __post_init__(self) -> None:
_validate(self)
consumer.py
"""File B: imports and uses Foo from file A."""
from __future__ import annotations
from contracts import Foo
def make_foo(x: float) -> Foo:
return Foo(x=x)
Steps
scip-python index . --output index.scip --quiet
scip expt-convert --output index.db index.scip
Observed
In the generated index.scip:
-
Foo# (the class symbol itself) has 8 occurrences in contracts.py, but SymbolInformation is only generated for 3 sub-symbols (Foo#x, Foo#__post_init__, Foo#__post_init__().(self)). The class-level Foo# symbol is missing from doc.symbols.
-
Foo# in consumer.py has 4 occurrences but zero SymbolInformation entries — cross-file references are completely missing symbol metadata.
-
Standard library symbols also missing SymbolInformation:
dataclasses/dataclass()
math/isfinite()
numbers/Real#
math/__init__:
Converter behavior
For this minimal repro, scip expt-convert succeeds (exit 0) because the missing symbols don't have enclosing ranges. However, in a large project (477 Python files, 160K occurrences), some missing symbols do have enclosing ranges, triggering the hard error in convert.go:395:
return fmt.Errorf("symbol %q has definition occurrence, but no SymbolInformation", occ.Symbol)
This aborts the entire conversion, producing only a 36KB partial database instead of the expected ~13MB.
Expected behavior
scip-python should generate SymbolInformation for:
@dataclass class symbols themselves (not just their fields/methods)
- Standard library symbols referenced in the indexed code
Environment
- scip-python: 0.6.6 (latest on npm)
- scip converter: v0.8.1
- Python: 3.12.13
- Node.js: v22.22.3
- macOS: Darwin x86_64
Related issues
Workaround
We've written a patch script that parses the .scip protobuf, detects all symbols with occurrences but no SymbolInformation, and inserts minimal placeholder SymbolInformation entries before running expt-convert. This produces a complete ~13MB database and scip-cli analyze works correctly on the patched index.
Summary
scip-python0.6.6 (latest) does not generateSymbolInformationfor@dataclassclass symbols themselves (only for their fields/methods), nor for many standard library symbols. Whenscip expt-convert(v0.8.1) encounters a definition occurrence with an enclosing range for one of these missing symbols, it hard-errors with"has definition occurrence, but no SymbolInformation"and aborts the entire conversion, making the index unusable.Reproduction
Minimal two-file project:
pyproject.tomlcontracts.pyconsumer.pySteps
scip-python index . --output index.scip --quiet scip expt-convert --output index.db index.scipObserved
In the generated
index.scip:Foo#(the class symbol itself) has 8 occurrences incontracts.py, butSymbolInformationis only generated for 3 sub-symbols (Foo#x,Foo#__post_init__,Foo#__post_init__().(self)). The class-levelFoo#symbol is missing fromdoc.symbols.Foo#inconsumer.pyhas 4 occurrences but zeroSymbolInformationentries — cross-file references are completely missing symbol metadata.Standard library symbols also missing
SymbolInformation:dataclasses/dataclass()math/isfinite()numbers/Real#math/__init__:Converter behavior
For this minimal repro,
scip expt-convertsucceeds (exit 0) because the missing symbols don't have enclosing ranges. However, in a large project (477 Python files, 160K occurrences), some missing symbols do have enclosing ranges, triggering the hard error inconvert.go:395:This aborts the entire conversion, producing only a 36KB partial database instead of the expected ~13MB.
Expected behavior
scip-pythonshould generateSymbolInformationfor:@dataclassclass symbols themselves (not just their fields/methods)Environment
Related issues
implementations(for parent classes) #36 — relaxed this check forlintbutexpt-convertstill hard-failsexpt-convertmissing fields population (open)Workaround
We've written a patch script that parses the
.scipprotobuf, detects all symbols with occurrences but noSymbolInformation, and inserts minimal placeholderSymbolInformationentries before runningexpt-convert. This produces a complete ~13MB database andscip-cli analyzeworks correctly on the patched index.