Title: Implement on-type block formatting · Issue #165 · microsoft/python-language-server · GitHub
Open Graph Title: Implement on-type block formatting · Issue #165 · microsoft/python-language-server
X Title: Implement on-type block formatting · Issue #165 · microsoft/python-language-server
Description: The VS Code extension provides an on-type formatter that triggers on : which allows for block formatting. For example, you can hit colon after the else in the following code: if x: pass else Which will then be reformatted into: if x: pas...
Open Graph Description: The VS Code extension provides an on-type formatter that triggers on : which allows for block formatting. For example, you can hit colon after the else in the following code: if x: pass else Which ...
X Description: The VS Code extension provides an on-type formatter that triggers on : which allows for block formatting. For example, you can hit colon after the else in the following code: if x: pass else Which ...
Opengraph URL: https://github.com/microsoft/python-language-server/issues/165
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Implement on-type block formatting","articleBody":"The VS Code extension provides an on-type formatter that triggers on `:` which allows for block formatting. For example, you can hit colon after the `else` in the following code:\r\n\r\n```python\r\nif x:\r\n pass\r\n else\r\n```\r\n\r\nWhich will then be reformatted into:\r\n\r\n```python\r\nif x:\r\n pass\r\nelse:\r\n```\r\n\r\nThis functionality should be implemented in language server for feature parity. The language server may even be able to handle more cases correctly than the extension's use of regex, since we have access to an AST.\r\n\r\nSince on-type formatting has only one entrypoint (`DocumentOnTypeFormatting`), that function would need to map trigger characters to the right handler. A nicety would be to have a Dictionary of handlers, then produce the `DocumentOnTypeFormattingOptions`'s trigger character members from that dictionary rather than needing to remember to change the characters in two different files.\r\n\r\nRelated to Microsoft/vscode-python#2714.","author":{"url":"https://github.com/jakebailey","@type":"Person","name":"jakebailey"},"datePublished":"2018-09-27T22:17:56Z","url":"https://github.com/microsoft/python-language-server/issues/165"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:104e3b11-767d-fcaf-dd03-13d799ebf647 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DAA8:2826BD:65D085:8530C2:6AFE6CD2 |
| html-safe-nonce | 2770fa25ff3e4c7915a886fdb6cf99e5a3b6b3873e4993c59b9abfe8183a341a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQUE4OjI4MjZCRDo2NUQwODU6ODUzMEMyOjZBRkU2Q0QyIiwidmlzaXRvcl9pZCI6IjE0NDMzMTI3NzA3OTQ1NDg0MzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2b5e588799098e44f89d8a32e1c132b6f1352b1d37933fb122b8ee48b9e9cfc1 |
| hovercard-subject-tag | issue:364674036 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/python-language-server/165/issue_layout |
| twitter:image | https://opengraph.githubassets.com/060a3ffb5ebc828f2ba1924aa010f34e31bb932bd8f26ed21de85d0232c941e7/microsoft/python-language-server/issues/165 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/060a3ffb5ebc828f2ba1924aa010f34e31bb932bd8f26ed21de85d0232c941e7/microsoft/python-language-server/issues/165 |
| og:image:alt | The VS Code extension provides an on-type formatter that triggers on : which allows for block formatting. For example, you can hit colon after the else in the following code: if x: pass else Which ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jakebailey |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/python-language-server git https://github.com/microsoft/python-language-server.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 145901977 |
| octolytics-dimension-repository_nwo | microsoft/python-language-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145901977 |
| octolytics-dimension-repository_network_root_nwo | microsoft/python-language-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width