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

${workspaceFolder} doesn't work in settings.json #332

Open
sbreakey opened this issue Mar 25, 2022 · 4 comments
Open

${workspaceFolder} doesn't work in settings.json #332

sbreakey opened this issue Mar 25, 2022 · 4 comments
Labels

Comments

@sbreakey
Copy link

sbreakey commented Mar 25, 2022

Hi. Thanks for a great extension.

java.checkstyle.configuration doesn't seem to work when specified in .vscode/settings.json
It only works when specified globally (User settings) or in the workspace settings file.

@marcosb1
Copy link

marcosb1 commented Apr 18, 2022

I'm having a similar problem, except I have to specify the java.checkstyle.configuration in my workspace settings rather than my folder settings, otherwise I get:

Checkstyle configuration file not set yet, skip the check.

EDIT: in other words it completely ignores folder .vscode/settings.json if the folder is in a workspace (in my case)

@jdneo jdneo added the bug label Apr 19, 2022
@josephzidell
Copy link

Having the same issue

@NathanielRN
Copy link

NathanielRN commented Jun 27, 2023

+1 to this and thank you for posting this issue!

I believe this is because my project is using the VSCode *.code-workspace file to decide where the folders of my project is. This is because I have multiple roots in my VSCode project.

i.e. if you have something like this it's fine:

├── test1
│   └── Test1.java
└── test2
    └── Test2.java

But the moment you add a Workspace file as simple as My Workspace.code-workspace like this:

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {}
}

Both test1.java and test2.java won't have Checkstyle checking until you add it to the Workspace > settings.json.

As a workaround I was able to do this:

{
    "folders": [
        {
            "name": "Test 1",
            "path": "test1"
        },
        {
            "name": "Test 2",
            "path": "test2"
        }
    ],
    "settings": {
        "java.checkstyle.configuration": "${workspaceFolder}/test1/custom-checkstyle.xml",
        "java.checkstyle.version": "10.12.1"
    }
}

and it works.

@jdneo Thank you for the amazing extension!

@CerebralTag
Copy link

To anyone else who ends up here, I also had to add to my settings.json a reference to my custom file:
"java.checkstyle.properties" : {
"config_loc" : "${workspaceFolder}/checkstyle.xml"
}

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

No branches or pull requests

6 participants