ruff/crates/ruff_server/src
Dhruv Manilawala ff53db3d99
Consider VS Code cell metadata to determine valid code cells (#12864)
## Summary

This PR adds support for VS Code specific cell metadata to consider when
collecting valid code cells.

For context, Ruff only runs on valid code cells. These are the code
cells that doesn't contain cell magics. Previously, Ruff only used the
notebook's metadata to determine whether it's a Python notebook. But, in
VS Code, a notebook's preferred language might be Python but it could
still contain code cells for other languages. This can be determined
with the `metadata.vscode.languageId` field.

### References:
* https://code.visualstudio.com/docs/languages/identifiers
* e6c009a3d4/extensions/ipynb/src/serializers.ts (L104-L107)
*
e6c009a3d4/extensions/ipynb/src/serializers.ts (L117-L122)

This brings us one step closer to fixing #12281.

## Test Plan

Add test cases for `is_valid_python_code_cell` and an integration test
case which showcase running it end to end. The test notebook contains a
JavaScript code cell and a Python code cell.
2024-08-13 22:09:56 +05:30
..
edit Consider VS Code cell metadata to determine valid code cells (#12864) 2024-08-13 22:09:56 +05:30
server Do not bail code action resolution when a quick fix is requested (#12462) 2024-07-23 10:30:03 +05:30
session Collect errors while building up the settings index (#12781) 2024-08-12 15:42:45 +00:00
edit.rs Add Jupyter Notebook document change snapshot test (#11944) 2024-06-21 05:29:27 +00:00
fix.rs Conside include, extend-include for the native server (#12252) 2024-07-10 04:12:57 +00:00
format.rs ruff server: Formatting a document with syntax problems no longer spams a visible error popup (#11745) 2024-06-04 17:18:21 -07:00
lib.rs Conside include, extend-include for the native server (#12252) 2024-07-10 04:12:57 +00:00
lint.rs Conside include, extend-include for the native server (#12252) 2024-07-10 04:12:57 +00:00
message.rs Ignore non-file workspace URL (#12725) 2024-08-07 09:15:55 +00:00
resolve.rs Conside include, extend-include for the native server (#12252) 2024-07-10 04:12:57 +00:00
server.rs Make server panic hook more error resilient (#12610) 2024-08-02 12:10:06 +02:00
session.rs Add Jupyter Notebook document change snapshot test (#11944) 2024-06-21 05:29:27 +00:00
trace.rs Use $/logTrace for server trace logs in Zed and VS Code (#12564) 2024-07-30 08:32:20 +05:30