[BUG] Unable to build dependencies because of type mismatch
Describe the bug
Hello!
The readme says to build the extension with npm run build. When I do that on the current main branch, I get a bunch of type errors. Some are missing from @types/nova-editor-node that I addressed in #44 but one ('LanguageClient' is not assignable to parameter of type 'Disposable') is not.
To Reproduce Steps to reproduce the behavior:
- Follow the readme and run
npm build - See the following errors:
src/rust-lang-server.ts:66:33 - error TS2345: Argument of type 'LanguageClient' is not assignable to parameter of type 'Disposable'.
Property 'dispose' is missing in type 'LanguageClient' but required in type 'Disposable'.
66 nova.subscriptions.remove(this.languageClient)
~~~~~~~~~~~~~~~~~~~
node_modules/@types/nova-editor-node/index.d.ts:341:5
341 dispose(): void;
~~~~~~~
'dispose' is declared here.
src/rust-lang-server.ts:76:33 - error TS2345: Argument of type 'LanguageClient' is not assignable to parameter of type 'Disposable'.
76 nova.subscriptions.remove(this.languageClient)
~~~~~~~~~~~~~~~~~~~
src/rust-lang-server.ts:146:30 - error TS2345: Argument of type 'LanguageClient' is not assignable to parameter of type 'Disposable'.
146 nova.subscriptions.add(client)
~~~~~~
src/rust-lang-server.ts:164:33 - error TS2345: Argument of type 'LanguageClient' is not assignable to parameter of type 'Disposable'.
164 nova.subscriptions.remove(this.languageClient)
~~~~~~~~~~~~~~~~~~~
Found 4 errors in the same file, starting at: src/rust-lang-server.ts:66
Expected behavior The app build successfully.
Versions (please complete the following information):
- macOS: Ventura 13.4
- Processor: Apple Silicon
- Nova 11
- Extension Version 2.3.2
Additional context
Looking through the Nova docs on subscriptions (which is a CompositeDisposable) the add method requires an object that has a dispose() method. The docs for LanguageClient don't specify that method.
So one question I'm asking myself is: should the extension be subscribing to the LanguageClient? Also, how did you compile this?
It's been a while, so I can't comment on why I believed the client was disposable 😅. Thanks for scouring the docs for this issue! I'll work on fixing this error.
Also, how did you compile this?
Are you asking how I was able to work around compiler errors, or are you asking for improvements to the documentation? If the former, I edited the type files locally and never got around to upstreaming the changes to Definitely Typed. If the latter, please let me know what's unclear or if I missed documenting something. Thanks!
If the former, I edited the type files locally and never got around to upstreaming the changes to Definitely Typed.
Ah ha, thanks. That's what I was after.
Thanks for looking at the bug. Let me know if I can help with the types or the extension. I've got bandwidth here and there.