Refact constants into separate type
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- tooling
Research direction
Start by locating the definition that currently types defaultValue and inspect how default values are represented. Introduce the proposed Constant shape there, update defaultValue to accept Constant or string, and run the repository's existing checks to confirm the definition remains valid.
Written by the indexing model from the issue text.
Description
I think this could be folded into defaultValue as a new Constant type (might be useful elsewhere).
/** Constant defines a Rust const declaration */
export interface Constant {
kind: 'constant';
/** the name of the const */
name: string;
/** the value of the const */
value: Literal;
/** indicates the visibility of the const */
visibility: Visibility;
}
Then we can update the definition accordingly.
defaultValue?: Constant | string;
Originally posted by @jhendrixMSFT in https://github.com/Azure/typespec-rust/pull/887#discussion_r2884751124
- Dominant language
- Rust
- Stars
- 7
- Forks
- 11
- Avg merge
- 14h 15m
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/typespec-rust
-
CodeGen rust
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Azure/typespec-rust#959 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
Azure/typespec-rust#1032 ·
-
CodeGen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Azure/typespec-rust#1029 ·
-
CodeGen
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Azure/typespec-rust#1028 ·
-
CodeGen
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Azure/typespec-rust#1020 ·
All issues in Azure/typespec-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100