Closed memeplex closed 5 years ago
Looking at the source code this functionality doesn't seem to support sty files (as announced in the tooltip shown by vscode) nor \usepackage (which doesn't seem to be documented anywhere). The situation is quite confusing.
Now:
Renaming my file to .tex and using \input
I now get:
[2019-05-10 00:43:06.212] [exthost] [error] [James-Yu.latex-workshop] provider FAILED
[2019-05-10 00:43:06.213] [exthost] [error] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
at assertPath (path.js:39:11)
at Object.dirname (path.js:1268:5)
at module.exports.t.Input.provide (/home/carlos/.vscode-oss/extensions/james-yu.latex-workshop-6.5.1/out/src/main.js:371:486471)
at module.exports.t.Completer.completion (/home/carlos/.vscode-oss/extensions/james-yu.latex-workshop-6.5.1/out/src/main.js:371:469046)
at module.exports.t.Completer.provideCompletionItems.Promise (/home/carlos/.vscode-oss/extensions/james-yu.latex-workshop-6.5.1/out/src/main.js:371:467612)
at new Promise (<anonymous>)
at module.exports.t.Completer.provideCompletionItems (/home/carlos/.vscode-oss/extensions/james-yu.latex-workshop-6.5.1/out/src/main.js:371:466841)
at define.provideCompletionItems.a.asPromise (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:592:293)
at t.asPromise.Promise (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:49:430)
at new Promise (<anonymous>)
at Object.t.asPromise (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:49:402)
at L.provideCompletionItems (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:592:264)
at define.$provideCompletionItems._withAdapter.e (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:606:685)
at B._withAdapter (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:599:159)
at B.$provideCompletionItems (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:606:663)
at d._doInvokeHandler (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:622:11)
at d._invokeHandler (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:621:716)
at d._receiveRequest (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:620:341)
at d._receiveOneMessage (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:619:141)
at define.constructor._protocol.onMessage.e (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:617:400)
at u.fire (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:44:708)
at e (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:40:460)
at u.fire (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:44:708)
at a (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:172:467)
at e (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:172:513)
at u.fire (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:44:708)
at y._receiveMessage (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:181:276)
at define.constructor._socketDisposables.push._socketReader.onMessage.e (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:178:415)
at u.fire (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:44:708)
at f.acceptChunk (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:175:35)
at define.constructor._register._socket.onData.e (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:174:410)
at Socket.t (/usr/lib/code/out/vs/workbench/services/extensions/node/extensionHostProcess.js:182:689)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
Ok, after some debugging I realized this was caused because no root file was detected. I'm not closing this because I still see a number of shortcomings:
\usepackage
commands and .sty
extensions. It's not necessary to understand the entire texmf hierarchy, the path in texDirs
could simply be the specific directory where the sty file resides.I have just updated the documentation. To make it clear, we do not parse and will not parse packages to search for newcommands because their structure is far too complicated and they very often include other packages in turn. Instead we rely on .cwl
files to list the commands provided by every standard package.
Personal macro files should be loaded using one of the commands from the \input
family but not \usepackage
because of the above restriction.
@jlelong the documentation of the texDirs setting is still wrong after the last update:
List of directories where to look for extra input .tex/.sty files.
Hum, it was fixed in af174e5 and is included in 7.0.0
. Can you point me to the wrong description?
Mmmm, vscode told me the package has been updated, I checked the changelog and indeed things like "use input defs in mathjax preview" were there, now I see the installed package version is not 7.0.0, and even if I check for updates the new version is not listed. Have you seen anything like that? Maybe a problem with mirrors? In any case, the popup announcing the upgrade was not asking but stating that the upgrade has been performed.
Nevertheless, I uninstalled and reinstalled and it picked up 7.0.0, weird... Thanks anyway.
No, it didn't. In the extensions list, after uninstalling, it says 7.0.0. But when I install the extension the version is 6.5.1.
Could it be a problem with your packaging. In the marketplace I see:
Version | 7.0.0 |
Last updated | 5/16/2019, 11:39:27 PM
But then the latest release in your github is 6.5.1: https://github.com/James-Yu/LaTeX-Workshop/releases
Ok, this seems to be the problem:
Unable to install extension 'james-yu.latex-workshop' as it is not compatible with VS Code '1.33.1'.
Failed Installing Extensions: /home/carlos/Downloads/James-Yu.latex-workshop-7.0.0.vsix
Maybe you should add a warning to the release notes (maybe there is one and I don't know where to look at). It's strange that vscode hasn't been more informative regarding this, though.
Disable all the other extensions except for LaTeX Workshop, and check that you still see this issue. [Required]
You still see this issue?: Yes
Describe the bug [Required]
With this config:
And a
custom.sty
file inside the configured texDirs:\usepackage
To Reproduce
Steps to reproduce the behavior:
/home/xxx/Library/TeXMF/tex/latex
\usepackage{cust
Expected behavior
In points 3 and 4 above completion should work.
Logs [Required]
LaTeX Workshop Output [Required]
[23:54:52] Initializing LaTeX Workshop. [23:54:52] Creating LaTeX Workshop http and websocket server. [23:54:52] LaTeX Workshop initialized. [23:54:53] Server created on 127.0.0.1:40091 [23:54:54] Snippet data loaded. [23:54:54] LaTeX Workshop version: 6.5.1Developer Tools Console [Required]
Can't see anything suspicious here.Desktop [Required]: