You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VS2015 code editor for TypeScript shows all the references incorrectly #8118
import { ITemplate, ITemplateEvents, IApplication, IVoidPromise, IEditable, IBaseObject,
TEventHandler, ISelectableProvider, IDeferred } from "jriapp_core/shared";
import * as langMOD from "jriapp_core/lang";
import { BaseObject } from "jriapp_core/object";
import { Utils as utils, DomUtils as dom, ERROR } from "jriapp_utils/utils";
import { bootstrap } from "jriapp_core/bootstrap";
import { ViewModel } from "jriapp_parts/mvvm";
Actual behavior:
When i click in VS2015 code editor with right button on imported class or interface or variable
and select "Find all references" in the menu it finds all the references for imported variable in the whole project !
P.S. - Stange but for import * as langMOD from "jriapp_core/lang";
if i click on langMOD to find refences for it then it produces correct result- for the references to langMOD in the current module.
But for all other imported parts which use {} to import them. The result is references in the whole project.
with find-all-references we try to find them all when possible. For import * as langMOD from "jriapp_core/lang";langMOD really means one thing, and it is local to this module, and cannot be accessed outside. but import { ViewModel } from "jriapp_parts/mvvm";ViewModel can both mean the local name ViewModel and the name of the export ViewModule in "jriapp_parts/mvvm", so we show both. if that was renamed, i.e. import { ViewModel as localViewModel } from "jriapp_parts/mvvm"; then localViewModel would be local only.
the other aspect here is rename. Rename is built on find-all-references, we would want to make sure that starting with a working state, when your rename ViewModle you get to another working state, and not some of your imports are invalid.
I think there is a part here that we need to fix, namely renaming something in a declaration file. if the module declaration is coming from a declaration file, renaming the import should not rename the export, as this is meaningless, we should rename the local import.
Activity
mhegazy commentedon Apr 19, 2016
with find-all-references we try to find them all when possible. For
import * as langMOD from "jriapp_core/lang";langMODreally means one thing, and it is local to this module, and cannot be accessed outside. butimport { ViewModel } from "jriapp_parts/mvvm";ViewModelcan both mean the local nameViewModeland the name of the exportViewModulein"jriapp_parts/mvvm", so we show both. if that was renamed, i.e.import { ViewModel as localViewModel } from "jriapp_parts/mvvm";thenlocalViewModelwould be local only.the other aspect here is rename. Rename is built on find-all-references, we would want to make sure that starting with a working state, when your rename
ViewModleyou get to another working state, and not some of your imports are invalid.mhegazy commentedon Apr 20, 2016
I think there is a part here that we need to fix, namely renaming something in a declaration file. if the module declaration is coming from a declaration file, renaming the import should not rename the export, as this is meaningless, we should rename the local import.
related to #7458 and #8213.
mhegazy commentedon Apr 20, 2016
Filed a new issue for it in #8227