Mirror: TypeScript LSP plugin that finds GraphQL documents in your code and provides diagnostics, auto-complete and hover-information.

avoid altering the file when there are ts errors (#107)

Changed files
+7 -4
.changeset
packages
graphqlsp
+5
.changeset/popular-clocks-count.md
···
···
+
---
+
'@0no-co/graphqlsp': patch
+
---
+
+
Correctly bail when file has typescript errors
+2 -4
packages/graphqlsp/src/diagnostics.ts
···
scalars,
baseTypesPath
).then(({ success }) => {
-
if (!success) return undefined;
source = getSource(info, filename);
-
if (!source) return undefined;
-
-
if (isFileDirty(filename, source) && !hasTSErrors) {
return;
}
···
scalars,
baseTypesPath
).then(({ success }) => {
+
if (!success || hasTSErrors) return;
source = getSource(info, filename);
+
if (!source || isFileDirty(filename, source)) {
return;
}