fix label of signatureHelp
This commit is contained in:
parent
e09eb88031
commit
d0b5bc760d
3 changed files with 16 additions and 10 deletions
|
@ -5,7 +5,7 @@
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"publisher": "chemzqm",
|
"publisher": "chemzqm",
|
||||||
"engines": {
|
"engines": {
|
||||||
"coc": "^0.0.24"
|
"coc": "^0.0.35"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"coc.nvim",
|
"coc.nvim",
|
||||||
|
|
|
@ -56,18 +56,22 @@ export default class TypeScriptSignatureHelpProvider implements SignatureHelpPro
|
||||||
}
|
}
|
||||||
|
|
||||||
private convertSignature(item: Proto.SignatureHelpItem): SignatureInformation {
|
private convertSignature(item: Proto.SignatureHelpItem): SignatureInformation {
|
||||||
return {
|
let parameters = item.parameters.map(p => {
|
||||||
label: Previewer.plain(item.prefixDisplayParts).replace(/\($/, ''),
|
|
||||||
documentation: Previewer.markdownDocumentation(
|
|
||||||
item.documentation,
|
|
||||||
item.tags.filter(x => x.name !== 'param')
|
|
||||||
),
|
|
||||||
parameters: item.parameters.map(p => {
|
|
||||||
return {
|
return {
|
||||||
label: Previewer.plain(p.displayParts),
|
label: Previewer.plain(p.displayParts),
|
||||||
documentation: Previewer.markdownDocumentation(p.documentation, [])
|
documentation: Previewer.markdownDocumentation(p.documentation, [])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
let label = Previewer.plain(item.prefixDisplayParts)
|
||||||
|
label += parameters.map(parameter => parameter.label).join(Previewer.plain(item.separatorDisplayParts))
|
||||||
|
label += Previewer.plain(item.suffixDisplayParts)
|
||||||
|
return {
|
||||||
|
label,
|
||||||
|
documentation: Previewer.markdownDocumentation(
|
||||||
|
item.documentation,
|
||||||
|
item.tags.filter(x => x.name !== 'param')
|
||||||
|
),
|
||||||
|
parameters
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,13 +233,15 @@ export default class LanguageProvider {
|
||||||
this.disposables.push(
|
this.disposables.push(
|
||||||
languages.registerCodeActionProvider(
|
languages.registerCodeActionProvider(
|
||||||
languageIds,
|
languageIds,
|
||||||
new RefactorProvider(client, this.fileConfigurationManager)))
|
new RefactorProvider(client, this.fileConfigurationManager),
|
||||||
|
'tsserver'))
|
||||||
}
|
}
|
||||||
|
|
||||||
this.disposables.push(
|
this.disposables.push(
|
||||||
languages.registerCodeActionProvider(
|
languages.registerCodeActionProvider(
|
||||||
languageIds,
|
languageIds,
|
||||||
new QuickfixProvider(client, this.diagnosticsManager, this.bufferSyncSupport)))
|
new QuickfixProvider(client, this.diagnosticsManager, this.bufferSyncSupport),
|
||||||
|
'tsserver'))
|
||||||
let cachedResponse = new CachedNavTreeResponse()
|
let cachedResponse = new CachedNavTreeResponse()
|
||||||
if (this.client.apiVersion.gte(API.v206)
|
if (this.client.apiVersion.gte(API.v206)
|
||||||
&& conf.get<boolean>('referencesCodeLens.enable')) {
|
&& conf.get<boolean>('referencesCodeLens.enable')) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue