Skip to content

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
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