Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

templateFiles is always resolved relative to workspace instead of root #31

Open
7iomka opened this issue Sep 5, 2023 · 0 comments
Open

Comments

@7iomka
Copy link

7iomka commented Sep 5, 2023

Hi
My workspace config in the root
.vscode/project.code-workspace

{
  "folders": [
    {
      "name": "ROOT",
      "path": "../"
    },
    {
      "name": "@project/store",
      "path": "../apps/store"
    },
   ],
    "typescript.tsdk": "ROOT/node_modules/typescript/lib",
    "module-templates.templateFiles": [
      "./templates/next-with-effector-view/.module-templates.json"
    ],
    "module-templates.engine": "handlebars"
}

templates is located in this folder, so link is relative.

I opened project like workspace:
File -> Open workspace from file then select workspace file from .vscode/project.code-workspace

After in the sidebar I see separate folder for store app, I open it, select any folder and try to New from template command with right click.
I always get error

File not found: '/Users/7iomka/Desktop/projects/react/project/apps/store/.vscode/templates/next-with-effector-view/.module-templates.json'

So your extension always tries to find the provided path under workspace but if not found, it doesn't try to look in the project root.
Some extensions like typescript support aliased values for this, like in example ROOT.
Or even native vscode ${workspaceFolder}.

I'm very frustrated that I can't get a plugin going now for my monorepository.
Appreciate any help you can give me

One workaround that I found that I need now in every workspace (folder) to create separare .vscode/setting.json
with the following content

{
  "module-templates.templateFiles": [
    "../../../.vscode/templates/next-with-effector-view/.module-templates.json"
  ]
}

It works ok, but I would like to have fallback to the root vscode config if the local was not settled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant