Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: rewrite grapple #89

Merged
merged 146 commits into from Mar 1, 2024
Merged

feat!: rewrite grapple #89

merged 146 commits into from Mar 1, 2024

Conversation

cbochs
Copy link
Owner

@cbochs cbochs commented Feb 29, 2024

Context

This is a ground-up rewrite of Grapple. There was a lot of issues with the previous design that made maintenance/modification very difficult. This new version cleans up the design model and brings several new features to the table.

image image

BREAKING Changes

  • Grapple file format has changed, old tags will not be brought over
  • Grapple file naming scheme has changed and now suffixes files with .json
  • Only one top-level Grapple user command instead of many
    • For example, GrappleTag is now Grapple tag
  • Grapple API options file_path is renamed to path
  • Grapple tags with a name are now treated like other tags, which means they are cycled through and are reorderable
  • Scopes API has been entirely reworked
    • Scopes are now be defined in in the settings (see grapple.scope_definition)
    • Scopes can be defined with Grapple.define_scope
    • Methods which were provided by the grapple.scope module have been removed
    • Grapple.invalidate has been renamed to Grapple.clear_cache
  • Support for resession.nvim has been removed as it is unnecessary

Changes

  • Grapple Windows have been reworked
    • The Tags window is mostly the same, with some goodies
    • The Scopes window now shows defined scopes and allows selecting a scope
    • NEW The Container window shows containers of tags that have been loaded by a scope
    • NEW Support for file icons
    • NEW Quick select in Tags window (1-9)
    • NEW Configurable window title for tags, scopes, and containers
  • NEW Support for storing URIs (i.e. oil://)
  • NEW Emit GrappleUpdate user event when an tag update occurs
  • Improved file type and buffer type (i.e. nofile) exclusions
  • Improved scope caching, allow autocmd patterns and debounce intervals
  • Improved cursor change detection and persistence

Ongoing

  • The README is slowly being updated to reflect rewrite
  • Highlights for the Tags window is in-progress
  • Highlights for the Scopes window is in-progress
  • Highlights and actions for the Containers window is in-progress
  • Concurrent neovim sessions writing to the same resolved scope 🤔

Closes #70 #71 #73 #87
Incorporates #77 #78 #80 #81 #84
Not included #66 #82

Calvin Bochulak added 30 commits February 25, 2024 22:09
Diffing assumes that all tags are removed and then re-added. This makes
it easier to resolve at the cost of a larger performance impact. This
should be negligible since container should not have many tags at any
given point in time.

Implement window quickfix method. Allow users to send tags to a quickfix
list.
Window must know as little as possible about Content. The same goes for keymaps.
However, there are actions available (i.e. tag selection) that must know about
both the vim buffer and vim window. The revised models are as follows:

The Window can render at most one Content at a time
The Window can #attach or #detach from Content
The Window can #update and #render Content

The Content does not hold state for any vim constructs and must receive them from Window
The Content uses #update to update internal state
The Content uses #render to publish its state to a vim buffer
The Content uses #attach to call hooks
The Content uses #detach to reconcile modified entries

A Content hook will receive a window for access to ui information
A Content hook will receive a window to create keymaps or autocommands
A Content hook will receive the content itself to perform actions
@cbochs cbochs changed the title Rewrite feat!: rewrite grapple Mar 1, 2024
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.

Quick select?
1 participant