Polymer / vscode-plugin

Provides autocompletion, linting, and more for web components.
Other
74 stars 11 forks source link

polymer-ide does not work for some projects #48

Closed nguyenhuedang closed 6 years ago

nguyenhuedang commented 7 years ago

Since update, the IDE does not response any suggest about attributes completions or document, I also can not jump to any component by ⌘ + click any more. I have try on both my Mac & my teammate's one, with many different project as well. Is it a bug? Thank you.

rictic commented 7 years ago

Hm, interesting, autocompletions and jump to element definition are working for me on my mac. Do you see any errors in the plugin's output window? Press cmd-shift-u to bring up the output window and select vscode-plugin in the dropdown (if it's present).

A few other things to confirm:

tony19 commented 7 years ago

This also happens for me in the starter-kit and shop templates from polymer-cli. However, the plugin works fine for the application template.

Steps to reproduce

  1. Use polymer-cli to generate starter-kit project
  2. Open project in VS Code, then open my-app.html
  3. Hold and click on <my-view1> at line 94.

Expected Behavior

VS Code opens my-view1.html (and jumps to the Polymer declaration).

Actual Behavior

Nothing happens.

Environment

tony19 commented 7 years ago

Do you see any errors in the plugin's output window?

No, it's blank.

do you get diagnostics from the plugin? for example, if you have an html import like <link rel="import" href="does-not-exist.html"> is the url underlined in red?

@rictic No red underlines.

rictic commented 7 years ago

Awesome, thanks for the repro steps! I can reproduce this.

rictic commented 7 years ago

Ok, I've isolated the bug. We're using the STDIO transport for communicating between vscode and the plugin. This is all good, except that we shouldn't do any logging to stdout or stderr, or it will disrupt that communications channel. If this happens when the plugin is first booting up the observed behavior is that the plugin will fail to start.

The warning that's being logged for starter-kit is due to using sourceGlobs and includeDependencies in polymer.json. A work around for this specific issue is to rename those fields in your polymer.json to their new names sources and extraDependencies.

I'm taking a look now at what we can do to prevent this class of bug.

rictic commented 7 years ago

Huh, the github regex for when a commit fixes an issue is more sensitive than I thought.

rictic commented 7 years ago

The fix for this issue was just published in v0.4.2

tony19 commented 7 years ago

@rictic Hmm, I'm still able to reproduce the bug in v0.4.2, using the steps I listed above. Is it working for you?

rictic commented 7 years ago

Hm, you know, I tested my minimal repro but not the full starter-kit template.

rictic commented 7 years ago

Can confirm that the issue isn't fixed. Interesting. Thanks for the quick comment @tony19

tony19 commented 7 years ago

@rictic ~Just installed everything anew on a laptop, and it seems to be working correctly.~ Correction: The plugin works correctly for the polymer-2-starter-kit but not polymer-1-starter-kit.

rictic commented 7 years ago

I can repro some super slow flakiness on polymer-1-starter-kit. I get some lint warnings, slowly and gradually, but it seems like something in psk 1 is triggering some pathological slowness/weirdness. Needs more investigation.