Everlaw / nbts

NetBeans TypeScript editor plugin
283 stars 46 forks source link

Annotation @deprecated is not supported #61

Closed kephas123 closed 8 years ago

kephas123 commented 8 years ago

Hi,

If the annotation

@deprecated

is used in the documentation, NetBeans doesn't show the import/function/module/class as "striked" (like in Java).

Using Angular 2.0.0-rc5 (Router 3.0.0-rc1 / http.d.ts), the HTTP_PROVIDERS is annoted as deprecated :

/*
 * [...]
 * @deprecated
 */
export declare const HTTP_PROVIDERS: any[];
jeffrey-easyesi commented 8 years ago

There actually already is support for "@deprecated", but I found two bugs that would make it ineffective in some cases:

  1. For variable declarations with modifiers (export or declare) it would not detect the annotation because it was looking in the wrong place (specifically, before the var/let/const keyword, rather than before the beginning of the statement)
  2. The strikeout style was not shown when using ES6 import syntax to directly import specific variables (e.g. import {HTTP_PROVIDERS} from '@angular/http'), rather than importing the whole module and using dotted access (import * as h from '@angular/http'; h.HTTP_PROVIDERS)

Both of these should be fixed in the latest release, v1.8.10.4.

kephas123 commented 8 years ago

Tested and it's working as expected.

Thank you