Aerijo / autocomplete-latex

A LaTeX autocomplete provider for Atom
MIT License
10 stars 2 forks source link

Couple of issues #3

Closed werunom closed 6 years ago

werunom commented 6 years ago

Just installed this package. Found few issues. I am listing them below

  1. Whenever I start the atom, I am getting the below error message. But the package works fine. What is the reason for this? screenshot_20171221_195057

  2. Not sure whether it is expected behaviour, but in the autocomplete options, there seems to be duplicate. For instance, in the gif below, when I type \sec, I get two options. I know one of them is triggered when I type \ and the other pops up even if I dont start with \. But thought it is redundant. peek 2017-12-21 19-55

Aerijo commented 6 years ago
  1. That issue is interesting. I put in safeguards, so it will silently fail if the completions file does not exist. As it was found, this package then tried to load it as a js module. The error you see was thrown by that process, and I'll need more help to work out why. E.g., did you specify an absolute path? I'll try and find out the cause in the mean time. BTW, the package works fine because I didn't want an error like that to break the entire package. What you see as working fine should be just the default completions. If you don't want to see the error anymore, try removing the path you provided.

  2. Basically, this issue is caused by a combination of language-latex and autocomplete-snippets. For some reason, it was once customary to include snippets as part of the grammar package. Snippets are invisible by default, but expand when you press tab and the prefix matches a known snippet. What autocomplete-snippets does is make these snippets visible as part of the autocomplete drop down menu. Therefore, the duplicates you are seeing are the snippets provided by language-latex. Note they do not start with a \ because autocomplete-snippets does not support punctuation in snippet names. I don't know any way of disabling the provided snippets (another great design choice :unamused:), short of disabling one of the packages. Disabling autocomplete-snippets will hide snippets everywhere, but will not affect autocomplete itself (e.g., packages called autocomplete-<something> will still work). Disabling language-latex will also work, and you can use an alternative package to handle syntax highlighting (such as my own. It should be as good as language-latex). Finally, you could simply delete the snippets folder in .atom/packages/language-latex/. This will not break anything (aside from removing the snippets), but they will probably come back after an update.

With the second point, this redundant popup was my main motivation for this package. Since LaTeX is 90% regular words, I didn't want a popup appearing every other word. This package will only provide suggestions after a \, !, or @ (the last one is new experimental syntax).

werunom commented 6 years ago
  1. I have not provided any path in any part of your package settings. So, not sure from where or why it is picking '\home\varun' path. Let me know if you need any further info to solve this.

  2. Yah. I figured that the duplications were coming from the language. In any case, I agree with your intention - its unncessary to be disturbed by snippet completions while typing. Many a times I have automatically triggered them while typing the main text. Therefore, I have removed that language pack, and installed yours. So, this duplication is solved.

PS - The differences between your and the other language packages were not clear. Even the homepage of language-latex2e does not clear lists its difference in comparison to the main language. Can you please do that?

Aerijo commented 6 years ago

Fixed the first issue with df61f00. The issue was that an empty path was being resolved as root, and naturally it could not find the nameless file in root. If it persists after the next release (should be soon), reopen this issue to let me know.

I'll also try to summarise what my language package does in the readme file. As it was built from scratch, I was focusing on getting the feature set at least as good as the main one.

werunom commented 6 years ago

Works fine! Thanks for the quick fix...