Merge remote-tracking branch 'origin/main' into pr-3102

This commit is contained in:
Alex Dima 2022-07-21 13:41:34 +02:00
commit c82fd2cd2c
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
20 changed files with 1848 additions and 581 deletions

View file

@ -385,41 +385,6 @@ testTokenization('mysql', [
}
],
[
{
line: 'declare `abc 321`;',
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 7, type: 'white.sql' },
{ startIndex: 8, type: 'identifier.quote.sql' },
{ startIndex: 9, type: 'identifier.sql' },
{ startIndex: 16, type: 'identifier.quote.sql' },
{ startIndex: 17, type: 'delimiter.sql' }
]
}
],
[
{
line: '`abc`` 321 `` xyz`',
tokens: [
{ startIndex: 0, type: 'identifier.quote.sql' },
{ startIndex: 1, type: 'identifier.sql' },
{ startIndex: 17, type: 'identifier.quote.sql' }
]
}
],
[
{
line: '`abc',
tokens: [
{ startIndex: 0, type: 'identifier.quote.sql' },
{ startIndex: 1, type: 'identifier.sql' }
]
}
],
[
{
line: 'int',

View file

@ -627,13 +627,14 @@ function toWorkspaceEdit(edit: lsTypes.WorkspaceEdit | null): languages.Workspac
if (!edit || !edit.changes) {
return void 0;
}
let resourceEdits: languages.WorkspaceTextEdit[] = [];
let resourceEdits: languages.IWorkspaceTextEdit[] = [];
for (let uri in edit.changes) {
const _uri = Uri.parse(uri);
for (let e of edit.changes[uri]) {
resourceEdits.push({
resource: _uri,
edit: {
versionId: undefined,
textEdit: {
range: toRange(e.range),
text: e.newText
}

View file

@ -1124,12 +1124,13 @@ export class CodeActionAdaptor extends FormatHelper implements languages.CodeAct
context: languages.CodeActionContext,
codeFix: ts.CodeFixAction
): languages.CodeAction {
const edits: languages.WorkspaceTextEdit[] = [];
const edits: languages.IWorkspaceTextEdit[] = [];
for (const change of codeFix.changes) {
for (const textChange of change.textChanges) {
edits.push({
resource: model.uri,
edit: {
versionId: undefined,
textEdit: {
range: this._textSpanToRange(model, textChange.span),
text: textChange.newText
}
@ -1197,13 +1198,14 @@ export class RenameAdapter extends Adapter implements languages.RenameProvider {
return;
}
const edits: languages.WorkspaceTextEdit[] = [];
const edits: languages.IWorkspaceTextEdit[] = [];
for (const renameLocation of renameLocations) {
const model = this._libFiles.getOrCreateModel(renameLocation.fileName);
if (model) {
edits.push({
resource: model.uri,
edit: {
versionId: undefined,
textEdit: {
range: this._textSpanToRange(model, renameLocation.textSpan),
text: newName
}