microsoft / microsoft/nodejstools

Project dependencies not discoverable (Open Folder extensibility)

Open
#2,257 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
1.8k
Forks
355
PR merge metrics
No merged PRs in 30d

Description

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 :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Open Folder indexing service, GetProjectConfigurationServiceAsync, GetIndexWorkspaceService, and GetFileReferencesAsync usage shown in the issue. Determine whether Node.js tooling exposes dependency file paths through the standard FileReferenceResult or FileReferenceInfoType interfaces; done means dependencies are discoverable for an Open Folder Node.js Express app through that common service.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, node.js
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.