Closed trickypr closed 2 years ago
As a side note, remark will continue to fail if you have remark installed globally. It appears that you must install it locally for it to work, which seems annoying, especially for those who use format-on-save.
- but it also replaces the content of your file with undefined
That is a bug indeed. However:
- Uninstall any copies of the remark package
You shouldn’t do that though.
My guess is that the processor is cached (the module was loaded in the past so it’s still in the module cache). I can’t imagine why it would start returning empty files though? Perhaps an error is thrown here which is swallowed.
It appears that you must install it locally for it to work, which seems annoying, especially for those who use format-on-save.
This is intentional for this project (see readme).
It is intended that you use this in combination with a) configuration specific to the project, b) versioned dependencies, optionally/typically c) with remark-cli
so that you can ensure in a CI/makefile/npm scripts/etc that people who don’t have VS Code, also format the same way you do with VS Code.
You shouldn’t do that though.
My guess is that the processor is cached (the module was loaded in the past so it’s still in the module cache).
I should be more clear that this happens before first install. In my case, Codacy was complaining that my markdown formatting was wrong and I got the vscode extension as a quick fix, without installing the lsp. I don't think that I have installed remark or the extension before, so I don't think it would be caching.
I have updated the reproduction steps to be more clear.
I can’t imagine why it would start returning empty files though?
By undefined
, I don't mean empty files. I mean replacing the contents of the file with undefined
.
This is intentional for this project (see readme).
Sorry, I skimmed the project name and ignored the readme. That is entirely my fault.
I have updated the reproduction steps to be more clear.
Ahhh okay, that makes more sense, thanks.
This is likely a bug in unified-language-server
.
/cc @remcohaszing
I noticed a situation where the file contents are replaced with undefined
myself. This should never happen, it’s worse than errors. I will investigate.
Theis was fixed in https://github.com/unifiedjs/unified-language-server/pull/51 and released in version 2.1.0.
Hi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.
Initial checklist
Affected packages and versions
v2.0.0
Link to runnable example
No response
Steps to reproduce
undefined
Runtime information:
v18.6.0
python-poetry
(I am trying to format files in a python project)Expected behavior
There should be an error telling you to install remark, but the file should be left unchanged.
Actual behavior
There is an error telling you to install remark, but it also replaces the content of your file with
undefined
Runtime
Other (please specify in steps to reproduce)
Package manager
Other (please specify in steps to reproduce)
OS
macOS
Build and bundle tools
Other (please specify in steps to reproduce)