-
Notifications
You must be signed in to change notification settings - Fork 30
bugfix/default post content type and primitive types #167
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
bugfix/default post content type and primitive types #167
Conversation
…ould be wrongfully defaulted
| return null; | ||
| } else if(json.isJsonPrimitive()) { | ||
| return getPrimitiveValue(json, type); | ||
| } else if(json.isJsonObject()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: indent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those damn tabs keep creeping on me. Thanks for noticing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub makes it easy to show these because of weird tab width choice, whether it is a good or a bad thing.
I am really curious to know as to why VSCode is not applying .editorconfig on save for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'd be interesting to see if using VS code on this repo (just check-out this branch to the commit before I fixed that mixed indent style), hitting ctrl + S on the file, it fixes it automatically for you. I had to do an explicit ctrl + h.
Here is the extension I'm using https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me give it a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out space conversion is not available on save: https://github.com/editorconfig/editorconfig-vscode#supported-properties.
If all your projects are using spaces, you may want to configure editor.insertSpaces in vscode settings. editor.renderWhitespace also helps in visualizing space types, so that you can tell when you need to hit that extra ctrl+h.
There is also this extension, but it ignores the space configuration in .editorconfig. It always applies 4 spaces: https://marketplace.visualstudio.com/items?itemName=redlin.remove-tabs-on-save
Visual Studio applies the .editorconfig spacing rules on save for C# files, so my expectation was similar with VSCode.
IntellijIDEA doesn't apply tab->space on save though it inserts new line at the end. But if you format the code, it does the conversion and respects the .editorconfig rules (tested with 8 spaces).
Maybe a little friction on Java development in VSCode to "share" in that BarcelonaJUG conference ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative to Ctrl+H for tabs to spaces is: Command Palette (F1 or Ctrl+Shift+P) -> Convert Indentation to Spaces, which respects .editorconfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into it! This is probably another case of Vincent getting confused by the tools. I do have auto final line insertion on save in TypeScript and yaml but this is probably because of other extensions. I do also have white space trim on save for all languages I believe?
I'll try to make the ctrl shift p alternative a habit and maybe if I get tired of doing that I'll go pr the editor config extension.
reflection of microsoftgraph/msgraph-sdk-java#693