RustPython / RustPython/Parser
Add option to use utf-16 positions instead of utf-8
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Rust
- Sterne
- 117
- Forks
- 38
- Ø Merge
- 4 T. 7 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
We use this parser for a custom linter that we ship through a VSCode extension (rustpython_parser::ast::Suite::parse_without_path). The VSCode extension api expects byte positions to the text encoded in utf-16, but the parser returns the byte positions to text encoded in utf-8. Can we add an option to use utf-16 encoded byte positions?
I'd be happy to implement this feature if you're comfortable with adding it to the parser. Do you have suggestions on how the API should look like?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne bei rustpython_parser::ast::Suite::parse_without_path und verfolge, wie Quellpositionen erzeugt und bereitgestellt werden. Überprüfe die bestehende Parser-API und die positionsbezogenen Tests und bestimme anschließend eine API-Struktur zur Auswahl von UTF-16-Positionen. Erledigt ist die Aufgabe, wenn die Option implementiert ist und ihr Positionsverhalten durch Tests abgedeckt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust
- Bereich
- compilers
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100