@@ -46,14 +46,16 @@ function create(info: ts.server.PluginCreateInfo) {
4646 ) ;
4747
4848 proxy . getSemanticDiagnostics = ( filename : string ) : ts . Diagnostic [ ] => {
49- const originalDiagnostics =
50- info . languageService . getSemanticDiagnostics ( filename ) ;
5149 const graphQLDiagnostics = getGraphQLDiagnostics (
5250 filename ,
5351 baseTypesPath ,
5452 schema ,
5553 info
5654 ) ;
55+
56+ const originalDiagnostics =
57+ info . languageService . getSemanticDiagnostics ( filename ) ;
58+
5759 return graphQLDiagnostics
5860 ? [ ...graphQLDiagnostics , ...originalDiagnostics ]
5961 : originalDiagnostics ;
@@ -64,6 +66,13 @@ function create(info: ts.server.PluginCreateInfo) {
6466 cursorPosition : number ,
6567 options : any
6668 ) : ts . WithMetadata < ts . CompletionInfo > | undefined => {
69+ const completions = getGraphQLCompletions (
70+ filename ,
71+ cursorPosition ,
72+ schema ,
73+ info
74+ ) ;
75+
6776 const originalCompletions = info . languageService . getCompletionsAtPosition (
6877 filename ,
6978 cursorPosition ,
@@ -75,13 +84,6 @@ function create(info: ts.server.PluginCreateInfo) {
7584 entries : [ ] ,
7685 } ;
7786
78- const completions = getGraphQLCompletions (
79- filename ,
80- cursorPosition ,
81- schema ,
82- info
83- ) ;
84-
8587 if ( completions ) {
8688 return {
8789 ...completions ,
@@ -93,18 +95,18 @@ function create(info: ts.server.PluginCreateInfo) {
9395 } ;
9496
9597 proxy . getQuickInfoAtPosition = ( filename : string , cursorPosition : number ) => {
96- const originalInfo = info . languageService . getQuickInfoAtPosition (
97- filename ,
98- cursorPosition
99- ) ;
100-
10198 const quickInfo = getGraphQLQuickInfo (
10299 filename ,
103100 cursorPosition ,
104101 schema ,
105102 info
106103 ) ;
107104
105+ const originalInfo = info . languageService . getQuickInfoAtPosition (
106+ filename ,
107+ cursorPosition
108+ ) ;
109+
108110 return quickInfo || originalInfo ;
109111 } ;
110112
0 commit comments