Settings cannot be applied per folder
Operating System
MacOS Sonoma
Ruby version
3.2
Project has a bundle
- [ ] Has bundle
Ruby version manager being used
asdf
Description
Every time I open/reload VS Code, I get a bunch of warnings that our project is not set up correctly. We are using a monorepo setup with a ruby api and a nextjs web app.
my_project/
client-web/ <-- nextjs app
server-api/ <-- ruby app
Thank you for the bug report! Did you already configure your multi-root workspace? And does the issue persist on v0.5.5?
Thank you for the bug report! Did you already configure your multi-root workspace? And does the issue persist on v0.5.5?
Sorry for the delay! Yes, we have the multi-root workspace configured already. Other extensions seem to work fine? And its still happening in 0.5.8 :(
Can you share the contents of your .code-workspace please.
Sorry for the delay.
You can still configure settings per root folder and the Settings editor will present a third setting scope called Folder Settings: https://code.visualstudio.com/docs/editor/workspaces#_multiroot-workspace-settings
Following this example .vscode/project.code-workspace:
{
"folders": [
{
"path": "../server-api"
},
{
"path": "../client-web"
},
{
"path": ".."
}
],
"settings": {
// @see https://code.visualstudio.com/docs/getstarted/settings#_default-settings
// @see https://code.visualstudio.com/docs/getstarted/settings#_workspace-settings/
"editor.tabSize": 2,
"editor.insertSpaces": true,
"jest.disabledWorkspaceFolders": ["project", "server-api"],
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
},
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
// vvv THIS SHOULD BE IN server-api !!! vvv //
"[ruby]": {
"editor.formatOnSave": true,
"editor.semanticHighlighting.enabled": true,
"editor.defaultFormatter": "Shopify.ruby-lsp"
},
"rubyLsp.yjit": true,
"rubyLsp.formatter": "rubocop",
"rubyLsp.rubyVersionManager": "asdf",
// ^^^ THIS SHOULD BE IN server-api !!! ^^^ //
"files.associations": {
".env.*": "properties"
},
"typescript.tsdk": "client-web/node_modules/typescript/lib",
// if these formattings get annoying we can move them to specific language settings:
// @see https://stackoverflow.com/a/16224292/56713
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
// @see https://github.com/relayjs/relay-examples/blob/main/.vscode/settings.json
"relay.projects": [
{
"name": "client-web",
"rootDirectory": "./client-web"
}
]
}
}
server-api/.vscode/settings.json:
{
// TODO FIXME: ruby LSP settings go here
"prettier.enable": false,
"jest.enable": false,
"eslint.enable": false,
}
Your configuration looks fine to be honest. This might be a silly question, but did you open the configured workspace in VS Code (as opposed to just opening the directory)?
When you open the project.code-workspace file, there should be a button in the bottom right corner offering to open that workspace in VS Code.
Your configuration looks fine to be honest. This might be a silly question, but did you open the configured workspace in VS Code (as opposed to just opening the directory)?
When you open the
project.code-workspacefile, there should be a button in the bottom right corner offering to open that workspace in VS Code.
I did open it that way, yeah. I found that if I opened the server-api directly and copied the ruby settings in the workspace file to server-api/.vscode/settings.json that the whole project works MUCH better. But it's a monorepo....so I need all the other folders too, so that defeats the purpose of having the workspace :/
Being able to jump into source code does NOT work from the workspace, but it does with the individual folder