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

Errors on fields with URI format not reported in Settings UI #88703

Closed
fbricon opened this issue Jan 15, 2020 · 5 comments · Fixed by #110255
Closed

Errors on fields with URI format not reported in Settings UI #88703

fbricon opened this issue Jan 15, 2020 · 5 comments · Fixed by #110255
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders settings-editor VS Code settings editor issues verified Verification succeeded
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Jan 15, 2020

Found this issue while trying to set java.format.settings.url's format to uri (or uri-reference), in order to fix redhat-developer/vscode-java#1237

  • VSCode Version: 1.42.0-insider (7e64866)
  • OS Version: Mac OS 10.14.6

Steps to Reproduce:

  1. Have a "mysetting" setting define "format":"uri" (as documented in https://code.visualstudio.com/api/references/contribution-points#contributes.configuration)
  2. Open settings in UI, write then delete some value, no error is shown
  3. Open settings.json, see that "mysetting":"" has a warning: String is not a URI: URI expected.

Screen Shot 2020-01-15 at 7 44 33 PM

The validation error should be displayed in the UI too (as it does when using a validation pattern)

Does this issue occur when all extensions are disabled?: Maybe

@jrieken jrieken assigned aeschli and unassigned jrieken Jan 16, 2020
@aeschli aeschli assigned roblourens and unassigned aeschli Jan 16, 2020
@roblourens
Copy link
Member

I guess we are missing that validation, also, the type of that setting should be ["string", "null"] if the default is "null".

          "type": "string",
          "description": "Specifies the url or file path to the [Eclipse formatter xml settings](https://github.com/redhat-developer/vscode-java/wiki/Formatter-settings).",
          "default": null,

@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug settings-editor VS Code settings editor issues labels Jan 16, 2020
@roblourens roblourens added this to the January 2020 milestone Jan 16, 2020
@roblourens roblourens modified the milestones: February 2020, March 2020 Feb 26, 2020
@roblourens roblourens modified the milestones: March 2020, April 2020 Mar 31, 2020
@roblourens roblourens modified the milestones: April 2020, May 2020 Apr 28, 2020
@roblourens roblourens modified the milestones: May 2020, Backlog May 31, 2020
@rzhao271 rzhao271 self-assigned this Nov 6, 2020
@rzhao271
Copy link
Contributor

rzhao271 commented Nov 6, 2020

@roblourens I can try working on this. Any code pointers, though? Not sure where to look.

@roblourens
Copy link
Member

See https://github.com/Microsoft/vscode/blob/2445428308d74f1eedf73715809dca2d37e21c6d/src/vs/workbench/services/preferences/common/preferencesValidation.ts#L94-L94 for where these validations for the settings editor live. You need to figure out what validation the json language server does for "format": "uri". I assume that lives somewhere in https://github.com/microsoft/vscode-json-languageservice but I don't know where. I can help you if you can't find it.

rzhao271 added a commit that referenced this issue Nov 9, 2020
@rzhao271 rzhao271 mentioned this issue Nov 9, 2020
@rzhao271 rzhao271 modified the milestones: Backlog, November 2020 Nov 10, 2020
@rzhao271
Copy link
Contributor

Verifier:

  1. Clone https://github.com/rzhao271/uri-format-setest
  2. Run the extension and search uriformat in the settings editor
  3. Try different values in the textbox that shows up. The empty string should not be accepted, and a string such as example.com should not be accepted. However, http:, http://, and http://example.com should be accepted.

@rzhao271 rzhao271 changed the title Setting format error not reported in Settings UI Errors on Fields with URI format not reported in Settings UI Dec 1, 2020
@rzhao271 rzhao271 changed the title Errors on Fields with URI format not reported in Settings UI Errors on fields with URI format not reported in Settings UI Dec 1, 2020
@rzhao271 rzhao271 added the author-verification-requested Issues potentially verifiable by issue author label Dec 2, 2020
@github-actions
Copy link

github-actions bot commented Dec 2, 2020

This bug has been fixed in to the latest release of VS Code Insiders!

@fbricon, you can help us out by confirming things are working as expected in the latest Insiders release. If things look good, please leave a comment with the text /verified to let us know. If not, please ensure you're on version bf21395 of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

@meganrogge meganrogge added the verified Verification succeeded label Dec 3, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders settings-editor VS Code settings editor issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants
@fbricon @roblourens @jrieken @aeschli @rzhao271 @meganrogge and others