mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 22:02:55 +01:00
Merge remote-tracking branch 'origin/main' into pr-3102
This commit is contained in:
commit
c82fd2cd2c
20 changed files with 1848 additions and 581 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue