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

plan to expose api #12

Closed
IWANABETHATGUY opened this issue Jul 9, 2021 · 3 comments
Closed

plan to expose api #12

IWANABETHATGUY opened this issue Jul 9, 2021 · 3 comments

Comments

@IWANABETHATGUY
Copy link
Contributor

IWANABETHATGUY commented Jul 9, 2021

Thanks for the fantastic work!
Is there any plan to expose api to other developer ? so that they could use the api create more diff tool other than only git diff
replacer

@Wilfred
Copy link
Owner

Wilfred commented Jul 18, 2021

This is definitely I'm interested in future, but it's too early right now. The API is still changing a lot as I figure out how make a design that actually works.

@Wilfred Wilfred closed this as completed Jul 18, 2021
Wilfred pushed a commit that referenced this issue Aug 15, 2021
* Add failing test for negative numbers

* Fix parsing of negative numbers

* Rearrange assertion to avoid extra diff noise
Wilfred pushed a commit that referenced this issue Aug 15, 2021
Wilfred pushed a commit that referenced this issue Sep 6, 2021
Andoryuuta pushed a commit to Andoryuuta/difftastic that referenced this issue Apr 2, 2022
Include leading \\ characters as anonymous nodes
ido77778 pushed a commit to ido77778/difftastic that referenced this issue May 3, 2022
* Add highlights.scm and minor grammar change

* `queries/highlights.scm` added and `package.json` changed to support
  syntax highlight
* primitive_type node made public for specific highlight case
* typo fixed in grammar definition
* grammar renamed 'Solidity' -> 'solidity' for consistency with other
  packages

* ♻ implement suggested refactors from pr Wilfred#12

* add target to npm ignore

* set edition back to 2018

* add cargo lock to ignore

* extend rust gitignore

* add lowercase to package name

* build fixes

* add rust build/test pipeline

* just use node

* install the cli

* do a global cli install

* add some descriptions to rust action

Co-authored-by: p13nty <[email protected]>
Wilfred pushed a commit that referenced this issue Jul 4, 2022
* intent: fix anonymous function using `function () … end`

Use the same code as the previous λ

* add anonymous function as `function () … end`

* missing files from 5ae28dd
Wilfred pushed a commit that referenced this issue Jul 11, 2022
gurjeet pushed a commit to gurjeet/difftastic that referenced this issue Sep 20, 2022
@luzpaz
Copy link

luzpaz commented Aug 8, 2023

@Wilfred has there been any progress on your thinking about this ? (sorry for the necrobump)

@the-moog
Copy link

@luzpaz I was the person who made the reqeust over at GNOME. https://gitlab.gnome.org/GNOME/meld/-/issues/756

I noticed this PR that adds a library interface, though that has not been looked at for well over a year. I guess this makes sense as it's not worth publishing an API for a moving target.

Perhaps there is another, simple way to add difft as a backend to meld?

There is a feature (experimental) where difftastic emits a simple json file with the --display <MODE> option.
Could that be used with a temp file, named pipe or Bekeley socket until there is a more direct interface?

Example below...

Note this was generated a file with few characters (~15) and a tiny change. I am wondering if JSON is the best way to communicate that change information? For a large file the diff data could be massive. There are binary alternatives for arbitrary data serialisation that would be more efficient. e.g. Apache Thrift? Or maybe do it live with a socket and a virtual cursor - next/prev/print/count etc that would mean far less data to transfer.

before (lhs comma rhs) -> [(lhs) comma rhs] after

 DFT_UNSTABLE=yes target/debug/difft \
  --display json \
  sample_files/change_outer_before.el \
  sample_files/change_outer_after.el
{
  "chunks": [
    [
      {
        "lhs": {
          "line_number": 0,
          "changes": [
            { "start": 0, "end": 1, "content": "(", "highlight": "delimiter" },
            { "start": 14, "end": 15, "content": ")", "highlight": "delimiter" }
          ]
        },
        "rhs": {
          "line_number": 0,
          "changes": [
            { "start": 0, "end": 1, "content": "[", "highlight": "delimiter" },
            { "start": 1, "end": 2, "content": "(", "highlight": "delimiter" },
            { "start": 5, "end": 6, "content": ")", "highlight": "delimiter" },
            { "start": 16, "end": 17, "content": "]", "highlight": "delimiter" }
          ]
        }
      }
    ]
  ],
  "language": "Emacs Lisp",
  "path": "sample_files/change_outer_after.el",
  "status": "changed"
}

Wilfred pushed a commit that referenced this issue Jan 7, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
gcr pushed a commit to gcr/difftastic-nim that referenced this issue Jan 31, 2024
Put infix operators as inline within the grammar

This allows us to remove 11 external scanning nodes. Tie breaking against command call & prefix is now done solely on the prefix operator.

Symbolic operators are now exposed as nodes to allow syntax queries to match against them.

Due to size explosion, Unicode operators are disabled.

Included are some fixes for scanner flags reset on new line.
Duologic pushed a commit to Duologic/difftastic that referenced this issue Mar 22, 2024
bernhard-herzog pushed a commit to bernhard-herzog/difftastic that referenced this issue May 2, 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

No branches or pull requests

4 participants