Giter Club home page Giter Club logo

Comments (16)

sungam3r avatar sungam3r commented on May 29, 2024 1

Indeed, I struggled with indentation (both horizontal and vertical) a lot when I rewrote the parser a long time ago. I will try to look at this problem today, but for now I am away from my home PC.

from parser.

sungam3r avatar sungam3r commented on May 29, 2024 1

OK. I reproduced this and I have an idea how to fix this. It requires some internal redesign of AST printing.

from parser.

sungam3r avatar sungam3r commented on May 29, 2024 1

In process. There is some progress. I need to delicately tune practically each method of parser.

from parser.

sungam3r avatar sungam3r commented on May 29, 2024 1

With new design of indentation it should not take much time to fix.

from parser.

nightroman avatar nightroman commented on May 29, 2024

Example input:

"A component contains the parametric details of a PCB part."
input DesComponentFilterInput {
    and: [DesComponentFilterInput!]
    or: [DesComponentFilterInput!]
    "The library label for this component."
    name: StringOperationFilterInput
    "The additional information for this component."
    comment: StringOperationFilterInput
    "The summary of function or other performance details for this component."
    description: StringOperationFilterInput
    "The component revision."
    revision: DesRevisionFilterInput
}

Example result with unexpected new lines and indentations:

"A component contains the parametric details of a PCB part."
input DesComponentFilterInput {
  and: [DesComponentFilterInput!]
  or: [DesComponentFilterInput!]

  "The library label for this component."
    name: StringOperationFilterInput

  "The additional information for this component."
    comment: StringOperationFilterInput

  "The summary of function or other performance details for this component."
    description: StringOperationFilterInput

  "The component revision."
    revision: DesRevisionFilterInput
}

from parser.

nightroman avatar nightroman commented on May 29, 2024

@sungam3r Any progress? No pressure, just wondering when to expect the improvement, approximately.

from parser.

sungam3r avatar sungam3r commented on May 29, 2024

Nope. I can’t say when it will be ready. I remember this task. Recently I have been littered with household chores.

from parser.

sungam3r avatar sungam3r commented on May 29, 2024

I want to return to this task in the near future after I finish the adjacent changes in v8.2/v8.3.

from parser.

nightroman avatar nightroman commented on May 29, 2024

@sungam3r Thank you for the good news, cannot wait to try it out!

from parser.

sungam3r avatar sungam3r commented on May 29, 2024

Fixed in #304 but I'm sure there are more issues to fix internally.

from parser.

nightroman avatar nightroman commented on May 29, 2024

@sungam3r Thank you! Will the nuget package be updated soon?

from parser.

sungam3r avatar sungam3r commented on May 29, 2024

Today or tomorrow.

from parser.

sungam3r avatar sungam3r commented on May 29, 2024

https://www.nuget.org/packages/GraphQL-Parser/9.0.1

from parser.

nightroman avatar nightroman commented on May 29, 2024

@sungam3r Thank you.
Input type formatting is fixed, great!

There is a regression though (I think).
We lost indentation of field/query parameters in object types.

Example before (normal indentation)

type Query {
  "Fetches an object given its ID."
  node(
    "ID of the object."
    id: ID!): Node
  "Lookup nodes by a list of IDs."
  nodes(
    "The list of node IDs."
    ids: [ID!]!): [Node]!
  "Search for workspaces associated with this account."
  desWorkspaces(where: DesWorkspaceFilterInput): [DesWorkspace!]!
  "Search a specific workspace by its unique identifier."
  desWorkspaceById(
    "The node identifier for a workspace."
    id: ID!): DesWorkspace

Example now (no indentation)

type Query {
  "Fetches an object given its ID."
  node(
  "ID of the object."
  id: ID!): Node
  "Lookup nodes by a list of IDs."
  nodes(
  "The list of node IDs."
  ids: [ID!]!): [Node]!
  "Search for workspaces associated with this account."
  desWorkspaces(where: DesWorkspaceFilterInput): [DesWorkspace!]!
  "Search a specific workspace by its unique identifier."
  desWorkspaceById(
  "The node identifier for a workspace."
  id: ID!): DesWorkspace

Should I submit another issue or this comment is enough for an action?

from parser.

sungam3r avatar sungam3r commented on May 29, 2024

Submit, please, in parser repo.

from parser.

nightroman avatar nightroman commented on May 29, 2024

Here is the new issue -- #311

from parser.

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.