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

fix: test token-pos change (#209)

Changed files
+7 -2
.changeset
packages
graphqlsp
src
ast
+5
.changeset/spotty-dots-greet.md
···
···
+
---
+
"@0no-co/graphqlsp": patch
+
---
+
+
fix broken positioning on unix
+2 -2
packages/graphqlsp/src/ast/token.ts
···
let foundToken: Token | undefined = undefined;
for (let line = 0; line < input.length; line++) {
-
const lPos = cPos - 1;
-
const stream = new CharacterStream(input[line]);
while (!stream.eol()) {
const token = parser.token(stream, state);
const string = stream.current();
···
let foundToken: Token | undefined = undefined;
for (let line = 0; line < input.length; line++) {
+
const lPos = cPos;
+
const stream = new CharacterStream(input[line] + '\n');
while (!stream.eol()) {
const token = parser.token(stream, state);
const string = stream.current();