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

Sync Folder seems to not respected settings.json #214

Open
ChrisChoke opened this issue Apr 8, 2024 · 4 comments
Open

Sync Folder seems to not respected settings.json #214

ChrisChoke opened this issue Apr 8, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@ChrisChoke
Copy link

Please provide a clear and concise description of the bug along with logs
my vscode project directory:

.
├── ESP32_GENERIC_C3-20240105-v1.22.1.bin
├── .micropico
├── README.md
├── src
│   ├── boot.py
│   ├── lib
│   │   ├── bme280_int.py
│   │   ├── microdot
│   │   │   ├── __init__.py
│   │   │   ├── microdot.py
│   │   │   └── utemplate.py
│   │   ├── mqtt_as.py
│   │   └── utemplate
│   │       ├── compiled.py
│   │       ├── recompile.py
│   │       └── source.py
│   ├── main.py
│   └── templates
│       └── index.tpl
├── test.py
├── update_libs.sh
└── .vscode
    ├── extensions.json
    ├── Pico-W-Stub -> /home/chris/.config/Code/User/MicroPico-Stubs/micropython-esp32-stubs==1.22.0.post1
    └── settings.json

settings.json:

{
    "python.linting.enabled": true,
    "python.languageServer": "Pylance",
    "python.analysis.typeCheckingMode": "basic",
    "python.analysis.diagnosticSeverityOverrides": {
        "reportMissingModuleSource": "none"
    },
    "micropico.syncFolder": "src",
    "micropico.openOnStart": true,
    "python.analysis.typeshedPaths": [
        ".vscode/Pico-W-Stub"
    ],
    "python.analysis.extraPaths": [
        ".vscode/Pico-W-Stub"
    ],
    "micropico.syncFileTypes": [
        "py",
        "txt",
        "log",
        "json",
        "xml",
        "html",
        "js",
        "css",
        "mpy",
        "tpl"
    ]
}

What are the steps to reproduce this issue?

  1. set syncFolder to "src"
  2. upload project via ctrl+p command
  3. toggle pico filesystem to verify the upload

What happens?

all .py files on all relative pathes are uploaded to the board.

What were you expecting to happen?

i excpect that the syncFolder perform a cd srcand upload all files within this folder and apply all rules at this stage.
i mean that synFileTypes applied at this folder and subfolder within it.
i excpect that the syncFolder will be at root on filesystem on my board. like if i do cp src/* / on linux.

Any logs, error output, etc?

(To get extension logs see Terminal > Output > Extension Host and copy output concerning pico-w-go or micropico)
(If it’s long, please paste to https://gist.github.com and insert the link here)

Any other comments?

Which version of MicroPico are you using?

3.7.5

Support info

Copy this from the Help -> Info/About -> Copy (Code -> About Visual Studio Code -> Copy on macOS) option in Visual Studio Code:

<paste here>
@ChrisChoke ChrisChoke added the bug Something isn't working label Apr 8, 2024
@ChrisChoke
Copy link
Author

i made a test and change the "default" part of the syncFolder configuration in my /home/chris/.vscode/extensions/paulober.pico-w-go-3.7.5-linux-x64/package.json

if i do the setting there it work as excpected. it seems that the settings.json in the .vscode folder in my project folder do not respected. the defaults from package.json do override project setting or it just not loaded. i dont know. same with #213

Chris

@webdeb
Copy link

webdeb commented Apr 8, 2024

Don't know if this is related, but sync config does not work in multi-folder workspaces. Should I create a new issue?

@ChrisChoke
Copy link
Author

yes that is exactly what happen.
if i toggle the "Toggle Pico-W-FS" button, the workspace change to a multi-folder-workspace. and all the settings in .vscode/settings.json dont work anymore. in that case we need a ..code-workspace file with all the config.

i think the workspace should change back to single workspace after toggling the pico-filsystem button again.

Chris

@SmallhillCZ
Copy link

This is more of how VSCode extension settings work. IMO this setting should be instead in the .micropico file.

However since we have it in the extension setting for now, what you can do is save the VSCode workspace and set the extension settings there:

./myproject.code-workspace

{
	"folders": [
		{
			"path": "."
		},
		{
			"name": "Pico (W) Remote Workspace",
			"uri": "pico:"
		}
	],
	"settings": {
		"python.linting.enabled": true,
		"python.languageServer": "Pylance",
		"python.analysis.typeCheckingMode": "basic",
		"python.analysis.typeshedPaths": [
			".vscode\\Pico-W-Stub",
			"~\\.micropico-stubs\\included"
		],
		"python.analysis.extraPaths": [
			".vscode\\Pico-W-Stub\\stubs",
			"~\\.micropico-stubs\\included"
		],
		"[python]": {
			"editor.defaultFormatter": "ms-python.black-formatter"
		},
		"python.analysis.diagnosticSeverityOverrides": {
			"reportMissingModuleSource": "none"
		},
		"micropico.syncFolder": "src",
		"micropico.openOnStart": true,
		"micropico.softResetAfterUpload": true
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants