Giter Club home page Giter Club logo

Comments (10)

ThaDaVos avatar ThaDaVos commented on September 27, 2024

Okay, it seems to be loading my parser - but not using my format for some reason?

registerFileType((fileExt, filePath, fileData) => {
    if (['lib', 'g.lib'].includes(fileExt)) {
        return true;
    }
    
    return false;
});

registerParser(() => {
    read(1);
    addRow('Type', getHexOxValue(), 'Record Type');

    read(2);
    const recordLength = getNumberValue();
    addRow('Length', recordLength, 'The full length of the record');

    read(recordLength);
    addRow('Data', getStringValue(), 'Data');
});

from binary-file-viewer.

ThaDaVos avatar ThaDaVos commented on September 27, 2024

Trying to create a parser for this:
http://www.azillionmonkeys.com/qed/Omfg.pdf

from binary-file-viewer.

maziac avatar maziac commented on September 27, 2024

In the problems area you should find the hint:
Bildschirmfoto 2023-04-06 um 19 28 56
Actually you used a 'O' instead of a '0' (zero) inside getHex0xValue.

If you change it and save, you should see your parsed file:
Bildschirmfoto 2023-04-06 um 19 30 28

from binary-file-viewer.

ThaDaVos avatar ThaDaVos commented on September 27, 2024

Two things:

  1. How did you get highlighting?
  2. All methods were through auto-completion/intellisense - so how that typo got in, I wouldn't know - or it's the one I copied from the "Getting Started" example of the WAV file

from binary-file-viewer.

maziac avatar maziac commented on September 27, 2024
  1. Which highlighting? the red squiggles?
    They come from the binary file viewer extension. Any errors are also written to the PROBLEMS pane.
    Is it not working for you?
    You need to save the js file before it is analyzed.

  2. For me it displays the correct suggestion:
    Bildschirmfoto 2023-04-06 um 21 31 21
    You can see the text 'Binary File Viewer' to the right of the suggestions which shows the origin.
    The others are probably from intellisense
    Maybe you chose the wrong auto-completion.

from binary-file-viewer.

ThaDaVos avatar ThaDaVos commented on September 27, 2024
  1. Is not working for me - do I need to select a specific format? Or do I need to edit the parser file from a window where the extension itself is also being used? Auto completion works though
  2. It does for me too - but it doesn't show the errors

I also found the source for my error, see:

addRow('File size', getHexOxValue(), 'The file size LESS the size of the "RIFF" description (4 bytes) and the size of file description (4 bytes).');

from binary-file-viewer.

maziac avatar maziac commented on September 27, 2024
  1. Yes, while developing a parser file you need to have the parser file and the parsed file in the same vscode window.
    The cause of this is explained a little bit here: filewatcher

  2. Thanks for the hint. I will correct that.

from binary-file-viewer.

ThaDaVos avatar ThaDaVos commented on September 27, 2024
  1. Thanks, good to know
  2. You're welcome!

Another question - as you can see in http://www.azillionmonkeys.com/qed/Omfg.pdf the binary file contains multiple records - I was under the impression I could show each record as a separate line through the parser - but it only works with rows - not columns - is this possible at all?

from binary-file-viewer.

maziac avatar maziac commented on September 27, 2024

" I was under the impression I could show each record as a separate line through the parser - but it only works with rows - not columns "

Could you elaborate a bit. I don't understand the problem.

from binary-file-viewer.

ThaDaVos avatar ThaDaVos commented on September 27, 2024

No elaboration needed - I was mistaken how Binary files work 🤣

from binary-file-viewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.