Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rust] Consider using url::Url for DocumentUri and URI types #361

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

39555
Copy link
Contributor

@39555 39555 commented Jun 24, 2024

Hi! Currently all URI types are represented as String, which is very uncomfortable to work with. This pr

  • adds the serde feature to url crate in Cargo.toml
  • adds use url::Url;
  • changes the rust generator to generate Url instead of String for DocumentUri and URI types

This is similar to what lsp-types crate does.

Are there any disadvantages to doing so?

@39555
Copy link
Contributor Author

39555 commented Jun 24, 2024

@microsoft-github-policy-service agree

@39555
Copy link
Contributor Author

39555 commented Jun 24, 2024

Oh, I found some relevant discussions against Url.
gluon-lang/lsp-types#284
gluon-lang/lsp-types#261
gluon-lang/lsp-types#282

So String may actually be good

@karthiknadig
Copy link
Member

@39555 Thanks for the suggestion and PR.

@karthiknadig karthiknadig self-requested a review June 24, 2024 16:01
@karthiknadig karthiknadig self-assigned this Jun 24, 2024
@karthiknadig karthiknadig added feature-request Request for new features or functionality labels Jun 24, 2024
@karthiknadig karthiknadig enabled auto-merge (squash) June 24, 2024 16:03
@karthiknadig karthiknadig merged commit 3a2e325 into microsoft:main Jun 24, 2024
30 checks passed
karthiknadig pushed a commit to karthiknadig/lsprotocol that referenced this pull request Aug 7, 2024
…icrosoft#361)

Hi! Currently all URI types are represented as `String`, which is very
uncomfortable to work with. This pr
- adds the `serde` feature to `url` crate in Cargo.toml
- adds `use url::Url;`
- changes the rust generator to generate `Url` instead of `String` for
`DocumentUri` and `URI` types

This is similar to what [lsp-types](https://crates.io/crates/lsp-types)
crate does.

Are there any disadvantages to doing so?
karthiknadig pushed a commit that referenced this pull request Aug 12, 2024
)

Hi! Currently all URI types are represented as `String`, which is very
uncomfortable to work with. This pr
- adds the `serde` feature to `url` crate in Cargo.toml
- adds `use url::Url;`
- changes the rust generator to generate `Url` instead of `String` for
`DocumentUri` and `URI` types

This is similar to what [lsp-types](https://crates.io/crates/lsp-types)
crate does.

Are there any disadvantages to doing so?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants