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

[Documentation] Tip to evaluate namespace before lookup #2926

Closed
wants to merge 1 commit into from
Closed

[Documentation] Tip to evaluate namespace before lookup #2926

wants to merge 1 commit into from

Conversation

practicalli-johnny
Copy link
Contributor

Add Tip to "Working with Documentation" page that a namespace should be
evaluated before lookup of documentation.

Resolves: #2913


Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • The commits are consistent with our contribution guidelines
  • You've added tests - documentation only pr
  • All tests are passing (eldev test)
  • All code passes the linter (eldev lint) - no lint errors on specific change
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the user manual (if adding/changing user-visible functionality)

Add Tip to "Working with Documentation" page that a namespace should be
evaluated before lookup of documentation.

Resolves: #2913
@@ -11,6 +11,8 @@ press kbd:[C-c C-d C-d] then. This open a documentation buffer
containing all the relevant information about the thing referenced
by the symbol (special form, var, Java method, etc).

TIP: Ensure the namespace of a var is evaluated before looking up the documentation. Cider relies on the runtime state to lookup documentation.
Copy link
Member

Choose a reason for hiding this comment

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

This applies to every feature in CIDER, so I'm not sure we need to repeat it everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, so you just want to keep this on the one page in the docs. I'll close the pr.

@bbatsov
Copy link
Member

bbatsov commented Nov 8, 2020

For the record - I think it'd be best if we devised some way to warn people when they are trying to do something in an unevaluated ns. That's going to be way more effective way to get the message across. Evals handle this to some extent by auto-evaling the ns form so they can do something, but for other commands it's tricker.

@practicalli-johnny
Copy link
Contributor Author

From the tests I've done this evening, it seems that help is only available for Clojure special forms until any namespace is evaluated. Getting help for clojure.core functions therefore fails without evaluating a project namespace (unless I am missing something)

The biggest pain point I've experienced is receiving the Doc for: prompt in the mini-buffer and it then failing to work. It would be less confusing just to get an error or warning rather than the Doc for: prompt (as it makes you think the name was incorrectly typed or is doesn't exist).

I've updated my own documentation to cover this in detail, as I didnt find this information in the official docs.
https://practicalli.github.io/spacemacs/documentation/cider-doc.html

@bbatsov
Copy link
Member

bbatsov commented Nov 9, 2020

From the tests I've done this evening, it seems that help is only available for Clojure special forms until any namespace is evaluated.

Special forms are not resolved, they are pretty much hardcoded, that's why they work everywhere.

The biggest pain point I've experienced is receiving the Doc for: prompt in the mini-buffer and it then failing to work. It would be less confusing just to get an error or warning rather than the Doc for: prompt (as it makes you think the name was incorrectly typed or is doesn't exist).

You mean you get it after the resolution fails, right?

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.

clojuredocs lookup not working with CLI based project under spacemacs
2 participants