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

feat: Added format configuration defaults for noir #55

Merged
merged 4 commits into from
Dec 13, 2023

Conversation

Thunkar
Copy link
Contributor

@Thunkar Thunkar commented Dec 11, 2023

Description

Added configuration defaults for noir code formatting using vscode-noir.

Problem*

Resolves #54

VSCode extension was not formatting .nr files by default even thought the LSP supported the feature and advertises itself as documentFormattingProvider: true. This could be manually fixed with settings:

      "[noir]": {
        "editor.defaultFormatter": "noir-lang.vscode-noir",
        "editor.formatOnSave":  true
      }

Summary*

Simple package.json changes according to the extension contributions documentation. It must be noted that it is now not recommended to include the formatting capabilities of an extension as a setting for the extension itself, as it can cause a bunch of problems if multiple ones do the same.

As such, this change uses the recommended method of providing formatting capabilities for noir (and only for noir!) as a language-specific override of the editor's default setting.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

BEGIN_COMMIT_OVERRIDE
feat: Added format configuration defaults for noir (#55)
END_COMMIT_OVERRIDE

@Thunkar Thunkar self-assigned this Dec 11, 2023
@kevaundray kevaundray changed the title Added format configuration defaults for noir chore: Added format configuration defaults for noir Dec 11, 2023
@kevaundray
Copy link
Contributor

Can you resolve the merge conflicts with the package-lock.json?

Copy link

socket-security bot commented Dec 11, 2023

No top level dependency changes detected. Learn more about Socket for GitHub ↗︎

* master:
  chore: add linter setup (#57)
  chore: run prettier (#56)
@TomAFrench
Copy link
Member

Does it not format by default already? My vscode autoformats noir source code.

Copy link
Contributor

@kobyhallx kobyhallx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm, ty! 💯

@kobyhallx kobyhallx merged commit 5152918 into master Dec 13, 2023
4 checks passed
@kobyhallx kobyhallx deleted the gj/format-on-save-default branch December 13, 2023 10:53
@Savio-Sou Savio-Sou changed the title chore: Added format configuration defaults for noir feat: Added format configuration defaults for noir Dec 13, 2023
@github-actions github-actions bot mentioned this pull request Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add formatting on save
5 participants