LearnNewsExamplesServices
Frontmatter
id5773
titleNeo.setupClass() => better IDE support
stateClosed
labels
enhancement
assigneestobiu
createdAtAug 18, 2024, 10:46 AM
updatedAtAug 18, 2024, 10:51 AM
githubUrlhttps://github.com/neomjs/neo/issues/5773
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtAug 18, 2024, 10:51 AM

Neo.setupClass() => better IDE support

Closed v8.1.0 enhancement
tobiu
tobiu commented on Aug 18, 2024, 10:46 AM

The recent code changes do affect the IDE support.

Before:

/**
 * The base class for (almost) all classes inside the Neo namespace
 * Exceptions are e.g. core.IdGenerator, vdom.VNode
 * @class Neo.core.Base
 */
class Base {
    // ...
}

Neo.setupClass(Base);

export default Base;

Now:

/**
 * The base class for (almost) all classes inside the Neo namespace
 * Exceptions are e.g. core.IdGenerator, vdom.VNode
 * @class Neo.core.Base
 */
class Base {
    // ...
}

export default Neo.setupClass(Base);

My IDE was showing classes in white and the file src was correct

Screenshot 2024-08-18 at 07 45 46

Now the IDE switched to purple, declares everything as Neo.core.Base and points to the current file:

Screenshot 2024-08-18 at 07 45 58

tobiu added the enhancement label on Aug 18, 2024, 10:46 AM
tobiu assigned to @tobiu on Aug 18, 2024, 10:46 AM
tobiu referenced in commit 2836877 - "Neo.setupClass() => better IDE support #5773" on Aug 18, 2024, 10:47 AM
tobiu
tobiu Aug 18, 2024, 10:51 AM

with making clear for setupClass(cls) that the return value is the same type as the param, the IDE support got a bit better again.

The hint still points to the current file and the color is still purple instead of white:

Screenshot 2024-08-18 at 10 48 13

But it is at least no longer saying Neo.core.Base, but the correct class extension. Clicking on the class (blue .Text in this case), points to the correct file:

Screenshot 2024-08-18 at 10 48 29

tobiu closed this issue on Aug 18, 2024, 10:51 AM