Mayank1791989 / gql

112 stars 19 forks source link

cannot parse © #4

Closed hartshorne closed 7 years ago

hartshorne commented 7 years ago

obviously not a critical error, but spews a bunch of noise.

file: 'file:///.../file.tsx'
severity: 'Error'
message: 'Syntax Error: Cannot parse the unexpected character "\u2009".'
at: '1,5'
source: 'graphql'
Mayank1791989 commented 7 years ago

@hartshorne plz share the 'file.tsx' source and '.gqlconfig'.

hartshorne commented 7 years ago

.gqlconfig:

{
  schema: {
    files: 'web/src/graphql/schema.graphql'
  },
  query: {
    files: [{
      match: 'web/src/**/*.ts*',
      parser: [
        'EmbeddedQueryParser',
        {
          startTag: 'gql`',
          endTag: '`'
        }
      ]
    }]
  }
}

file.tsx:

// © 2017

import { gql } from '../lib/graphql';

gql`
  fragment Account on Query {
    accounts {
      id
    }
  }
`;

problems:

file: 'file:///.../web/src/file.tsx'
severity: 'Error'
message: 'Syntax Error: Cannot parse the unexpected character "\u2009".'
at: '1,5'
source: 'graphql'
Mayank1791989 commented 7 years ago

the issue was due to Unicode thin space character between © and 2017 which you should not use in code as it's always hard to detect the presence, anyway pushed the fix v2.2.4

hartshorne commented 7 years ago

thanks!

sandangel commented 6 years ago

image

.gqlconfig

{
   schema: {
     files: {
       include: 'apps/**/*.graphql'
     }
   },
   query: {
     files: [
       {
         match: 'apps/**/*.ts',
         parser: ['EmbeddedQueryParser', { startTag: 'gql`', endTag: '`' }]
       }
     ]
   }
}

I face this issue here. any idea?

sandangel commented 6 years ago

image

I guess it because of this. When I hover it, the tooltip say that graphql language server has stop I have installed watchman and @playlyfe/gql correctly. Have no idea why this happen

sandangel commented 6 years ago

image Here is log from output

kumarharsh commented 6 years ago

The red icon comes in two scenaros:

  1. When gql service has not started.
  2. When gql service has tried to start, and failed. (See https://github.com/kumarharsh/graphql-for-vscode/issues/29). If this is the case, try shutting down the watchman server watchman shutdown-server, and then reload the vscode window (Reload Window) - this would start watchman again.

Also, please open a different issue for your problem. Discussing it here will make searching for it harder for future users.

Mayank1791989 commented 6 years ago

@sandangel Looks like the path to schema files is wrong that is why server not starting.

sandangel commented 6 years ago

hmm..., the gql service is running now, but I still don't have syntax highlight with embedded schema, it work with .graphql file though, here is my screenshot.

screen shot 2017-11-18 at 14 40 23
Mayank1791989 commented 6 years ago

@sandangel share output of graphql-for-vscode plugin. Is ide features working in above file?

sandangel commented 6 years ago
screen shot 2017-11-18 at 15 11 58

yeah, IDE features is working but gql plugin seem to be not

Mayank1791989 commented 6 years ago

vscode theme?

sandangel commented 6 years ago

I use One Dark Italic Theme, I have also tried another theme but it just not work

sandangel commented 6 years ago

I can confirm that when I add a schema file to project and hover the embedded string, it show the tooltips but there are still no syntax highlighting

screen shot 2017-11-18 at 15 59 23
sandangel commented 6 years ago

wow I got it. That was because of Angular Component Extension plugin of onixie, after disable it, syntax highlighting worked. Thank you very much