Skip to content

Own schemas only through package::, parent:: or self:: (part of #122) - #123

Merged
Kinflou merged 3 commits into
masterfrom
feat/own-schema-relative-paths
Nov 15, 2026
Merged

Kinflou merged 3 commits into
masterfrom
feat/own-schema-relative-paths

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 14, 2026

Copy link
Copy Markdown
Member

Part of #122: the own-schema-path error with its quick fix, and no more generating bare paths. Groups, the formatter and [format] (the rest of #122) are not in this PR. Rule: Own schemas only through relative paths; core: ComlineProject/core#285 (import::bare-own-schema-path, merged as 14ce546).

What changes

  • Pins. core 14ce546, and generation e22109e, comline-rust 2d2c885, comline-typescript c44b39d, the same revs as the CLI (cli#163), so the tree has one comline-core. No other source change was needed for core's changes since 868e831.
  • Diagnostic, from core. analysis::import_check::bare_own_schema_paths runs core's check_imports over a ProjectContext built from the files the server has (the file's own text for the fix, the package's other schemas by namespace) and keeps BARE_OWN_SCHEMA_PATH. Code, message, help and fix are core's, not a second copy of the rule. It goes through from_core, so the fix reaches the editor as the existing fix_actions quick fix ("Write package::types::User"). The mirror stops at a use core flags, as core does (a bare path to a missing item says only the bare error until it is written package::). Not run for a dependency's own files; runs without a config.idp.
  • "Add use ..." code action, missing-import message and auto-import completion (Candidate::use_path, unimported_item): package::types::Message for the package's own schemas; a dependency's or std's path stays as it is.
  • use-path completion: the top level offers dependencies, package/parent/self and std; own schemas are offered under package::/parent::/self::, and nothing is offered along a bare path to one. The legacy import is unchanged.
  • Tests and docs: about 100 bare own paths in the tests (analysis, handlers, hover, rename, definition, completion) and the README now write package::. Parsing-only tests (util.rs, the use context reader, add_use_edit text) keep their plain text. New tests: the diagnostic (every form, message, fix applied and re-checked, nested, no manifest, relative/dependency/std not flagged, a typo stays unresolved, a dependency's own files), the quick fix, the "Add use" fix (own and dependency), auto-import detail and edit, and completion (top level, under package::, nothing along a bare path).

Parity with core

The "did you mean" for use typse::User suggests the bare types and its fix writes it, which the bare-path error then flags (then fixes). The editor words and offers what core does; tracked in ComlineProject/core#286.

CI

Tests run in CI.

Kinflou added 3 commits November 15, 2026 07:53
Pin core at 14ce546 (import::bare-own-schema-path) and generation and the
generators at the CLI's revs. A bare path to one of the package's own
schemas is reported with core's own error and fix, from core's check_imports;
the "Add use" fix, auto-import and use-path completion write and offer own
schemas only as package::.
@Kinflou
Kinflou marked this pull request as ready for review November 15, 2026 00:34
@Kinflou
Kinflou merged commit 8590a0a into master Nov 15, 2026
21 checks passed
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