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

Make some private variables/functions public #354

Open
nemethf opened this issue Nov 22, 2019 · 2 comments
Open

Make some private variables/functions public #354

nemethf opened this issue Nov 22, 2019 · 2 comments

Comments

@nemethf
Copy link
Collaborator

nemethf commented Nov 22, 2019

#353 (comment)

But in the meantime, we might start to think about changing some accessors of eglot-lsp-server to public or create new ones. I think project-nickname and (or (plist-get serverInfo :name) (jsonrpc-name server)) are good first candidates.

OK. Add elgot--managed-mode-hook to the list.

nemethf added a commit that referenced this issue Nov 22, 2019
... by renaming eglot--managed-mode to eglot-managed-mode.
Note, eglot--managed-mode-off remained private.

Per #354

* eglot.el (eglot-managed-mode): New minor mode.
(eglot--managed-mode, eglot--managed-mode-hook): Obsolete vars in
favour of their public versions.
(eglot-ensure, eglot--maybe-activate-editing-mode)
(eglot--after-change, mode-line-misc-info, advice on
jsonrpc-request): Update following the renames.
(eglot-shutdown, eglot--on-shutdown,
(eglot--managed-mode-off): Update comments.
nemethf added a commit that referenced this issue Nov 22, 2019
... by renaming eglot--managed-mode to eglot-managed-mode.
Note, eglot--managed-mode-off remained private.

Per #354

* eglot.el (eglot-managed-mode): New minor mode.
(eglot--managed-mode, eglot--managed-mode-hook): Obsolete vars,
function in favour of their public versions.
(eglot-ensure, eglot--maybe-activate-editing-mode)
(eglot--after-change, mode-line-misc-info, advice on
jsonrpc-request): Update following the renames.
(eglot-shutdown, eglot--on-shutdown,
(eglot--managed-mode-off): Update comments.
nemethf added a commit that referenced this issue Nov 22, 2019
Per #354

* eglot.el (eglot-lsp-server): Add a public reader for
project-nickname as eglot-project-nickname.
(eglot--connect, eglot--read-server, eglot--mode-line-format): Use
the public variant.
nemethf added a commit that referenced this issue Nov 22, 2019
Fix #354

* eglot.el (eglot-server-name): New cl-defmethod for the base
class, eglot-rls, and eglot-eclipse-jdt.
(eglot--connect): Use it.
nemethf added a commit that referenced this issue Nov 22, 2019
... by renaming eglot--managed-mode to eglot-managed-mode.
Note, eglot--managed-mode-off remained private.

Per #354

* eglot.el (eglot-managed-mode): New minor mode.
(eglot--managed-mode, eglot--managed-mode-hook): Obsolete vars,
function in favour of their public versions.
(eglot-ensure, eglot--maybe-activate-editing-mode)
(eglot--after-change, mode-line-misc-info, advice on
jsonrpc-request): Update following the renames.
(eglot-shutdown, eglot--on-shutdown,
(eglot--managed-mode-off): Update comments.
nemethf added a commit that referenced this issue Nov 22, 2019
Per #354

* eglot.el (eglot-lsp-server): Add a public reader for
project-nickname as eglot-project-nickname.
(eglot--connect, eglot--read-server, eglot--mode-line-format): Use
the public variant.
nemethf added a commit that referenced this issue Nov 22, 2019
Fix #354

* eglot.el (eglot-server-name): New cl-defmethod for the base
class, eglot-rls, and eglot-eclipse-jdt.
(eglot--connect): Use it.
nemethf added a commit that referenced this issue Jan 4, 2020
The old, private hook remains intact, but its useage is discouraged by
an obsolate-variable-alias.

Per #354

* eglot.el (eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode-hook): Add an obsolete warning.
(eglot--managed-mode): Run the hook.
nemethf added a commit that referenced this issue Jan 4, 2020
Per #354

* eglot.el (eglot-lsp-server): Add a public reader for
project-nickname as eglot-project-nickname.
(eglot--connect, eglot--read-server, eglot--mode-line-format): Use
the public variant.
nemethf added a commit that referenced this issue Jan 4, 2020
The old, private hook remains intact.  Per #354

* eglot.el (eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode): Run the hook.
nemethf added a commit that referenced this issue Jan 4, 2020
Per #354

* eglot.el (eglot-lsp-server): Add a public reader for
project-nickname as eglot-project-nickname.
(eglot--connect, eglot--read-server, eglot--mode-line-format): Use
the public variant.
nemethf added a commit that referenced this issue Jan 4, 2020
The old, private hook remains intact.  Per #354

* eglot.el (eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode): Run the hook.
nemethf added a commit that referenced this issue Jan 4, 2020
Per #354

* eglot.el (eglot-lsp-server): Add a public reader for
project-nickname as eglot-project-nickname.
(eglot--connect, eglot--read-server, eglot--mode-line-format): Use
the public variant.
nemethf added a commit that referenced this issue Jan 13, 2020
Per #354, fix #182.

* eglot.el (eglot-managed-p): New function.
(eglot--managed-mode-hook): Obsolete it.
(eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode): Run the new hook.

* README.md (Customization): Mention the new hook.
nemethf added a commit that referenced this issue Jan 13, 2020
Per #354

* eglot.el (eglot-lsp-server): Add a public reader for
project-nickname as eglot-project-nickname.
(eglot--connect, eglot--read-server, eglot--mode-line-format): Use
the public variant.
nemethf added a commit that referenced this issue Jan 13, 2020
Per #354.

* eglot.el (eglot-managed-p): New function.
(eglot--managed-mode-hook): Obsolete it.
(eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode): Run the new hook.

* README.md (Customization): Mention the new hook.
nemethf added a commit that referenced this issue Jan 13, 2020
Close #399.

* eglot.el (eglot-lsp-server): Add a public reader for
project-nickname as eglot-project-nickname.
(eglot--connect, eglot--read-server, eglot--mode-line-format): Use
the public variant.
@tazjin
Copy link

tazjin commented May 29, 2020

It would generally be useful for the various accessors of eglot-lsp-server to be marked public.

There are use-cases (like private LSP backend implementations where contributing server-specific classes to eglot is not an option) for defining LSP classes outside of eglot.el, and that leads to using internal accessors to modify things like the spinner state of a server.

@joaotavora
Copy link
Owner

joaotavora commented May 29, 2020 via email

bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 18, 2022
Per joaotavora/eglot#354.

* eglot.el (eglot-managed-p): New function.
(eglot--managed-mode-hook): Obsolete it.
(eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode): Run the new hook.

* README.md (Customization): Mention the new hook.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 18, 2022
Close joaotavora/eglot#399.

* eglot.el (eglot-lsp-server): Add a public reader for
project-nickname as eglot-project-nickname.
(eglot--connect, eglot--read-server, eglot--mode-line-format): Use
the public variant.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
Per joaotavora/eglot#354.

* eglot.el (eglot-managed-p): New function.
(eglot--managed-mode-hook): Obsolete it.
(eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode): Run the new hook.

* README.md (Customization): Mention the new hook.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
Close joaotavora/eglot#399.

* eglot.el (eglot-lsp-server): Add a public reader for
project-nickname as eglot-project-nickname.
(eglot--connect, eglot--read-server, eglot--mode-line-format): Use
the public variant.
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
Per #354.

* eglot.el (eglot-managed-p): New function.
(eglot--managed-mode-hook): Obsolete it.
(eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode): Run the new hook.

* README.md (Customization): Mention the new hook.

#182: joaotavora/eglot#182
#354: joaotavora/eglot#354
bhankas pushed a commit to bhankas/emacs that referenced this issue Sep 19, 2022
Close #399.

* eglot.el (eglot-lsp-server): Add a public reader for
project-nickname as eglot-project-nickname.
(eglot--connect, eglot--read-server, eglot--mode-line-format): Use
the public variant.

#354: joaotavora/eglot#354
#399: joaotavora/eglot#399
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 12, 2022
Per joaotavora/eglot#354.

* eglot.el (eglot-managed-p): New function.
(eglot--managed-mode-hook): Obsolete it.
(eglot-managed-mode-hook): New hook variable.
(eglot--managed-mode): Run the new hook.

* README.md (Customization): Mention the new hook.

GitHub-reference: fix joaotavora/eglot#182
jollaitbot pushed a commit to sailfishos-mirror/emacs that referenced this issue Oct 12, 2022
Close joaotavora/eglot#399.

* eglot.el (eglot-lsp-server): Add a public reader for
project-nickname as eglot-project-nickname.
(eglot--connect, eglot--read-server, eglot--mode-line-format): Use
the public variant.

GitHub-reference: per joaotavora/eglot#354
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

No branches or pull requests

3 participants