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

(feat) add documentation strings to hover response #282

Conversation

fnune
Copy link
Contributor

@fnune fnune commented Jul 5, 2020

Fixes #281
Partially fixes sveltejs/svelte#5102 and #280 (still need to produce a docstring for default exports)

For a snippet:

<script>
    /** Documentation string for a */
    const a = true
</script>

Improves the hover contents from:

const a: true

To:

```typescript\nconst a: true\n```\n---\nDocumentation string for a

Which should print out more or less like this:

const a: true

Documentation string for a

If there is no documentation, the result is the same as before (for example, just const a: true in a Markdown TypeScript snippet).

Following the documentation here.

@fnune fnune force-pushed the feature-add-documentation-strings-to-hover-in-lsp branch from 61fd85d to 8b25f3c Compare July 5, 2020 17:06
@fnune
Copy link
Contributor Author

fnune commented Jul 5, 2020

I don't know how to set up my editor to use my local version of the LSP so I haven't actually tested this "live".

@dummdidumm
Copy link
Member

Thanks for the PR! To test this, first uninstall the extension and then follow the steps documented here

@fnune
Copy link
Contributor Author

fnune commented Jul 5, 2020

Good news, it's working just fine!

Some samples.

With a simple docstring:
image

With no docstring:
image

With a complex docstring:
Screenshot from 2020-07-05 19-30-31

@dummdidumm
Copy link
Member

Great stuff!

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