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

chore: update devDependencies #155

Merged
merged 2 commits into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions lib/adapters/apply-edit-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,24 @@ export default class ApplyEditAdapter {
// Keep checkpoints from all successful buffer edits
const checkpoints: Array<{ buffer: TextBuffer; checkpoint: number }> = []

const promises = (workspaceEdit.documentChanges || []).map(
async (edit): Promise<void> => {
if (!TextDocumentEdit.is(edit)) {
return ApplyEditAdapter.handleResourceOperation(edit).catch((err) => {
throw Error(`Error during ${edit.kind} resource operation: ${err.message}`)
})
}
const path = Convert.uriToPath(edit.textDocument.uri)
const editor = (await atom.workspace.open(path, {
searchAllPanes: true,
// Open new editors in the background.
activatePane: false,
activateItem: false,
})) as TextEditor
const buffer = editor.getBuffer()
const edits = Convert.convertLsTextEdits(edit.edits)
const checkpoint = ApplyEditAdapter.applyEdits(buffer, edits)
checkpoints.push({ buffer, checkpoint })
const promises = (workspaceEdit.documentChanges || []).map(async (edit): Promise<void> => {
if (!TextDocumentEdit.is(edit)) {
return ApplyEditAdapter.handleResourceOperation(edit).catch((err) => {
throw Error(`Error during ${edit.kind} resource operation: ${err.message}`)
})
}
)
const path = Convert.uriToPath(edit.textDocument.uri)
const editor = (await atom.workspace.open(path, {
searchAllPanes: true,
// Open new editors in the background.
activatePane: false,
activateItem: false,
})) as TextEditor
const buffer = editor.getBuffer()
const edits = Convert.convertLsTextEdits(edit.edits)
const checkpoint = ApplyEditAdapter.applyEdits(buffer, edits)
checkpoints.push({ buffer, checkpoint })
})

// Apply all edits or fail and revert everything
const applied = await Promise.all(promises)
Expand Down
2 changes: 1 addition & 1 deletion lib/adapters/autocomplete-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default class AutocompleteAdapter {
// TODO use `ObjectArrayFilterer.setCandidate` in `_suggestionCache` to avoid creating `ObjectArrayFilterer` every time from scratch
const objFilterer = new ObjectArrayFilterer(validSuggestions, "filterText")
// zadeh returns an array of the selected `Suggestions`
return (objFilterer.filter(request.prefix) as any) as Suggestion[]
return objFilterer.filter(request.prefix) as any as Suggestion[]
} else {
return suggestions
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"@types/atom": "^1.40.10",
"@types/node": "15.0.2",
"atom-jasmine3-test-runner": "^5.2.4",
"eslint-config-atomic": "^1.14.3",
"prettier-config-atomic": "^2.0.4",
"eslint-config-atomic": "^1.14.4",
"prettier-config-atomic": "^2.0.5",
"shx": "^0.3.3",
"typescript": "~4.2.4"
}
Expand Down
59 changes: 28 additions & 31 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.