question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Autocomplete and syntax highlighting in embedded queries very slow

See original GitHub issue

Version and Environment Details

Operation system: macOS 10.15.4

IDE name and version: PhpStorm 2020.1 Build #PS-201.6668.153, built on April 13, 2020

Plugin version: 2.4.0

Schema stats: 472 types, 20 interfaces, 82 inputs, 30 enums, 13 unions, 1 scalars, 5 directives

Expected Behaviour

The syntax highlight should be instant and the other two mentioned functions also shouldn’t take longer than a second ideally.

Actual Behaviour

We found that in queries which are embedded in our javascript files the syntax highlighting takes 5sor more seconds to show up. Opening our schema.graphql directly does not show the same behaviour there. The Navigation on query fields (Cmd+Click on mac) sometimes takes several seconds till PHPStorm jumps to the schema. The autocomplete popup when typing a new field in a query or pressing Ctrl+Space to open the autocomplete takes also several seconds.

Sometimes syntax highlighting never kicks in, but the navigation still works. Screenshot 2019-08-07 at 16 10 28

We have a rather large (I think) schema, so that might be too much to handle?

Steps to Reproduce / Link to Repo with Reproduction and Instructions

I cannot share our schema but I’m happy to provide profiling snapshots if you tell me how to create them.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:9

github_iconTop GitHub Comments

1reaction
reinolduscommented, Oct 15, 2020

I am using hasura and easily reached

751 types, 1048 inputs, 150 enums, 21 scalars

That makes using this plugin pretty much unusable. I tried the suggested fixes, but doesn’t seem to work.

GraphiQL within hasura doesn’t have that issue

1reaction
jimkyndemeyercommented, Aug 9, 2019

Hi Daniel.

I did a lot of work to make the plugin usable with the GitHub schema which is also quite large (326 types). I just tested with a gql tagged query and while it’s not instant, completion and highlighting is still usable: http://g.recordit.co/ziz64sLenY.gif

Given that the plugin looks for gql in all javascript and typescript file types, you could see a performance gain by limiting which of these files are part of your schema. You can use the includes glob in your .graphqlconfig file to manage this. See https://jimkyndemeyer.github.io/js-graphql-intellij-plugin/docs/developer-guide#project-structure-and-schema-discovery

Let me know what you find.

Best regards, Jim.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Very slow autocomplete, syntax highlighting #2525 - GitHub
Hi I have been experiencing very slow autocomplete and syntax highlighting recently with the plugin. The projects I have worked with are ......
Read more >
92015: Autocomplete Data Not Automatically Loading
Description: Autocomplete will load database names, but once a database is written in query, it will not show table names.
Read more >
Google Chrome developer tools works very slow
I sped up Chrome again by doing the following: Open DevTools -> select Elements tab ->.
Read more >
A case against syntax highlighting - Linus Åkesson
Syntax highlighting is a standard feature of most modern text editors and development environments. The basic idea is to exaggerate the visual ...
Read more >
Fast Colored TextBox for Syntax Highlighting - CodeProject
At first, I used a component inherited from RichTextBox , but while using it for a large amount of text I found out...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found