noir-lang / vscode-noir

Apache License 2.0
6 stars 7 forks source link

feat: Added format configuration defaults for noir #55

Closed Thunkar closed 8 months ago

Thunkar commented 9 months ago

Description

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

Problem*

Resolves https://github.com/noir-lang/vscode-noir/issues/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*

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

kevaundray commented 9 months ago

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

socket-security[bot] commented 9 months ago

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

TomAFrench commented 9 months ago

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