| date | 2025-01-08 |
|---|
All hint data including can be found in the directory src/hint-data/manifests. And all of them are generated by the scripts in src/hint-data/fetch. This also means that in most cases, you should not manually edit them.
There are many hint data generator scripts need to request web page and download them from the internet. You can find the URLs of these web pages in the file src/hint-data/manpage-url.ts.
To reduce the number of network requests, there is a cache mechanism for the fetch scripts. In short, you can use the one of the following approaches to ensure the scripts request the latest version of document from the internet rather than read from old local cache files:
# Approach 1:
export NO_CACHE=1
# Approach 2:
rm -r cache# Please build this project once to generate fetch-related scripts
# And you need to re-run the following command after you changed the source code in `src` directory.
yarn build:tsFirstly, update the systemd-related URL in src/hint-data/manpage-url.ts Then, run the following command to fetch the docs data and detect the changes
# There is a mechanism in the systemd docs fetch scripts for detecting changes in docs of systemd.
# To ensure it works properly, please make sure there are no any dirty changes in the `manifests` directory
# before updating the hint data each time.
git checkout -- src/hint-data/manifests;
git clean -f -- src/hint-data/manifests;
yarn run fetch:base
# or ./ts src/hint-data/fetch/systemd-all.tsThen review the new log file in logs directory to check the following things:
- Does the fetch script work properly? Because the docs maybe updated in the structure. You may need to update the fetch scripts for the latest docs just like the changes on fetch scripts in this commit: https://github.com/hangxingliu/vscode-systemd/commit/59e8aa90ff027e18a4213c6c9669e47895e9433f
- Any new unit file types?
- If yes, then update the code like this commit: https://github.com/hangxingliu/vscode-systemd/commit/27b4db8720b0d4f66db641f9129e626d475cb830
- Any new sections?
- If yes, then update the code like this commit: https://github.com/hangxingliu/vscode-systemd/commit/4e62132fae03f51619a84ac6b7371d01750791d4
- Are there any directives that have been removed?
- If yes, please check out the changelog in systemd repo and generated the log file in
logsdirectory that has a name likesystemd-xxxx.removed.json. - Then update the code like this commit: https://github.com/hangxingliu/vscode-systemd/commit/dcdfc25ca0b2497b5c347f21138c6f47721cd1c1
- If yes, please check out the changelog in systemd repo and generated the log file in
- Read the changelog from systemd and the check the log file to add more auto-completion support for values if any new just like this commit: https://github.com/hangxingliu/vscode-systemd/commit/dcdfc25ca0b2497b5c347f21138c6f47721cd1c1
git checkout -- src/hint-data/manifests;
git clean -f -- src/hint-data/manifests;
# Fetching and generating hint data about Podman Quadlet
yarn run fetch:podman- Are any new sections or file extensions added?
- https://github.com/hangxingliu/vscode-systemd/commit/68de80f339e4d54f574c418eb63c00afb6edb687
- https://github.com/hangxingliu/vscode-systemd/commit/2b7b123d05c1af3db4ee21b16fdd946a23377431
- https://github.com/hangxingliu/vscode-systemd/commit/525518f515c8a2313cc60316220b0dd99ef57f99
- Are any new directives that accepts boolean value added? Then please update
_PODMAN_BOOLEAN_DIRECTIVESconfig and generate the manifest again
git checkout -- src/hint-data/manifests;
git clean -f -- src/hint-data/manifests;
# Fetching and generating hint data about Podman Quadlet
yarn run fetch:mkosi# Fetching and generating hint data about Linux Capabilities
yarn run fetch:capabilities
# Fetching and generating hint data about Linux syscalls
yarn run fetch:syscalls