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

Enabling doc_comment breaks completions for class methods #172

Open
rubikonx9 opened this issue Sep 14, 2017 · 0 comments
Open

Enabling doc_comment breaks completions for class methods #172

rubikonx9 opened this issue Sep 14, 2017 · 0 comments

Comments

@rubikonx9
Copy link

My ~/.tern-project:

{                                                                                                                                                                                                                  
    "ecmaVersion": 6,
    "libs": [
        "ecmascript"
    ],
    "plugins": {
        "commonjs":         {},
        "complete_strings": {},
        "doc_comment":      null,
        "node":             {},
        "node_resolve":     {}
    }
}

My sublime tern config:

{
    "tern_output_style":             "tooltip",
    "tern_argument_hints":           true,
    "tern_argument_completion":      true,
    "tern_inhibit_word_completions": true
}

Consider the following code:

// x.js

class X {
    /**
     * Ctor
     *
     * @return {void} Nothing
     */
    constructor() {
        this.e = 1;
    }

    /**
     * Test
     *
     * @param  {int} a Number
     *
     * @return {int}   Returned number
     */
    x(a) {
        return 2 * a;
    }
}

module.exports = X;

And

#!/usr/bin/env node

// y.js

const X = require("x");

x = new X();

If doc_comment plugin is disabled, the completions work correctly.
If I enable it (either by setting "doc_comment": {} or by removing it completely), however, the completions stop working for x variable. They still work correctly for static functions, classes, and so on; just not for classes' member functions.

There are no errors in the console, and I'm not quite sure how to debug it.
I'm using an up-to-date Arch Linux and ST nightly build 3142.

I'm not quite sure if this is tern or tern_for_sublime issue, but I haven't used tern outside of sublime at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant