3

I'm running Eclipse Kepler with Nodeclipse and am having trouble getting the Tasks view to show my markers.

  1. I have defined my own FEATURE tag as "text contains FEATURE" but it's not showing up.

  2. I can't limit my node.js tasks to my own project. When I set it to "show all", it'll show me hundreds of tasks from node modules I'm using. When I set it as in the screenshot, it doesn't show me any tasks at all any more.

I could live with 1. but 2. is a serious problem for me... Is this a bug in Kepler or do I have a configuration error?

This is how I have it configured:

Task view settings

My project is among the selected working sets. Task tags are enabled in Preferences->Javascript.

UPDATE

This has turned out to be several related issues coming together, so here's an attempt to organize and summarize what progress has been made: (all the following only deals with point 2 of the question)

  1. "Show all" not respecting the selected scope is the desired behavior. Scopes are part of the configuration (the UI hints at this by putting them in the "Configuration" group pane), which the "Show all" setting bypasses. So this is not actually a functionality error, just misleading UI. I've raised the issue here

  2. Javascript tasks not being shown at all can be worked around by going to Preferences -> Javascript -> Validator -> Task Tags, changing something and applying. This triggers a rebuild and incorporates any task tags there are in the code. However, future tasks are not incorporated automatically. This appears to be a known issue.

  3. The problem of node modules polluting the tasks view can be solved by making the folder a library folder instead of a source folder. See this answer to this question

Community
  • 1
  • 1
BadIdeaException
  • 2,125
  • 15
  • 32
  • Regarding "Javascript tasks not being shown at all": For me it was fixed by "building" (Ctrl+B) the corresponding JavaScript project – Ignitor Aug 11 '15 at 09:29

2 Answers2

2

One of the wizards on the Eclipse BugZilla explained an easy solution to it showing TODOs from node modules:

The node_modules folder has to be made a library folder. To do that, one needs to go to Project -> Properties -> Javascript -> Include Path, choose the "Libraries" tab, click "Add a library folder..." and set it to the node_modules subfolder.

Simple as that.

Here is the source: https://bugs.eclipse.org/bugs/show_bug.cgi?id=432231#c4

UPDATED:

Nodeclipse project config will be updated in 0.15 to solve the issue

node_modules-2-as-lib-folder

node_modules-3-project-overview-after-configuration

See https://github.com/Nodeclipse/nodeclipse-1/issues/143

Paul Verest
  • 60,022
  • 51
  • 208
  • 332
BadIdeaException
  • 2,125
  • 15
  • 32
  • On Eclipse 4.4 Luna (Enide Studio 2014) I got error "Cannot nest 'NodeProject1/node_modules' inside 'NodeProject1'. To enable the nesting exclude 'node_modules/' from 'NodeProject1'". Impossible to add `node_modules` as Library Folder – Paul Verest Apr 09 '14 at 02:58
  • I played with just about every switch, dialog and setting I could find while trying to make it work, one of them must be why it's working for me but not for you. I'm guessing it's this: Go to Project->Properties->Javascript->Include Path and on tab "Source" add an exclusion pattern for `node_modules/**/*`. Does that fix it? – BadIdeaException Apr 09 '14 at 06:05
  • I also excluded `node_modules` and all its subfolders from the working set. – BadIdeaException Apr 09 '14 at 06:16
  • Let's continue in https://github.com/Nodeclipse/nodeclipse-1/issues/143, SO is not good place for a discussion. – Paul Verest Apr 09 '14 at 07:03
0

On screenshot you have scope "On working set", not "in the same project". Though even with that filter it did not work for me on Eclipse Luna 4.4.M4 (Enide Studio 2014)

Note that JavaScript Task are added by JSDT, that is not Node.js aware (so it cannot handle node_modules)

Raise a bug on https://bugs.eclipse.org/bugs/ (and share here)

UPDATE:

From Bug 432231 - Tasks view not working correctly on Javascript projects it reads that TODOs are processed by JSDT builder when .project includes it like

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>JSDTJavaScriptProject</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
    </natures>
</projectDescription>

while Nodeclipse .project template is like below (Using JSHInt instead of JSDT Validator)

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>NodeExpressEjsLESS</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>com.eclipsesource.jshint.ui.builder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.nodeclipse.ui.NodeNature</nature>
        <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
    </natures>
</projectDescription>

This was done because JSDT does not support ECMAScript 5 Bug 223131 - [language support] Add ecmascript4 /JavaScript 2 compiler compliance level . That is not trivial thing to do.

See also How to ignore node shebang error in Eclipse? answer on why current configuration is recommended.

Parsing TODOs by JSHInt-Eclipse is open issue https://github.com/eclipsesource/jshint-eclipse/issues/68 But it was said, it should be better independent plugin.

Community
  • 1
  • 1
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
  • I was able to make it show my markers in a lengthy and annoying workaround (you basically have to go to Javascript Task Tags preferences change something and apply to force a full rebuild...found it here on SO but can't find the answer anymore.) Here's the bug report https://bugs.eclipse.org/bugs/show_bug.cgi?id=432231 – BadIdeaException Apr 08 '14 at 08:26