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

Relative paths in tomlValidation url #322

Open
gnikit opened this issue Sep 21, 2022 · 6 comments
Open

Relative paths in tomlValidation url #322

gnikit opened this issue Sep 21, 2022 · 6 comments

Comments

@gnikit
Copy link

gnikit commented Sep 21, 2022

The string that is being passed in url in tomlValidation needs to be a URI . Hence, using it with a relative path e.g. "url": "./schema.json" similar to how json and yaml validations can be passed will not work. Using a URL, as shown in the docs however will.

@tamasfe
Copy link
Owner

tamasfe commented Oct 7, 2022

Do you have a reference for JSON and/or YAML validation settings with relative paths? If so, we could copy their behaviour, otherwise I'm not sure what the relative paths should be based on.

@gnikit
Copy link
Author

gnikit commented Oct 9, 2022

I am relatively certain that the relative paths are with respect to the extension install root i.e. where package.json resides see the Search for usecases https://github.com/search?q=filename%3Apackage.json+yamlValidation+in%3Afile&type=Code.

I think this is the piece of code you are looking for
https://github.com/redhat-developer/vscode-yaml/blob/7f4be301df8ff9d74016b113df296be420fbfab9/src/extension.ts#L229-L264

FYI we are already making use of tomlValidation see https://github.com/fortran-lang/vscode-fortran-support/blob/1f2fe6d8465a80109501ee22eabbcf4347eb7d7d/package.json#L121-L126 and it works great cheers!

@tamasfe
Copy link
Owner

tamasfe commented Oct 11, 2022

Ah I see, makes perfect sense, thanks! It should be trivial to implement based on the referenced YAML extension code.

FYI we are already making use of tomlValidation see https://github.com/fortran-lang/vscode-fortran-support/blob/1f2fe6d8465a80109501ee22eabbcf4347eb7d7d/package.json#L121-L126 and it works great cheers!

I'm glad, thanks!

@FredLL-Avaiga
Copy link

This enhancement would be very useful for us too (using extension.extensionUri when schema path is relative to ./)

FredLL-Avaiga pushed a commit to Avaiga/taipy-studio that referenced this issue Nov 28, 2022
@FredLL-Avaiga
Copy link

@tamasfe Do you take PR ?
I guess this is quite simple and I'm willing to submit a PR :-)

sureshjoshi added a commit to RobotPajamas/suspenders that referenced this issue Apr 7, 2023
@SpontanCombust
Copy link

Any progress on this?

sureshjoshi added a commit to RobotPajamas/suspenders that referenced this issue Jun 26, 2024
sureshjoshi added a commit to RobotPajamas/suspenders that referenced this issue Jun 26, 2024
)

- Pointing toml validation to the pants directory
- Created a JSON-schema on the fly
- Working around tamasfe/taplo#322
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants