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

Discussion: getAutocompleteSuggestions #940

Open
yoshiakis opened this issue Aug 16, 2019 · 2 comments
Open

Discussion: getAutocompleteSuggestions #940

yoshiakis opened this issue Aug 16, 2019 · 2 comments

Comments

@yoshiakis
Copy link
Collaborator

Hi all,

I was thinking to add a new property graphQLType into items of returned array from getAutocompleteSuggestions, which is a type of GraphQLType and a type object related to the returned label. The reason I was thinking to do it is here.

However, I noticed that this change would affect applications and libraries using getAutocompleteSuggestions. One of these is graphql-language-service-server. I think this library doesn't like this change because it's not only necessary at all but also increases the amount of transferred data.

So I'm now thinking I'll create a new function instead in codemirror-grpahql that returns graphQLType property instead of detail property. Also, some functions used in getAutocompleteSuggestions can be also used in this new function so I want to export those functions from getAutocompleteSuggestions and graphql-language-service-interface and use them in the new function.

What do you think of this idea? Thanks for your opinion in advance.

@acao
Copy link
Member

acao commented Sep 4, 2019

I think monaco/vscode might already provide what youre looking for, via getDefinitions(). we are moving to monaco over the next few months, so major new features for codemirror graphql will probably not be introduced, as its much easier to introduce these kinds of features with Monaco, and by adhering to the LSP spec. we may have to deprecate it within the next year.

My other question is, would that break the official LSP spec implementation? or can you just return new properties like that in the CompletionResult object? im pretty sure this wouldnt be compatible with the new monaco service im building to replace codemirror-monaco. you are free to fork and customize codemirror graphql as you please since its lifecycle is uncertain

@acao
Copy link
Member

acao commented Sep 8, 2019

@yoshiakis i understand your approach better now, sounds good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants