fix wrong replace

This commit is contained in:
chemzqm 2019-06-06 12:44:05 +08:00
parent 394772e0b9
commit bffc00e668
2 changed files with 2 additions and 2 deletions

View file

@ -300,7 +300,7 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
if (additionalTextEdits.length && this.noSemicolons) { if (additionalTextEdits.length && this.noSemicolons) {
// remove comma // remove comma
additionalTextEdits.forEach(o => { additionalTextEdits.forEach(o => {
o.newText = o.newText.replace(/;(?:(\n|$))/g, '') o.newText = o.newText.replace(/;(?=(\n|$))/g, '')
}) })
} }
return { return {

View file

@ -50,7 +50,7 @@ export class OrganizeImportsCommand implements Command {
if (changes) { if (changes) {
for (let c of Object.keys(changes)) { for (let c of Object.keys(changes)) {
for (let textEdit of changes[c]) { for (let textEdit of changes[c]) {
textEdit.newText = textEdit.newText.replace(/;(?:(\n|$))/g, '') textEdit.newText = textEdit.newText.replace(/;(?=(\n|$))/g, '')
} }
} }
} }