Skip to content

Commit

Permalink
Update dockerfile-language-server-nodejs to 0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
josa42 committed Jan 16, 2021
1 parent 78d4f74 commit ed67c54
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 407 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"typescript": "~4.1.3"
},
"dependencies": {
"dockerfile-language-server-nodejs": "^0.1.1",
"dockerfile-language-server-nodejs": "^0.2.2",
"tslib": "^2.1.0"
}
}
7 changes: 3 additions & 4 deletions src/dockerCompose/dockerComposeCompletionItemProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@

'use strict'

import { CompletionItemProvider, workspace } from 'coc.nvim'
import { TextDocument, CompletionItem, CompletionItemKind, Position, CompletionList, CancellationToken } from "vscode-languageserver-protocol"
import { CompletionItemProvider,CompletionList, CompletionItem, CompletionItemKind, ProviderResult, TextDocument, workspace, Position, CancellationToken, CompletionContext } from 'coc.nvim'
import composeVersions from './dockerComposeKeyInfo'
import { KeyInfo } from './types'
import { SuggestSupportHelper } from '../utils/suggestSupportHelper'

export class DockerComposeCompletionItemProvider implements CompletionItemProvider {
async provideCompletionItems(textDocument: TextDocument, position: Position, token: CancellationToken): Promise<CompletionItem[]> {
async provideCompletionItems(textDocument: TextDocument, position: Position, token: CancellationToken, context: CompletionContext): Promise<CompletionItem[]> {

const hub = new SuggestSupportHelper()

Expand Down Expand Up @@ -64,7 +63,7 @@ export class DockerComposeCompletionItemProvider implements CompletionItemProvid
const keys = composeVersions[`v${version}`] as KeyInfo || composeVersions.All

return Object.keys(keys).map(ruleName => {
const completionItem = CompletionItem.create(ruleName)
const completionItem: CompletionItem = { label: ruleName }
completionItem.kind = CompletionItemKind.Keyword
completionItem.insertText = ruleName + ': '
completionItem.documentation = keys[ruleName]
Expand Down
2 changes: 1 addition & 1 deletion src/utils/suggestSupportHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import fs from 'fs'
import path from 'path'
import { CompletionItem, CompletionItemKind } from "vscode-languageserver-protocol"
import { CompletionItem, CompletionItemKind } from "coc.nvim"
import { request, RequestOptions } from 'https'

const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'), 'utf-8'))
Expand Down
Loading

0 comments on commit ed67c54

Please sign in to comment.