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

Enter key not working in Latex Workshop extension usage #6408

Open
dannaf opened this issue Oct 17, 2019 · 10 comments
Open

Enter key not working in Latex Workshop extension usage #6408

dannaf opened this issue Oct 17, 2019 · 10 comments
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help vscode issues related to VSCode compatibility

Comments

@dannaf
Copy link

dannaf commented Oct 17, 2019

Description

I encounter an issue where the enter key does not work inside the editor while using the Latex Workshop vscode extension, v8.2.0.

Reproduction Steps

Launch Theia browser example
Load the plugin via the Deploy plugin by id command as described in the footnote here.
Open a .tex file in the editor
Type some text, e.g. \documentclass{article}
Press enter, and observe lack of new line (and after some time, the error listed below in the server)

OS and Theia version:
Theia source 0.11.0 5cd87b
Theia backend: Ubuntu 18.04 LTS
Theia frontend: Windows 10, Chrome 77.0.3865.120,

Diagnostics:
The following error is printed repeatedly, some time after attempting to make a new line in the editor while a .tex file is open, by pressing enter:

root ERROR [hosted-plugin: 11730] Promise rejection not handled in one second: Error: The command 'type' cannot be executed. There are no active handlers available for the command. (args: [{"source":"keyboard","text":"\n"}])
root ERROR [hosted-plugin: 11730] With stack trace: Error: The command 'type' cannot be executed. There are no active handlers available for the command. (args: [{"source":"keyboard","text":"\n"}])
    at CommandRegistry.<anonymous> (https://mydomainname.com/bundle.js:112917:31)
    at step (https://mydomainname.com/bundle.js:112693:23)
    at Object.next (https://mydomainname.com/bundle.js:112674:53)
    at fulfilled (https://mydomainname/bundle.js:112665:58)

Prior to that the following printed while loading the plugin:

root INFO unzipping the VS Code extension 'James_Yu_latex_workshop.vsix' to directory: /tmp/vscode-unpacked/James_Yu_latex_workshop.vsix
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /tmp/vscode-unpacked/James_Yu_latex_workshop.vsix
root INFO Resolved "vscode:extension/James-Yu.latex-workshop" to a VS Code extension "latex-workshop@8.2.0" with engines: { vscode: '^1.34.0' }
root INFO Deploying backend plugin "latex-workshop@8.2.0" from "/tmp/vscode-unpacked/James_Yu_latex_workshop.vsix/extension/out/src/main.js"
root INFO [hosted-plugin: 11730] PLUGIN_HOST(11730) starting instance
root INFO [f1fc959e-b059-4c14-97a3-5e386b82060b] Sync of 1 plugin took: 58.330000028945506 ms
root WARN Error: 'cpp' language is remapped from 'source.cpp' to 'source.cpp.embedded.latex' scope
    at TextmateRegistry.push.../../packages/monaco/lib/browser/textmate/textmate-registry.js.TextmateRegistry.mapLanguageIdToTextmateGrammar (https://mydomainname.com/35.bundle.js:815:26)
    at https://mydomainname.com/89.bundle.js:8506:125
    at pushContribution (https://mydomainname.com/89.bundle.js:8381:32)
    at _loop_3 (https:/mydomainname.com/89.bundle.js:8506:21)
    at PluginContributionHandler.push.../../packages/plugin-ext/lib/main/browser/plugin-contribution-handler.js.PluginContributionHandler.handleContributions (https://mydomainname.com/89.bundle.js:8517:21)
    at _loop_2 (https://mydomainname.com/89.bundle.js:1797:63)
    at HostedPluginSupport.push.../../packages/plugin-ext/lib/hosted/browser/hosted-plugin.js.HostedPluginSupport.loadContributions (https://mydomainname.com/89.bundle.js:1818:17)
    at HostedPluginSupport.<anonymous> (https://mydomainname.com/89.bundle.js:1667:52)
    at step (https://mydomainname.com/89.bundle.js:1502:23)
    at Object.next (https://mydomainname.com/89.bundle.js:1483:53)
root WARN Could not register keybinding:
  {"command":"latex-workshop.shortcut.textsubscript","keybinding":"ctrl+l ctrl+oem_minus"}
Error: Unrecognized key 'oem_minus' in 'ctrl+oem_minus'
root INFO [f1fc959e-b059-4c14-97a3-5e386b82060b][james-yu.latex-workshop]: Loaded contributions.
root INFO [f1fc959e-b059-4c14-97a3-5e386b82060b] Load contributions of 1 plugin took: 228.7550000473857 ms
root WARN Invalid embedded language found at scope source.asymptote: <<0>>
root WARN Invalid embedded language found at scope source.dot: <<0>>
root WARN Invalid embedded language found at scope source.gnuplot: <<0>>
root WARN Invalid embedded language found at scope source.js: <<0>>
root WARN Invalid embedded language found at scope source.scala: <<0>>
root WARN Invalid embedded language found at scope text.xtml: <<0>>
root WARN Invalid embedded language found at scope source.yaml: <<0>>
root INFO [hosted-plugin: 11730] PLUGIN_HOST(11730): PluginManagerExtImpl/init()
root INFO [hosted-plugin: 11730] PLUGIN_HOST(11730): initializing(latex-workshop@8.2.0 with /home/project/theia/packages/plugin-ext-vscode/lib/node/plugin-vscode-init.js)
root INFO [hosted-plugin: 11730] PLUGIN_HOST(11730): PluginManagerExtImpl/loadPlugin(/tmp/vscode-unpacked/James_Yu_latex_workshop.vsix/extension/out/src/main.js)
root INFO [f1fc959e-b059-4c14-97a3-5e386b82060b][james-yu.latex-workshop]: Started plugin.
root INFO [f1fc959e-b059-4c14-97a3-5e386b82060b] Start of 1 plugin took: 1010.939999949187 ms
@dannaf dannaf mentioned this issue Oct 17, 2019
@akosyakov akosyakov added bug bugs found in the application help wanted issues meant to be picked up, require help vscode issues related to VSCode compatibility labels Oct 17, 2019
@dannaf
Copy link
Author

dannaf commented Oct 21, 2019

Any advice towards this? Obviously LaTeX cannot be used at all effectively without the enter key... =/

I also experienced that with the LaTeX Preview extension loaded via Load Plugin by Id none of the typing keys worked in the Editor, not even the non-enter character keys...

@akosyakov
Copy link
Member

@dannaf Could you try against this PR: #5590?

@dannaf
Copy link
Author

dannaf commented Oct 22, 2019

Same problem still..

@dannaf
Copy link
Author

dannaf commented Jan 11, 2020

Any help on this would be appreciated.

Tried it again now this time through a docker container of theiaide/theia-full and it still fails in the same way. (Docker is running on Ubuntu 18.04 and I'm accessing theia via Chrome on a fresh Windows 10 install).

When deploying the container it warns the following. (I loaded the plugin via vscode:extension/James-Yu.latex-workshop in Deploy plugin by id).

theia-test_1               | root INFO unzipping the VS Code extension 'James_Yu_latex_workshop.vsix' to directory: /tmp/vscode-unpacked/James_Yu_latex_workshop.vsix
theia-test_1               | root INFO PluginTheiaDirectoryHandler: accepting plugin with path /tmp/vscode-unpacked/James_Yu_latex_workshop.vsix
theia-test_1               | root INFO Resolved "vscode:extension/James-Yu.latex-workshop" to a VS Code extension "latex-workshop@8.5.0" with engines: { vscode: '^1.34.0' }
theia-test_1               | root INFO Deploying backend plugin "latex-workshop@8.5.0" from "/tmp/vscode-unpacked/James_Yu_latex_workshop.vsix/extension/out/src/main.js"
theia-test_1               | root INFO [7e7c9254-6c83-4807-9f25-063b09fdc092] Sync of 1 plugin took: 98.14000001642853 ms
theia-test_1               | root WARN Error: 'cpp' language is remapped from 'source.cpp' to 'source.cpp.embedded.latex' scope
theia-test_1               |     at e.mapLanguageIdToTextmateGrammar (https://test.com/bundle.js:14:199304)
theia-test_1               |     at https://test.com/bundle.js:14:531278
theia-test_1               |     at x (https://test.com/bundle.js:14:529003)
theia-test_1               |     at N (https://test.com/bundle.js:14:531207)
theia-test_1               |     at e.handleContributions (https://test.com/bundle.js:14:531754)
theia-test_1               |     at s (https://test.com/bundle.js:8:373983)
theia-test_1               |     at e.loadContributions (https://test.com/bundle.js:8:374464)
theia-test_1               |     at e.<anonymous> (https://test.com/bundle.js:8:372032)
theia-test_1               |     at https://test.com/bundle.js:8:367623
theia-test_1               |     at Object.next (https://test.com/bundle.js:8:367728)
theia-test_1               | root WARN Could not register keybinding:
theia-test_1               |   {"command":"latex-workshop.shortcut.textsubscript","keybinding":"ctrl+l ctrl+oem_minus"}
theia-test_1               | Error: Unrecognized key 'oem_minus' in 'ctrl+oem_minus'
theia-test_1               | root INFO [7e7c9254-6c83-4807-9f25-063b09fdc092][james-yu.latex-workshop]: Loaded contributions.
theia-test_1               | root INFO [7e7c9254-6c83-4807-9f25-063b09fdc092] Load contributions of 1 plugin took: 156.844999990426 ms
theia-test_1               | root INFO [hosted-plugin: 88] PLUGIN_HOST(88) starting instance
theia-test_1               | root INFO [hosted-plugin: 88] PLUGIN_HOST(88): PluginManagerExtImpl/init()
theia-test_1               | root INFO [hosted-plugin: 88] PLUGIN_HOST(88): initializing(latex-workshop@8.5.0 with /home/theia/node_modules/@theia/plugin-ext-vscode/lib/node/plugin-vscode-init.js)
theia-test_1               | root INFO [7e7c9254-6c83-4807-9f25-063b09fdc092][james-yu.latex-workshop]: Started plugin.
theia-test_1               | root INFO [7e7c9254-6c83-4807-9f25-063b09fdc092] Start of 1 plugin took: 233.36499999277294 ms

Then I made a file test.tex and the enter key does not work in it through the Editor. It gives the following error some time later:

theia-test_1               | root ERROR [hosted-plugin: 88] Promise rejection not handled in one second: Error: Command with id 'type' is not registered. , reason: Error: Command with id 'type' is not registered.
theia-test_1               | root ERROR [hosted-plugin: 88] With stack trace: Error: Command with id 'type' is not registered.
theia-test_1               |     at e.<anonymous> (https://test.com/bundle.js:125:1156410)
theia-test_1               |     at https://test.com/bundle.js:125:1154412
theia-test_1               |     at Object.next (https://test.com/bundle.js:125:1154517)
theia-test_1               |     at https://test.com/bundle.js:125:1153429
theia-test_1               |     at new Promise (<anonymous>)
theia-test_1               |     at r (https://test.com/bundle.js:125:1153203)
theia-test_1               |     at e.$executeCommand (https://test.com/bundle.js:125:1156281)
theia-test_1               |     at e.doInvokeHandler (https://test.com/bundle.js:1:901786)
theia-test_1               |     at e.invokeHandler (https://test.com/bundle.js:1:901519)
theia-test_1               |     at e.receiveRequest (https://test.com/bundle.js:1:900807)

@akosyakov
Copy link
Member

akosyakov commented Jan 14, 2020

It looks like a command is not registered with type id. Someone can have a look what it supposed to do in VS Code and implement accordingly in the plugin system. I suppose it should delegate to Monaco. Strange that it is not registered from Monaco already.

@dannaf
Copy link
Author

dannaf commented Jan 14, 2020

@vince-fugnitto can you please comment if you had the Enter key working when you tested it here, and if so please provide a reproducible setup

@vince-fugnitto
Copy link
Member

@vince-fugnitto can you please comment if you had the Enter key working when you tested it here, and if so please provide a reproducible setup

I've verified it and I notice that the issue ENTER key does not work (to create newlines).
It did work however when executing CMD+ENTER.

@dannaf
Copy link
Author

dannaf commented Mar 24, 2024

This issue is outdated and seems to have meanwhile solved itself. The Enter key now works for me in the current LaTeX Workshop vscode extension (installed at runtime in Theia IDE in the browser, followed by a page refresh after installing the extension). It works even without cmd+Enter as mentioned in the comment above.

@dannaf dannaf closed this as completed Mar 24, 2024
@dannaf
Copy link
Author

dannaf commented Mar 24, 2024

Never mind to me closing this issue — this issue still persists. In fact, it is even worse than I previously realized, because even with cmd+Enter as @vince-fugnitto suggested above the behavior is not correct: cmd+Enter does not create a new line where the cursor is, at least not if the cursor is in the middle of a line. Thus a new line cannot be made within an existing line, it seems. Cmd+Enter only appears to be adding a new line after the existing line, with complete disregard to the cursor position.

I may have narrowed the issue a bit. Earlier today when I closed this issue I thought it was working because when I briefly tried a fresh installation of the extension on Theia IDE in the browser the Editor portion seemed to be working. (The Viewer, however, is completely broken, and I made an issue for that here: #13522.) Now later I tried to do actual writing and it was initially successful until I changed the Editor: Word Wrap setting from off to on. Then the Enter key malfunction began, and it persists for me now even after I returned the Editor: Word Wrap setting back to off.

With this present situation this extension is completely unusable in my opinion, unfortunately, and Theia IDE in the browser is not currently able to properly replace vscode (or Overleaf) for LaTeX use with sophisticated IDE features. It is unfortunate enough that the Viewer does not work (#13522), which is the first step to benefiting from the highly desired SyncTeX feature of this vscode extension. But without the Enter key, which this present issue is about, the extension is completely unusable.

@dannaf dannaf reopened this Mar 24, 2024
@dannaf
Copy link
Author

dannaf commented Mar 24, 2024

I guess refreshing the browser page can be a temporary workaround that can keep this extension somewhat usable for now. Refreshing seems to reset the Enter key issue while retaining the new Editor: Word Wrap setting. So it can be used to 'undo' the broken Enter key issue that persisted after I returned the setting to off, by refreshing after returning the setting to off. Or, it can be used to keep the setting as on and regain the functionality of the Enter key.

So all-in-all I currently have a hacky half-working LaTeX Workshop extension on the Theia IDE in the browser: the Viewer is completely broken (#13522) but I can benefit from the Editor features (e.g., syntax highlighting, error parsing, and auto build on save, etc.) if I refresh the browser window after changing the word wrap setting. It's not ideal, but it's something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help vscode issues related to VSCode compatibility
Projects
None yet
Development

No branches or pull requests

3 participants