-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codemirror not recognizing returned extensions and throwing "Unrecognized extension value in extension set" #15
Comments
@wr8tt5 I faced a similar issue when upgrading to the latest release of CodeMirror 6. And so did several people: https://discuss.codemirror.net/t/highlighting-that-seems-ignored-in-cm6/4320. You seem to have narrowed it down to a bit more specific cause of the issue. I will have to look into this. I would hope/assume that others facing this same issue isn't also because of this package. But, like mentioned in that thread linked above: https://discuss.codemirror.net/t/highlighting-that-seems-ignored-in-cm6/4320/19, my solution was the same: delete the Not the most ideal way of solving the issue. But I am leaving it here just in case it is viable for anyone facing the similar issue. |
Removing If this issue doesn't garner any alternative workarounds, or an explanation/solution, I'm happy to close it. I agree that it's unlikely to be an issue with |
@wr8tt5 That is so odd. I wonder if something else is still being cached by NPM somehow. But, you are absolutely right. At least knowing why this happens would be really useful. I wonder if there is a way to reliably reproduce this issue. Is your project open source, by any chance? |
I've only been able to reproduce this issue using an Electron application. I have not been able to reproduce it with a normal web application e.g. a react/typescript app. A minimal example Electron application can be found at codemirror-languageserver-issue15. When run (
Copying index.ts into a local file (e.g. |
I'm also having a similar problem, in that I'm getting the same error as @wr8tt5 when I try to pass the language server created through this plugin into my CodeMirror configuration. In my case I think it might be something to do with the fact that this plugin still has |
hi, this is indeed caused because of multiple versions of @codemirror/state. I have fixed it in #17 |
To clarify
the same version of I've tried using a local The steps I took were as follows.
The issue persists. |
I have just discovered though that after the steps above to use the latest |
If I update the project
It seems that |
v6.1.0 and 0.20.0 are not the same versions, they are not compatible. All other @codemirror/whatever deps are still using @codemirror/state v6.0.0. So, from how I see it, v6.0.0 is the way to go. I have tested it in #17, and it works. |
@loiswells97 #17 has been merged and a new version has been released. Please update and it should solve your dependency issue. @wr8tt5 You may also want to give the latest release a try. |
No it doesn't resolve the issue, but as I've explained above it has made me aware that |
Why don't you try updating to the latest version ? @uiw/react-codemirror v4.10.3 |
I have. That is the point of running |
@wr8tt5 Did you ever find a resolution to this issue? 😅 |
When I use codemirror-languageserver as a dependency, Extensions returned by languageServerWithTransport() and passed to codemirror cause it to throw
I've read codemirror issue #608 related to this and while I do have several occurrences of @codemirror/state in my project dependency tree, they are the same version. Nevertheless, I added the npm "overrides" key in package.json to ensure they were all the same version (@codemirror/[email protected] in this case) but it made no difference. After a couple days troubleshooting this (debugging the @codemirror/state module trying to make sense of why it refused to recognize extensions) I found that a simple codemirror Facet (a FacetProvider) worked if it was created in my project code, but not if it was returned from languageServerWithTransport(). So, I copied codemirror-languageserver/src/index.ts into my project, removed the dependency on codemirror-languageserver, updated the affected imports, and everything worked.
I would really like to understand the reason behind this, so if any maintainers/contributors can offer tips or further insight, I would appreciate it.
For further context, my project is an electron+react application and I'm using @uiw/react-codemirror to work with codemirror. The LSP (typescript-language-server) is forked by the electron main process, and I have my own transport code to handle LSP+JSON-RPC over electron IPC, which is the reason I'm calling languageServerWithTransport().
The text was updated successfully, but these errors were encountered: