File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
packages/graphql-language-service-server/src Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " graphql-language-service-server " : patch
3
+ " graphql-language-service " : patch
4
+ ---
5
+
6
+ Do not log errors when a JS/TS file has no embedded graphql tags
Original file line number Diff line number Diff line change @@ -485,7 +485,7 @@ export class MessageProcessor {
485
485
486
486
const cachedDocument = this . _getCachedDocument ( textDocument . uri ) ;
487
487
if ( ! cachedDocument ) {
488
- throw new Error ( 'A cached document cannot be found.' ) ;
488
+ return [ ] ;
489
489
}
490
490
491
491
const found = cachedDocument . contents . find ( content => {
@@ -537,7 +537,7 @@ export class MessageProcessor {
537
537
538
538
const cachedDocument = this . _getCachedDocument ( textDocument . uri ) ;
539
539
if ( ! cachedDocument ) {
540
- throw new Error ( 'A cached document cannot be found.' ) ;
540
+ return { contents : [ ] } ;
541
541
}
542
542
543
543
const found = cachedDocument . contents . find ( content => {
@@ -749,8 +749,9 @@ export class MessageProcessor {
749
749
const textDocument = params . textDocument ;
750
750
const cachedDocument = this . _getCachedDocument ( textDocument . uri ) ;
751
751
if ( ! cachedDocument || ! cachedDocument . contents [ 0 ] ) {
752
- throw new Error ( 'A cached document cannot be found.' ) ;
752
+ return [ ] ;
753
753
}
754
+
754
755
return this . _languageService . getDocumentSymbols (
755
756
cachedDocument . contents [ 0 ] . query ,
756
757
textDocument . uri ,
You can’t perform that action at this time.
0 commit comments