Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Man pages formatting fixed #162

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

Merged
skovhus merged 2 commits into bash-lsp:master from otreblan:master
Dec 11, 2019
Merged

Man pages formatting fixed #162

skovhus merged 2 commits into bash-lsp:master from otreblan:master
Dec 11, 2019

Conversation

Copy link
Contributor

@otreblan otreblan commented Dec 11, 2019

This fixes neoclide/coc.nvim#911

Now man pages are correctly formatted on completionItem/resolve

Screenshot_20191210_210452

josa42 reacted with heart emoji
Copy link
Collaborator

skovhus commented Dec 11, 2019

Thanks for fixing this! Might be nice to DRY the code up a bit:

private async onCompletionResolve(
 item: LSP.CompletionItem,
 ): Promise<LSP.CompletionItem> {
 const {
 data: { name, type },
 } = item
 const getMarkdownCompletionItem = (doc: string) => ({
 ...item,
 documentation: {
 value: doc,
 kind: 'plaintext' as const
 }
 })
 try {
 if (type === 'executable') {
 const doc = await this.executables.documentation(name)
 return getMarkdownCompletionItem(doc)
 } else if (type === 'builtin') {
 const doc = await Builtins.documentation(name)
 return getMarkdownCompletionItem(doc)
 } else {
 return item
 }
 } catch (error) {
 return item
 }
 }

@skovhus skovhus self-requested a review December 11, 2019 09:41
Copy link
Contributor Author

Man pages syntax highlighting, also more DRY.

Screenshot_20191211_064823

Copy link
Collaborator

@skovhus skovhus left a comment

Choose a reason for hiding this comment

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

Very nice! Thanks

@skovhus skovhus merged commit 45fbd18 into bash-lsp:master Dec 11, 2019
Copy link
Contributor

Man pages syntax highlighting, also more DRY.

So how is this syntax highlighting generated? I don't see anything in the commit doing so.

Copy link
Contributor Author

Man pages syntax highlighting, also more DRY.

So how is this syntax highlighting generated? I don't see anything in the commit doing so.

https://github.com/mads-hartmann/bash-language-server/blob/5dd9db04cae234d8f9d3d2d18153b7a1d3c16a1b/server/src/server.ts#L139

It's a markdown code block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@skovhus skovhus skovhus approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Man pages on completeopt previews are unformatted

AltStyle によって変換されたページ (->オリジナル) /