question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] PnPify (Typescript) for VSCode workspaces

See original GitHub issue
  • I’d be willing to implement this feature
  • This feature can already be implemented through a plugin

Describe the user story

I develop a big system that includes many Git repos. All repos use Typescript and they’re added to one VSCode workspace. I very often do refactoring on all repos together. Howerer, PnPify always installed in projects folders. So I can’t refactor all repos together because PnPify can’t process all .pnp.js at once.

Describe the solution you’d like

I want that it would be possible to install PnPify on the VSCode workspace level and it processes all .pnp.js at once.

Describe the drawbacks of your solution

I think that all projects in a workspace should use PnP, I.e. I guess it’s impossible to mix projects with and without PnP.

Describe alternatives you’ve considered

There aren’t alternatives that can satisfy it.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
doman412commented, Jan 2, 2021

I’m having issues with this as well. I’m not sure if this is necessarily a yarn/berry issue or something that vscode is incapable of doing at the moment. My use case is that I have a single workspace for a backend that has multiple services, each with their own repo.

You should be able to repro this by creating a new workspace with multiple folders:

  • Open a new vscode window
  • cmd-palette: >Workspaces: Add Folder to Workspace
    • add 2 projects that use yarn2/pnp with the vscode sdk
  • Checking the .vscode/settings.json you should see: Screen Shot 2021-01-01 at 6 43 00 PM
    • this causes modules to not resolve

There is a related issue over at microsoft/vscode#108866 that didn’t gain enough thumbs unfortunately.

0reactions
JackCAcommented, May 10, 2021

I also just tracked down my same issue to this.

Is it correct to say that in order to use yarn 2 pnp workspaces you must create a different vscode workspace per directory?

Also, this user says they have created a forked version of vscode’s native tsserver to support his use case: https://github.com/microsoft/vscode/issues/108866#issuecomment-753240892 but I haven’t tried it personally.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Editor SDKs | Yarn - Package Manager
An overview of the editor SDKs used to bring PnP compatibility to editors.
Read more >
TypeScript Programming with Visual Studio Code
TypeScript in Visual Studio Code. TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It offers classes, modules, and interfaces ......
Read more >
Is `pnpify --sdk vscode` needed if you aren't using PnP with ...
No, its not necessary with node-modules linker.
Read more >
Getting started with Yarn 2 and TypeScript | by xsmith - Medium
It's that simple. Of course, you can also run yarn pnpify --sdk vim . I personally use Visual Studio Code. Either way, this...
Read more >
Using Yarn v2 workspace, Docker Compose and Visual Studio ...
workspaces. Plug'n'Play. The following features of Visual Studio Code: The Remote Container Extension. IntelliSense provided by the TypeScript language server.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found