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

fix: remove intrusive version checking #859

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

rgrinberg
Copy link
Contributor

Only notify users when all of the following conditions hold:

  • The running version of ocamllsp is "official". We don't offer
    suggestions for development versions.

  • We know something about the user's version ocamllsp. If the version
    isn't recognized by us, we do not second guess the user.

  • We are certain the user is able to upgrade to a newer version. If the
    user is forced to an older version of lsp, we allow him to use the
    plugin without notifications.

@rgrinberg rgrinberg force-pushed the ps/rr/fix__remove_intrusive_version_checking branch from f30d3e3 to 7894d1e Compare February 13, 2022 17:59
Copy link
Collaborator

@ulugbekna ulugbekna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for some nitpicks

Comment on lines +67 to +78
[ ( (4, 12)
, [| "1.5.0"
; "1.6.0"
; "1.6.1"
; "1.7.0"
; "1.8.0"
; "1.8.1"
; "1.8.2"
; "1.8.3"
; "1.9.0"
|] )
; ((4, 13), [| "1.9.1"; "1.10.0"; "1.10.1" |])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this could use comments or names, eg ocaml_4_12 = (4, 12)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, ocamlc version library should have values corresponding to ocamlc versions, ie we could use Ocaml_version.v4_12 instead of (4, 12)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ie we could use Ocaml_version.v4_12 instead of (4, 12)

This could work, but is it really clarifying anything? We are mapping version OCaml versions prefixes to ocamllsp versions.

I'll add some comments

src/ocaml_lsp.ml Outdated Show resolved Hide resolved
src/ocaml_lsp.ml Outdated
"The extension was unable to parse `ocamllsp` version. That's \
strange. Consider filing an issue on the project GitHub with the \
version of your `ocamllsp`."
"The current version of ocamllsp is out of date. Consider \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"The current version of ocamllsp is out of date. Consider \
"There is a newer version of `ocamllsp` available. Consider \

"out of date" means it may not be supported already?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm that we can use markdown in the messages? I believe you said it was plaintext only earlier.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s not formatted as markdown, but marking the binary name in the message

  1. Conforms to other uses in the extension
  2. Makes the message easier to read imho

@rgrinberg rgrinberg force-pushed the ps/rr/fix__remove_intrusive_version_checking branch from 7894d1e to 4e3788f Compare February 14, 2022 17:58
Only notify users when all of the following conditions hold:

* The running version of ocamllsp is "official". We don't offer
  suggestions for development versions.

* We know something about the user's version ocamllsp. If the version
  isn't recognized by us, we do not second guess the user.

* We are certain the user is able to upgrade to a newer version. If the
  user is forced to an older version of lsp, we allow him to use the
  plugin without notifications.

ps-id: FC109E94-B57C-4226-9AAE-512F45524A91
@rgrinberg rgrinberg force-pushed the ps/rr/fix__remove_intrusive_version_checking branch from 4e3788f to bcaf28a Compare February 14, 2022 18:01
@rgrinberg rgrinberg merged commit bcaf28a into master Feb 14, 2022
@rgrinberg rgrinberg deleted the ps/rr/fix__remove_intrusive_version_checking branch February 14, 2022 18:01
@rgrinberg
Copy link
Contributor Author

rgrinberg commented Feb 14, 2022 via email

@ulugbekna
Copy link
Collaborator

ulugbekna commented Feb 14, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants