forked from nrwl/nx-console
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vscode): show pdv open to side button on all files that define a …
…project (nrwl#1999)
- Loading branch information
Showing
10 changed files
with
77 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { lspLogger } from '@nx-console/language-server/utils'; | ||
import { nxWorkspace } from './workspace'; | ||
|
||
/** | ||
* iterate over sourcemaps and return all files that were involved in creating a project along with the project name | ||
*/ | ||
export async function getSourceMapFilesToProjectMap( | ||
workingPath: string | ||
): Promise<Record<string, string>> { | ||
const { workspace } = await nxWorkspace(workingPath); | ||
const sourceMapFilesToProjectMap: Record<string, string> = {}; | ||
|
||
Object.entries(workspace.sourceMaps ?? {}).forEach( | ||
([projectName, sourceMap]) => { | ||
Object.values(sourceMap).forEach(([file]) => { | ||
if (!sourceMapFilesToProjectMap[file]) { | ||
sourceMapFilesToProjectMap[file] = projectName; | ||
} | ||
}); | ||
} | ||
); | ||
|
||
return sourceMapFilesToProjectMap; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { NxSourceMapFilesToProjectMapRequest } from '@nx-console/language-server/types'; | ||
import { sendRequest } from '@nx-console/vscode/lsp-client'; | ||
|
||
export async function getSourceMapFilesToProjectMap(): Promise< | ||
Record<string, string> | ||
> { | ||
return sendRequest(NxSourceMapFilesToProjectMapRequest, undefined); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters