Comments (3)
hey @vicero, this sounds like a good idea -- would love a PR. Here are some notes which may help:
- Here's where we write comments above the
interface x
line: https://github.com/Wulf/tsync/blob/main/src/main.rs#L221-L226 - Here's where we write comments above the individual fields lines: https://github.com/Wulf/tsync/blob/main/src/main.rs#L233-L238
- feel free to refactor :-)
Your example inspired these two suggestions:
- if there is only 1 comment for a field / interface, we should use a one-liner
/** ..comment.. */
- if there is more than 1 comment for a field / interface, we should use a multi-line jsdoc:
/** * comment 1 * comment 2 * ...comment N */
And regarding spaces / tabs for comments:
- we don't use modules or namespaces for the output, so you can always assume no indentation for interface lines, and 2-space indentation for field lines. Feel free to change the way we do spacing -- the suggestion for using 2-spaces for field line comments comes from here.
Oh and about testing, here's a note from the README:
Use ./test/test_all.sh
to run tests. After running the test, there should be no unexpected changes to files in ./test
(use git status
and git diff
to see if there were any changes).
from tsync.
@vicero thanks for the PR, just published 1.3.0 which should have your changes!
from tsync.
@vicero thanks for the PR, just published 1.3.0 which should have your changes!
@Wulf Thank you so much!
from tsync.
Related Issues (13)
- Const JSON does not compile HOT 4
- error[E0603]: enum `TokenTree` is private HOT 3
- Enums with custom types HOT 3
- Feature request - `undefined` fields using the "optional parameter" `?` syntax HOT 1
- Custom type mapping HOT 1
- [feature request] Honour `#[serde(rename = "...")]` in the generated TypeScript types HOT 2
- [feature request] Tuples HOT 3
- [bug] Numeric enum is not converted correctly on v2.0.0. HOT 1
- Feature request: support tuple structs HOT 4
- [feature request] Support serde flatten HOT 3
- Feature Request: Supporting `const` scalars such as numbers and strings + enums (?) HOT 5
- tsync from other proc-macros? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tsync.