vscode-front-matter
vscode-front-matter copied to clipboard
Feedback: re-load configuration
I have a system where my frontmatter.json is built automatically. After I rebuilt my frontmatter.json, while VSCode is open it does not seem to reload the configuration file. "Watch"ing and automatically reloading on frontmatter.json might be too resource-using, but there is also no "reload configuration and reload VSCode" in the CTRL+P menu. I would somehow expect Frontmatter to have either automatic reload of the config (on change) or some form of manual reload (via CTRL+P or other means).
Currently I am closing down VSCode and restart to load the changes.
If it is intended to reload the configuration on change, it's not working in my case ;)
- https://github.com/davidsneighbour/kollitsch.dev - clone
- run
npm install
andnpm run build:frontmatter
to recreate frontmatter.json
Interesting @davidsneighbour there is both a watcher and a VS Code listener bound to the frontmatter.json
file. I'll try and see what is going on.
I can only reproduce it when you start without any frontmatter.json
file, and run your npm run build:frontmatter
script. In that case, the listeners are not bound to any file and will not trigger an update. Looking for a fix / new command to rebind these.
https://user-images.githubusercontent.com/2900833/182934280-997fff16-599f-40db-a6a0-748411160035.mov
The beta has a new frontMatter.config.reload
(Front Matter: Reload config) command. An additional thing not shown in the above video is an auto-binding mechanism.
When there is no frontmatter.json
file in the project, the listeners will go to a listeners pool. Waiting until there is a file created. Once created, they will be automatically bound.
I am testing around with this. I have the feeling that maybe wireit
might have an influence here. I need to simplify my project ;)
I always have the frontmatter.json created before I start, so in the case where I feel it does not update there is always a frontmatter.json created and gets changed while running the watch-job.
You wrote
Interesting @davidsneighbour there is both a watcher and a VS Code listener bound to the frontmatter.json file. I'll try and see what is going on.
Could it be that wireit and VSCode compete for the file(s) to watch? I am still every now and then experiencing this whole "it doesn't seem to update" situation.
I'll try to remove wireit from my frontmatter setup, might bring some insights.
Have you tried out the new: frontMatter.config.reload
command?
That actually works. I wonder if one can run this from outside of VSCode (maybe via npm scripts). We should close this issue as it's obviously just an issue in my chaotic project ;)
I have an extension for that, you might be able to combine it.
https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-remote-control