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

Tilde (~) is not expanded in LTeX path settings #99

Closed
Lewous opened this issue Aug 20, 2020 · 3 comments
Closed

Tilde (~) is not expanded in LTeX path settings #99

Lewous opened this issue Aug 20, 2020 · 3 comments
Assignees
Labels
1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature 3-fixed Issue resolution: Issue has been fixed on the develop branch
Milestone

Comments

@Lewous
Copy link

Lewous commented Aug 20, 2020

Hi,
The LTeX package was installed from .vsix file released on github. So, both jdk 11.0 and ltex-ls 6.2.0 is well prepared (and I've check manually). But a "Java failed" occurs when I try to set ltex.ltex-ls.path.

I think it has some relation with issue #75. But since you've mentioned it has been fixed...

When the ltex.ltex-ls.path is not set (regardless of ltex.java.path), the LTeX works well. But when the ltex.ltex-ls.path is set to a local path "~/my_git/ltex-ls-6.2.0" , Ltex tell me "Test failed.". Here is the OUTPUT of LTeX Language Client:

2020-08-20T05:03:44.269Z Info: Searching for Java in '/Users/lewous_ttx/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib'...
2020-08-20T05:03:44.270Z Info: Java found in '/Users/lewous_ttx/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib/jdk-11.0.8+10-jre/Contents/Home'.
2020-08-20T05:03:44.270Z Info: Using ltex-ls from '~/my_git/ltex-ls-6.2.0'.
2020-08-20T05:03:44.270Z Info: Using Java from '/Users/lewous_ttx/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib/jdk-11.0.8+10-jre/Contents/Home'.
2020-08-20T05:03:44.270Z Info: Testing ltex-ls...
2020-08-20T05:03:44.270Z Info:   Command: "~/my_git/ltex-ls-6.2.0/bin/ltex-ls"
2020-08-20T05:03:44.270Z Info:   Arguments: ["--version"]
2020-08-20T05:03:44.270Z Info:   env['JAVA_HOME']: "/Users/lewous_ttx/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib/jdk-11.0.8+10-jre/Contents/Home"
2020-08-20T05:03:44.270Z Info:   env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2020-08-20T05:03:44.276Z Info: Test failed.
2020-08-20T05:03:44.277Z Info: Exit code of ltex-ls: null
2020-08-20T05:03:44.277Z Info: stdout of ltex-ls:
2020-08-20T05:03:44.277Z Info: 
2020-08-20T05:03:44.277Z Info: stderr of ltex-ls:
2020-08-20T05:03:44.277Z Info: 
2020-08-20T05:03:44.277Z Error: The download/extraction/run of Java failed!
2020-08-20T05:03:44.277Z Info: You might want to try offline installation, see $https://valentjn.github.io/vscode-ltex/docs/installation-how-to-use.html#offline-installation.

Then I tried this in my terminal:

lewousnoair:~ lewous_ttx$ cd my_git/ltex-ls-6.2.0/bin
lewousnoair:bin lewous_ttx$ ls 
ltex-ls		ltex-ls.bat
lewousnoair:bin lewous_ttx$ ./ltex-ls --version
{
  "ltex-ls": "6.2.0",
  "java": "14.0.2"
}

And when I set ltex.ltex-ls.path to "~/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib/ltex-ls-6.2.0", this also happens:

2020-08-20T05:30:24.597Z Info: Searching for Java in '/Users/lewous_ttx/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib'...
2020-08-20T05:30:24.597Z Info: Java found in '/Users/lewous_ttx/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib/jdk-11.0.8+10-jre/Contents/Home'.
2020-08-20T05:30:24.597Z Info: Using ltex-ls from '~/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib/ltex-ls-6.2.0'.
2020-08-20T05:30:24.597Z Info: Using Java from '/Users/lewous_ttx/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib/jdk-11.0.8+10-jre/Contents/Home'.
2020-08-20T05:30:24.597Z Info: Testing ltex-ls...
2020-08-20T05:30:24.597Z Info:   Command: "~/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib/ltex-ls-6.2.0/bin/ltex-ls"
2020-08-20T05:30:24.597Z Info:   Arguments: ["--version"]
2020-08-20T05:30:24.597Z Info:   env['JAVA_HOME']: "/Users/lewous_ttx/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib/jdk-11.0.8+10-jre/Contents/Home"
2020-08-20T05:30:24.597Z Info:   env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2020-08-20T05:30:24.605Z Info: Test failed.
2020-08-20T05:30:24.605Z Info: Exit code of ltex-ls: null
2020-08-20T05:30:24.605Z Info: stdout of ltex-ls:
2020-08-20T05:30:24.605Z Info: 
2020-08-20T05:30:24.605Z Info: stderr of ltex-ls:
2020-08-20T05:30:24.605Z Info: 
2020-08-20T05:30:24.605Z Error: The download/extraction/run of Java failed!
2020-08-20T05:30:24.605Z Info: You might want to try offline installation, see $https://valentjn.github.io/vscode-ltex/docs/installation-how-to-use.html#offline-installation.

Here is the OUTPUT of LTeX Language Client when ltex.ltex-ls.path is not set (I set ltex.java.path to another local path this time):

2020-08-20T05:38:35.072Z Info: ltex.ltex-ls.path not set.
2020-08-20T05:38:35.072Z Info: Searching for ltex-ls in '/Users/lewous_ttx/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib'...
2020-08-20T05:38:35.074Z Info: ltex-ls found in '/Users/lewous_ttx/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib/ltex-ls-6.2.0'.
2020-08-20T05:38:35.074Z Info: 
2020-08-20T05:38:35.074Z Info: ltex.java.path set to '/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/'.
2020-08-20T05:38:35.074Z Info: Using ltex-ls from '/Users/lewous_ttx/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib/ltex-ls-6.2.0'.
2020-08-20T05:38:35.074Z Info: Using Java from '/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/'.
2020-08-20T05:38:35.076Z Info: Testing ltex-ls...
2020-08-20T05:38:35.076Z Info:   Command: "/Users/lewous_ttx/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib/ltex-ls-6.2.0/bin/ltex-ls"
2020-08-20T05:38:35.076Z Info:   Arguments: ["--version"]
2020-08-20T05:38:35.076Z Info:   env['JAVA_HOME']: "/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/"
2020-08-20T05:38:35.076Z Info:   env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2020-08-20T05:38:37.878Z Info: Test successful!
2020-08-20T05:38:37.974Z Info: 
2020-08-20T05:38:37.983Z Info: Starting ltex-ls...
2020-08-20T05:38:37.983Z Info:   Command: "/Users/lewous_ttx/.vscode/extensions/valentjn.vscode-ltex-6.2.0/lib/ltex-ls-6.2.0/bin/ltex-ls"
2020-08-20T05:38:37.983Z Info:   Arguments: []
2020-08-20T05:38:37.983Z Info:   env['JAVA_HOME']: "/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/"
2020-08-20T05:38:37.983Z Info:   env['JAVA_OPTS']: "-Xms64m -Xmx512m"
2020-08-20T05:38:37.983Z Info: 

my VSCode version is :

Version: 1.48.0
Commit: db40434f562994116e5b21c24015a2e40b2504e6
Date: 2020-08-13T08:03:27.059Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 18.7.0

and my OS is :

macOS Mojave
version 10.14.8
@Lewous
Copy link
Author

Lewous commented Aug 20, 2020

This occurs because ltex.ltex-ls.path do not understand the symbol "~/". After the "~/" is replaced with full path, the LTeX works well.

@valentjn valentjn changed the title ltex-ls testing failing ==> Java failed Tilde (~) is not expanded in LTeX path settings Aug 20, 2020
@valentjn valentjn added the 1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature label Aug 20, 2020
@valentjn
Copy link
Owner

valentjn commented Aug 20, 2020

Tilde expansion is something that the shell (e.g., Bash) does. ~ usually doesn't work in (most) other contexts, so I wouldn't say it's a bug in LTEX. However, since it's convenient, and it can confuse people if it doesn't work, this seems like a good feature request. This will be implemented 👍

VS Code also supports tilde in some places: microsoft/vscode#36792

@valentjn valentjn self-assigned this Aug 22, 2020
valentjn added a commit to valentjn/ltex-ls that referenced this issue Aug 22, 2020
@valentjn valentjn added the 3-fixed Issue resolution: Issue has been fixed on the develop branch label Aug 22, 2020
@valentjn valentjn added this to the 6.3.0 milestone Aug 22, 2020
@valentjn
Copy link
Owner

Fix released in 6.3.0.

me-johnomar added a commit to me-johnomar/ltex-ls that referenced this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature 3-fixed Issue resolution: Issue has been fixed on the develop branch
Projects
None yet
Development

No branches or pull requests

2 participants