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

After a little usage, Camel vs code extensions is providing several times the information (hover, completion) #4181

Closed
apupier opened this issue Jan 29, 2019 · 7 comments
Assignees
Labels
bug bugs found in the application plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility

Comments

@apupier
Copy link
Contributor

apupier commented Jan 29, 2019

image

to install the plugin id:
vscode:extension/camel-tooling.vscode-apache-camel

the xml file that can be used to reproduce:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
    <camelContext id="cbr-example-context" xmlns="http://camel.apache.org/schema/spring">
        <route id="cbr-route">
            <from id="_from1" uri="asterisk:name"/>
            <log id="_log1" message="Receiving order ${file:name}"/>
            <choice id="_choice1">
                <when id="_when1">
                    <xpath id="_xpath1">/order/customer/country = 'UK'</xpath>
                    <log id="_log2" message="Sending order ${file:name} to the UK"/>
                    <to id="_to1" uri="file:work/cbr/output/uk"/>
                </when>
                <when id="_when2">
                    <xpath id="_xpath2">/order/customer/country = 'US'</xpath>
                    <log id="_log3" message="Sending order ${file:name} to the US"/>
                    <to id="_to2" uri="file:work/cbr/output/us"/>
                </when>
                <otherwise id="_otherwise1">
                    <log id="_log4" message="Sending order ${file:name} to another country"/>
                    <to id="_to3" uri="file:work/cbr/output/others"/>
                </otherwise>
            </choice>
            <log id="_log5" message="Done processing ${file:name}"/>
        </route>
    </camelContext>
</beans>

I noticed it after adding also the redhat.vscode-xml VS Code extension but not sure if it is related.

I notice that the Camel Language Server seems to have been started several times as in the bottom blue information bar there are several times "Apache Camel Language Server started"

i'm using "docker run -it -p 3000:3000 -v "C:/Users/Aurelien Pupier/theia:/home/project:cached" theiaide/theia-full:0.3.18" to launch Theia

in console log, it seems that the camel extension is reinitialzed after installed XML extension:

docker run -it -p 3000:3000 -v "C:/Users/Aurelien Pupier/theia:/home/project:cached" theiaide/theia-full:0.3.18
yarn run v1.9.4
$ /home/theia/node_modules/.bin/theia start /home/project --hostname=0.0.0.0
Starting the master backend process with 5000 (ms) timeout.                                                                                                      Starting server worker...
Server worker has been started. [ID: 1 | PID: 38]
Server worker is ready to accept messages. [ID: 1 | PID: 38]
root INFO Theia app listening on http://0.0.0.0:3000.
Received message which is neither a response nor a notification message:
"3000"
root INFO [nsfw-watcher: 48] Started watching: /home/theia/package.json
root INFO [nsfw-watcher: 58] Started watching: /home/project
root WARN e.onStart is slow, took: 406.9000000017695 ms
root INFO [nsfw-watcher: 58] Started watching: /home/project
terminal ERROR Couldn't attach - can't find terminal with id: 2
terminal ERROR Error attaching to terminal id 2, the terminal is most likely gone. Starting up a new terminal instead.
task INFO Config file tasks.json does not exist under file:///home/project
root INFO [nsfw-watcher: 58] Started watching: /home/theia/.theia
root INFO unzipping the plugin ProxyPluginDeployerEntry {
  deployer: PluginVsCodeFileHandler { unpackedFolder: '/tmp/vscode-unpacked' },
  delegate:
   PluginDeployerEntryImpl {
     originId: 'vscode:extension/camel-tooling.vscode-apache-camel',
     pluginId: 'vscode:extension/camel-tooling.vscode-apache-camel',                                                                                                  map: Map {},
     changes: [],
     acceptedTypes: [],
     currentPath: '/tmp/vscode-extension-marketplace/vscode_extension_camel_tooling_vscode_apache_camel.vsix',
     initPath: '/tmp/vscode-extension-marketplace/vscode_extension_camel_tooling_vscode_apache_camel.vsix',
     resolved: true,
     resolvedByName: 'VsCodePluginDeployerResolver' },
  deployerName: 'PluginVsCodeFileHandler' }
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /tmp/vscode-unpacked/vscode_extension_camel_tooling_vscode_apache_camel.vsix
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /tmp/vscode-unpacked/vscode_extension_camel_tooling_vscode_apache_camel.vsix
root INFO accepting packagejson with engines { vscode: '^1.25.1' }
root INFO HostedPluginServerImpl/ asking to deploy the backend Plugin /tmp/vscode-unpacked/vscode_extension_camel_tooling_vscode_apache_camel.vsix/extension and model is { id: 'camel-tooling.vscode-apache-camel',
  name: 'vscode-apache-camel',
  publisher: 'camel-tooling',
  version: '0.0.13',
  displayName: 'Language Support for Apache Camel',
  description: 'Provides completion and documentation features for Apache Camel URI elements in XML DSL.',
  engine: { type: 'vscode', version: '^1.25.1' },
  entryPoint:
   { backend: '/tmp/vscode-unpacked/vscode_extension_camel_tooling_vscode_apache_camel.vsix/extension/out/extension' },
  contributes: { languages: [ [Object], [Object] ] } }
root INFO [hosted-plugin: 154] PLUGIN_HOST(154) starting instance

root INFO [hosted-plugin: 154] PLUGIN_HOST(154): PluginManagerExtImpl/init()

root INFO [hosted-plugin: 154] PLUGIN_HOST(154): initializing(/home/theia/node_modules/@theia/plugin-ext-vscode/lib/node/plugin-vscode-init.js)

root INFO [hosted-plugin: 154] PLUGIN_HOST(154): PluginManagerExtImpl/loadPlugin(/tmp/vscode-unpacked/vscode_extension_camel_tooling_vscode_apache_camel.vsix/extension/out/extension)

root INFO [hosted-plugin: 154] /tmp/vscode-unpacked/vscode_extension_camel_tooling_vscode_apache_camel.vsix/extension/jars/language-server.jar

root INFO [nsfw-watcher: 58] Started watching: /home/project/camel.xml
root INFO unzipping the plugin ProxyPluginDeployerEntry {
  deployer: PluginVsCodeFileHandler { unpackedFolder: '/tmp/vscode-unpacked' },
  delegate:
   PluginDeployerEntryImpl {
     originId: 'vscode:extension/redhat.vscode-xml',
     pluginId: 'vscode:extension/redhat.vscode-xml',
     map: Map {},
     changes: [],
     acceptedTypes: [],
     currentPath: '/tmp/vscode-extension-marketplace/vscode_extension_redhat_vscode_xml.vsix',
     initPath: '/tmp/vscode-extension-marketplace/vscode_extension_redhat_vscode_xml.vsix',
     resolved: true,
     resolvedByName: 'VsCodePluginDeployerResolver' },
  deployerName: 'PluginVsCodeFileHandler' }
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /tmp/vscode-unpacked/vscode_extension_redhat_vscode_xml.vsix
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /tmp/vscode-unpacked/vscode_extension_redhat_vscode_xml.vsix
root INFO accepting packagejson with engines { vscode: '^1.27.0' }
root INFO HostedPluginServerImpl/ asking to deploy the backend Plugin /tmp/vscode-unpacked/vscode_extension_redhat_vscode_xml.vsix/extension and model is { id: 'redhat.vscode-xml',
  name: 'vscode-xml',
  publisher: 'redhat',
  version: '0.3.0',
  displayName: 'XML',
  description: 'XML Language Support by Red Hat',
  engine: { type: 'vscode', version: '^1.27.0' },
  entryPoint:
   { backend: '/tmp/vscode-unpacked/vscode_extension_redhat_vscode_xml.vsix/extension/out/src/extension' },
  contributes:
   { configuration:
      { type: 'object',
        title: 'XML configuration',
        properties: [Object] } } }
root INFO [hosted-plugin: 154] PLUGIN_HOST(154): PluginManagerExtImpl/init()

root INFO [hosted-plugin: 154] PLUGIN_HOST(154): initializing(/home/theia/node_modules/@theia/plugin-ext-vscode/lib/node/plugin-vscode-init.js)
PLUGIN_HOST(154): initializing(/home/theia/node_modules/@theia/plugin-ext-vscode/lib/node/plugin-vscode-init.js)
PLUGIN_HOST(154): PluginManagerExtImpl/loadPlugin(/tmp/vscode-unpacked/vscode_extension_camel_tooling_vscode_apache_camel.vsix/extension/out/extension)

root INFO [hosted-plugin: 154] /tmp/vscode-unpacked/vscode_extension_camel_tooling_vscode_apache_camel.vsix/extension/jars/language-server.jar
PLUGIN_HOST(154): PluginManagerExtImpl/loadPlugin(/tmp/vscode-unpacked/vscode_extension_redhat_vscode_xml.vsix/extension/out/src/extension)

root ERROR [hosted-plugin: 154] (node:154) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'editor.autoClosingBrackets' of undefined
    at verifyAutoClosing (/tmp/vscode-unpacked/vscode_extension_redhat_vscode_xml.vsix/extension/out/src/extension.js:127:47)
    at didChangeConfiguration (/tmp/vscode-unpacked/vscode_extension_redhat_vscode_xml.vsix/extension/out/src/extension.js:59:29)
    at ConfigurationFeature.onDidChangeConfiguration (/tmp/vscode-unpacked/vscode_extension_redhat_vscode_xml.vsix/extension/node_modules/vscode-languageclient/lib/client.js:1488:15)
    at ConfigurationFeature.register (/tmp/vscode-unpacked/vscode_extension_redhat_vscode_xml.vsix/extension/node_modules/vscode-languageclient/lib/client.js:1449:18)
    at ConfigurationFeature.initialize (/tmp/vscode-unpacked/vscode_extension_redhat_vscode_xml.vsix/extension/node_modules/vscode-languageclient/lib/client.js:1435:18)
    at LanguageClient.initializeFeatures (/tmp/vscode-unpacked/vscode_extension_redhat_vscode_xml.vsix/extension/node_modules/vscode-languageclient/lib/client.js:2297:21)
    at connection.initialize.then (/tmp/vscode-unpacked/vscode_extension_redhat_vscode_xml.vsix/extension/node_modules/vscode-languageclient/lib/client.js:2002:18)
    at <anonymous>

root ERROR [hosted-plugin: 154] (node:154) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:154) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

root ERROR [hosted-plugin: 154] (node:154) UnhandledPromiseRejectionWarning: Error: Command apache.camel.open.output already has handler
    at CommandRegistryImpl.registerHandler (/home/theia/node_modules/@theia/plugin-ext/lib/plugin/command-registry.js:46:19)
    at Object.registerHandler (/home/theia/node_modules/@theia/plugin-ext/lib/plugin/plugin-context.js:129:40)
    at Object.vscode.commands.registerCommand (/home/theia/node_modules/@theia/plugin-ext-vscode/lib/node/plugin-vscode-init.js:45:36)
    at languageClient.onReady.then (/tmp/vscode-unpacked/vscode_extension_camel_tooling_vscode_apache_camel.vsix/extension/out/extension.js:48:27)
    at <anonymous>
(node:154) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 20)
@apupier apupier changed the title After a little usage, Camel vs code extensions is providing several times hover After a little usage, Camel vs code extensions is providing several times the hover Jan 29, 2019
@apupier apupier changed the title After a little usage, Camel vs code extensions is providing several times the hover After a little usage, Camel vs code extensions is providing several times the information (hover, completion) Jan 29, 2019
@paoloantinori
Copy link

//subscribe

@tsmaeder
Copy link
Contributor

tsmaeder commented Feb 6, 2019

@apupier do you refresh the browser or any such thing?

@tsmaeder tsmaeder added plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility labels Feb 6, 2019
@apupier
Copy link
Contributor Author

apupier commented Feb 6, 2019

do you refresh the browser or any such thing?

it is possible that I refreshed the browser.
I'm sorry but I didn't detected a specific pattern to have this state.
I just noticed that based on log the plugin seems to be reinitialized after I tried to install the xml extension unsucessfully

@tsmaeder
Copy link
Contributor

From reading the log, it seems that "deploy plugin by id" always unzips to the same dir. Also, I suspect that we reinitialize all plugins in that folder (thus initializing the camel plugin twice)

@akosyakov
Copy link
Member

For electron-based products all plugins should be installed in the same folder, like userhome/.myprodcut/plugins. It would be nice if plugin system syncs plugins only when it is needed. @tsmaeder @svenefftinge Reasonable?

@tsmaeder
Copy link
Contributor

@akosyakov hmh...what's the connection to this issue? I mean we're talking about a straightforward bug here, right?

@akosyakov
Copy link
Member

@tsmaeder ok, probably misunderstood, thought you meant some kind of plugin synching while deploying, if not just ignore it

@tolusha tolusha self-assigned this Mar 18, 2019
@tolusha tolusha added the bug bugs found in the application label Mar 18, 2019
@tolusha tolusha closed this as completed Mar 27, 2019
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 plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility
Projects
None yet
Development

No branches or pull requests

5 participants