-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat: completion logic (for implements & variables) #1747
Conversation
1ba4541
to
cbaefa5
Compare
Codecov Report
@@ Coverage Diff @@
## main #1747 +/- ##
==========================================
- Coverage 66.97% 57.83% -9.14%
==========================================
Files 87 30 -57
Lines 4906 1537 -3369
Branches 1351 288 -1063
==========================================
- Hits 3286 889 -2397
+ Misses 1385 566 -819
+ Partials 235 82 -153
Continue to review full report at Codecov.
|
- merge hint logic for codemirror back into `getAutocompleteSuggestions` - this pulls in support for several upstream features in `getAutocompleteSuggestions` - namely, the parsing and autocomplete logic for & syntax is working now
cbaefa5
to
623c4a9
Compare
- don't show interface we're extending in completion - rewrite variable completion to use streaming parser (no more EOF errors, sync parser doesn't work well here) - ensure variable completion contains types - add fragments option to codemirror-graphql
2898378
to
0b8a54e
Compare
@yoshiakis another huge series of improvements in the last commit! the variables completion was using graphql parse which just broke the heck out of codemirror-graphql. despite being new functionality, the EOF parse bug kept happening for incomplete queries, so i replaced it with several other edge cases fixed, all summarized in the commit message last step is to test it all thoroughly with the LSP server! seems to be working working great in codemirror-graphql, graphiql and monaco-graphql with manual testing |
0b8a54e
to
5717a7a
Compare
packages/graphql-language-service-interface/src/getAutocompleteSuggestions.ts
Outdated
Show resolved
Hide resolved
d243248
to
4b5c520
Compare
in order to introduce new language features across language server and browser ecosystems, here we combine the autocomplete logic in
codemirror-graphql
and in thegraphql-language-service-interface
.&
andimplements
&
syntax tocodemirror-graphql
and thusgraphiql
implements
logic now covers:implements &
listschema
yet, but are inline in the file, to avoid confusion)completion for variables
parse
for variable completion that I introduced because it was causing EOF errors. use token parser instead, like the rest of thegetAutocompleteSuggestions
library. then we are able to parse incomplete graphql operations and SDLcc: @yoshiakis
notes:
type
toCompletionItem
results, but for the language server side, it will be converted to a string or set toundefined
by the time the server is issuing the response to the LSP client (since it transmits over IPC, streams or sockets)