Skip to content
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

Intellisense autocompletion for derivative package #4258

Closed
1 task done
kevinbbbb opened this issue May 6, 2024 · 6 comments
Closed
1 task done

Intellisense autocompletion for derivative package #4258

kevinbbbb opened this issue May 6, 2024 · 6 comments

Comments

@kevinbbbb
Copy link

Please fill the following fields with a star (*) and provide as much related information as possible.

Pre-checks*

Please change the following [ ] to [x] for confirmation.

  • The feature request has not been suggested in this repository.

The Missed*

Is your feature request related to a problem? Please provide a clear and concise description of what the problem is.

  • no Intellisense autocompletion is available for commands of the derivative package, which is a feature-rich package for writing derivatives, differentials etc.

The Solution*

Please provide a solution you would like to have.

  • add Intellisense autocompletion for the derivative package

Anything Else?

Add any other context about the feature request below.

@James-Yu
Copy link
Owner

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 ?

@jlelong
Copy link
Collaborator

jlelong commented May 20, 2024

@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.

@kevinbbbb
Copy link
Author

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.)

@jlelong
Copy link
Collaborator

jlelong commented May 20, 2024

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.

@kevinbbbb
Copy link
Author

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.

@James-Yu James-Yu reopened this May 20, 2024
@James-Yu
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants