Repository navigation
Qualified references follow the Rust model (#124) - #126
Merged
Merged
Conversation
added 6 commits
November 16, 2026 12:07
Pin core at 69039e7 (core#290): a whole-namespace use brings in only its name, a full path from a root needs no use, and a path goes down from a name in scope. The language server runs core's Scope and check_references over the files it has instead of keeping a second rule. - reference::not-in-scope, reference::qualifier-not-in-scope and reference::defined-twice reach the editor with core's fixes as quick fixes. - A qualified type is frozen as its resolved path before validation, and ImportLookup::reaches answers for a path into a schema of the project. - Hover, go-to-definition, find-references and rename resolve the whole path under the cursor; a name a use brought in is a module to hover and jump to. - Completion in a type position offers the names in scope, the namespaces a use brought in and the roots, and completes the next segment after a root or a namespace. - Add use, auto-import and the did-you-mean write item uses and package:: paths; a missing name can also be written through a namespace in scope.
…ich still pin 14ce546
…tors, which still pin 14ce546" This reverts commit e9703c4.
…b62 (all on core 69039e7)
Kinflou
marked this pull request as ready for review
November 16, 2026 15:34
…ares, not import::missing The editor now says what comline check says. The two fixes, "Add use" and "Write types::User" (or the alias a use imported it under), are attached to core's diagnostic. import::missing stays only for a validator in a @Validators list, which core's reference rule does not cover.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Qualified references follow the Rust model (#124)
Closes #124. Rule: Qualified references; core: ComlineProject/core#290 (merged as 69039e7, with the decisions comment).
What changes
69039e7, and generatione900919, comline-rust768afc0and comline-typescripta384b62, which are on the same core, so the tree has onecomline-core.analysis::names::Namesbuilds theProjectContextcore reads from the files the server has (each file's declarations and text under its namespace, the dependencies the manifest declares) and runs core'sScopeandcheck_referencesover it.reference::not-in-scope,reference::qualifier-not-in-scopeandreference::defined-twicereach the editor throughfrom_core, so their fixes are the existingfix_actionsquick fixes ("WriteUser", "ImportUserasTypesUser"). Code, message, help and fix are core's.import::missing(several candidates, an alias, validators), so core'snot-in-scopefor the same name is not shown twice; every othernot-in-scopeis core's, with no second "unknown type" beside it.config.idpin view, aqualifier-not-in-scopeis not reported: the qualifier may be a dependency's name (the same benefit of the doubtimport::unresolvedhas).Scope::frozen) before core's validation, asIncrementalInterpreterdoes, andImportLookup::reachesis implemented (it defaulted tofalse, so a full path read as an unknown type): a path to a declaration of a schema the project holds, a schema that doesn't parse right now taken as declaring it. The lookups for a validator's targets, an alias, a type that carries data and imported bounds read a frozen name by its path first.useof a directory,stdor a dependency's name on its own is a name to qualify with and is no longerimport::unresolved(as in core'scheck_imports).use typse::Usernow suggestspackage::types(core#286), and the "Change ..." quick fix writes it.Project::resolveis the file's scope as core reads it, for every form: a bare name through itsuse,types::User,b::Invoicethrough an alias,billing::api::Invoicewalked down,package::types::User,std::http::Request,shared::models::Thing. The cursor resolves the whole path it ends; a qualifier segment is the module it stands for (a name ausebrought in included), for hover and go-to-definition. Afteruse package::typesa bareUserresolves to nothing. A hover's size block follows the files a full path reaches.usemessage and quick fix still writeuse package::types::User, never a namespaceusefollowed by a bare name; where ausehere already brought the schema in as a namespace, "Writetypes::User" is offered beside it. Auto-import completion writes the itemuse, or the qualified name where a namespace in scope reaches it.names(the four forms, freeze, reaches, bindings), the diagnostics and their fixes applied and re-checked,import::missingand the new second fix, the unresolved-import cases, project resolution and references, hover, definition, code actions and completion. Two existing cases moved with the rule: a whole-namespaceuseno longer imports every name (import_check,diagnostics), and a name declared nowhere is core'snot-in-scopewhere it was core's "Unknown type". README section on the rule.What completion offers
uses import (an alias under its alias); the namespaces itsuses brought in (types,b), which writetypes::and ask for the next segment; types of other files, sorted after, aspackage::...auto-imports (the itemuse) or, where a namespace in scope reaches the schema, written through it (types::User, no newuse); then the rootspackage::,parent::,self::,std::and the dependenciespackage::,shared::,std::)types::,b::,billing::)parent::,self::self::includes the file's own typesA bare
Useris not offered from a schema that only a whole-namespaceusebrought in.CI
Tests run in CI.