Skip to content

v0.9.0

Choose a tag to compare

@dpep dpep released this 09 Oct 18:45
· 157 commits to main since this release
bfd93e0
  • index.cause says when another trekr was writing. An answer whose
    edited files could not be read because another trekr held the store
    said stale: true with no cause; cause now names those files and
    why.

  • A call inside a made name's #{…} is that call. In
    class_eval("def #{dir.upcase}_shout"), every letter of upcase
    answered the method the string makes (UP_shout), with full
    confidence. A call or constant written inside such a name now answers
    itself, as a variable there already did.

  • Go to Definition in a file the index has not read uses its own
    class.
    In an untracked file created after the last index (with no
    file watcher to say so), a call inherited from the file's superclass
    listed every method of that name; --def answered the superclass's.
    Opening a file now reads it as saving it does — one the index would
    read, that is: opening or saving a file git ignores leaves the index
    as it was.

  • --gc collects what queries recorded. Each edited version of a file
    a query read stayed in the store for good; --gc now removes those no
    checkout maps once they are older than --older-than (and than an hour,
    so a query still reading one keeps it), and exits 0 when that is all it
    removed. Blobs an --index read or mapped are kept as before.

  • A spec macro's or store_accessor's method ends where its argument
    does.
    The column just past let(:name), subject(:name) or
    RSpec::Matchers.define :name answered that method, and
    store_accessor :settings, :"key" placed each accessor with its own
    name's length from the : — short of the closing quote for key, far
    past it for key_changed?. Each now spans its symbol (or string) as
    written, closing quote included. An association's generated methods
    (dogs=, dog_ids from has_many :dogs) still reach past it.

  • --refs by a constant's whole name lists the constant as its scopes
    write it.
    --refs Admin::Widget listed only mentions written
    Admin::Widget, missing Widget inside module Admin; on
    SEPARATORS.join inside module Router it said "no mention of
    Router::SEPARATORS"; and on a constant's definition (SIZES = …) it was a
    usage error, exit 64. A name written with :: now lists the definitions
    and the references Ruby's lookup resolves to it through the scopes they
    are written in, as the editor's Find References does, and a position on
    any class, module or constant answers that way. A constant nothing
    defines whole is named by the part that resolves: Nodes::Union inside
    module Arel is Arel::Nodes::Union. By name, a path through an
    includer, a subclass or an alias (Child::K) is not found; at the
    mention it is. A top-level constant's whole name is ::Widget; a bare
    --refs Widget still lists every mention of the name.

  • A --refs miss is said as a no. "no mention of X (indexed? try
    trekr --index)" sent an agent to reindex a checkout already indexed;
    it now reads "no mention of X in what trekr indexed", and for a name
    written with :: says it was read as a whole name from the top level.

  • --def in a require string answers the file it loads. Anywhere in
    require_relative "../../lib/helper", --def snapped to
    Kernel#require_relative, while Go to Definition opened lib/helper.rb.
    Both now ask one subject: the file, at its top, with under: require and
    resolved_via: require in --json, and a reason when no file is found.
    A gem's copy of a stdlib file (require "json", "erb", "uri") is
    the one answered, as Ruby loads it; Go to Definition offered both. In a
    monorepo, a file inside a path gem also searches that gem's own test/
    and spec/: require "cases/helper" in rails' activerecord/test
    opens activerecord/test/cases/helper.rb.

  • --def on a method's def names its Sorbet signature. Go to
    Declaration from a def opened the .rbi stub that describes it, while
    --def there answered only the def itself. Its --json now carries
    signatures, as an answer on a call of the method does.