Closed kevinbbbb closed 1 month ago
It seems that we have an influx of requesting additional package intellisense. I am not sure how (and maybe what criteria) we shall handle them or design a future-proof mechanism on this matter. May I have your thoughts @jlelong ?
@James-Yu Sorry for the delay, I missed this one. It is clearly not reasonable to add all package intellisense to LW. I think we should provide a mechanism for LW users to add extra package intellisense by themselves and make it persistent over LW update. It is sufficient to call https://github.com/James-Yu/LaTeX-Workshop/blob/73561d53ca1c84cbba2dded24fc78e369405ffb3/dev/pkgcommand.py on a .cwl
file to obtain an intellisense file for LW.
Besides adding a new configuration variable to store user completion files, I am not completely sure how to proceed. Either describe the different steps in the wiki and keep our finger crossed not to have too many after sale issues. Or design a completely automatic mechanism, in which case it may simpler to create a new repo with all the package intellisense in LW format obtained from texsutdio after running pkgcommand.py
.
I just tried to import the derivative.cwl
file myself but I couldn't get the pkgcommand.py
script to work. On first run, I got
python3 pkgcommand.py -i derivative.cwl -o ./
Traceback (most recent call last):
File "/home/kevin/Latex_Workshop_Intellisense/pkgcommand.py", line 7, in <module>
from pyintel import CwlIntel
ModuleNotFoundError: No module named 'pyintel'
which could be expected, since I don't have the pyintel
package installed. So I tried to install the pyintel
package, which is loaded at the beginning of the script. The install was not successful as i got
pip install pyintel
ERROR: Could not find a version that satisfies the requirement pyintel (from versions: none)
ERROR: No matching distribution found for pyintel
Web forums suggest that my Python version might not be compatible with the package. I have Python 3.10 installed. Unfortunately, I couldn't find any info on a package named pyintel
but only a few similarily named packages.
Is the script you provided maybe outdated?
(I was not sure whether I should open a new issue, hoping it's okay.)
The pyintel
package is part of LW : https://github.com/James-Yu/LaTeX-Workshop/tree/master/dev/pyintel
You need to copy the pyintel
directory next to the pkgcommand.py
script.
Thanks, I was now able to produce the JSON
file and Intellisense is working for those commands! For the record, I followed your instructions given here.
30b74c1 should provide a temp solution to this issue. Users can now download all package intellisense jsons from this repo and place them to a folder, then include in latex-workshop.intellisense.package.dirs
Pre-checks*
The Missed*
The Solution*
Anything Else?