Merge branch 'main' into soof/python-3.10-support

This commit is contained in:
Henning Dieterichs 2022-07-21 13:51:47 +02:00 committed by GitHub
commit abe52ad13b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 1866 additions and 591 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
}