microsoft/nodejstools

Project dependencies not discoverable (Open Folder extensibility)

aodl opened this issue · 0 comments

aodl commented

Nodejs tooling is indicated to support Open Folder.

Expected Behavior

After creating an empty Nodejs Express app, switching to folder view (therefore project is loaded by Open Folder), I expected to be able to retrieve the dependencies of the express app using the Open Folder indexing service,

var projConfigService = await workspace.GetProjectConfigurationServiceAsync();
var currStartupFile = projConfigService.CurrentProject.FilePath;
var indexService = workspace.GetIndexWorkspaceService();
var dependencyResult = await indexService.GetFileReferencesAsync(currStartupFile, referenceTypes: (int)FileReferenceInfoType.Dependency));
// dependencyResult is empty :( 

Actual Behavior

The dependencyResult result set is empty, in addition to the result sets returned when trying this with other types of FileReferenceInfoType. It appears that Nodejs tooling does not implement support for the Open Folder indexing service.

Additional Context

One of the reasons that the Open Folder feature exists is to facilitate extension authors to create rich features for any language, by defining common extension points such as FileReferenceResult. Otherwise an extension author has to consider the special cases of each language and the way that the tooling has been implemented, making it infeasible to ship language agnostic extensions.

I'm hoping there is a way to discover dependency locations (file paths) for Nodejs project loaded in Visual Studio Open Folder that isn't unique to Nodejs (exposed by some standard set of interfaces).

Information and guidance relating to this would be much appreciated :)