Fix error encountered running in helix#4123
Conversation
🦋 Changeset detectedLatest commit: 2230bf8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
trevor-scheer
left a comment
There was a problem hiding this comment.
@forivall change seems reasonable to me, but can you share a reproduction that demonstrates the issue?
|
Here's my reproduction repository: https://github.com/forivall/gql-config-repro-workspace/tree/89204bd11c78655db950237db8264e205f624d90 setup: to reproduce, i first watch the helix logs via and then run Among the log lines, i will see and the error will not appear. The expected behaviour, which is how it works when i apply my fix, is to show this error:
(the files for the above repo were adapted from the tests for graphql-codegen) |
There was a problem hiding this comment.
Could you improve type for settings?
| this._settings = { ...settings, ...vscodeSettings }; | ||
| const rootDir = this._settings?.load?.rootDir.length | ||
| const rootDir = this._settings?.load?.rootDir?.length | ||
| ? this._settings?.load?.rootDir |
There was a problem hiding this comment.
| ? this._settings?.load?.rootDir | |
| ? this._settings.load.rootDir |

I manually applied this fix and the lsp works now. Single character fix to add a missing
?.