mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 27ada910e121e23a6d95ecca9cae595fb98ab568
This commit is contained in:
@@ -315,6 +315,22 @@ suite('ExtHostDocumentData', () => {
|
||||
assert.ok(range.contains(pos));
|
||||
assert.equal(data.document.getText(range), 'TaskDefinition');
|
||||
});
|
||||
|
||||
test('Rename popup sometimes populates with text on the left side omitted #96013', function () {
|
||||
|
||||
const regex = /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g;
|
||||
const line = 'int abcdefhijklmnopqwvrstxyz;';
|
||||
|
||||
data = new ExtHostDocumentData(undefined!, URI.file(''), [
|
||||
line
|
||||
], '\n', 'text', 1, false);
|
||||
|
||||
let range = data.document.getWordRangeAtPosition(new Position(0, 27), regex)!;
|
||||
assert.equal(range.start.line, 0);
|
||||
assert.equal(range.end.line, 0);
|
||||
assert.equal(range.start.character, 4);
|
||||
assert.equal(range.end.character, 28);
|
||||
});
|
||||
});
|
||||
|
||||
enum AssertDocumentLineMappingDirection {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { ExtHostNotebookConcatDocument } from 'vs/workbench/api/common/extHostNotebookConcatDocument';
|
||||
import { ExtHostNotebookDocument, ExtHostNotebookController } from 'vs/workbench/api/common/extHostNotebook';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { CellKind, CellUri } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||
import { CellKind, CellUri, NotebookCellsChangeType } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||
import { Position, Location, Range } from 'vs/workbench/api/common/extHostTypes';
|
||||
import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
|
||||
import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions';
|
||||
@@ -51,6 +51,7 @@ suite('NotebookConcatDocument', function () {
|
||||
});
|
||||
await extHostNotebooks.$resolveNotebook('test', notebookUri);
|
||||
extHostNotebooks.$acceptModelChanged(notebookUri, {
|
||||
kind: NotebookCellsChangeType.ModelChange,
|
||||
versionId: 0,
|
||||
changes: [[0, 0, [{
|
||||
handle: 0,
|
||||
@@ -104,6 +105,7 @@ suite('NotebookConcatDocument', function () {
|
||||
test('location, position mapping', function () {
|
||||
|
||||
extHostNotebooks.$acceptModelChanged(notebookUri, {
|
||||
kind: NotebookCellsChangeType.ModelChange,
|
||||
versionId: notebook.versionId + 1,
|
||||
changes: [[0, 0, [{
|
||||
handle: 1,
|
||||
@@ -142,6 +144,7 @@ suite('NotebookConcatDocument', function () {
|
||||
|
||||
// UPDATE 1
|
||||
extHostNotebooks.$acceptModelChanged(notebookUri, {
|
||||
kind: NotebookCellsChangeType.ModelChange,
|
||||
versionId: notebook.versionId + 1,
|
||||
changes: [[0, 0, [{
|
||||
handle: 1,
|
||||
@@ -163,6 +166,7 @@ suite('NotebookConcatDocument', function () {
|
||||
|
||||
// UPDATE 2
|
||||
extHostNotebooks.$acceptModelChanged(notebookUri, {
|
||||
kind: NotebookCellsChangeType.ModelChange,
|
||||
versionId: notebook.versionId + 1,
|
||||
changes: [[1, 0, [{
|
||||
handle: 2,
|
||||
@@ -185,6 +189,7 @@ suite('NotebookConcatDocument', function () {
|
||||
|
||||
// UPDATE 3 (remove cell #2 again)
|
||||
extHostNotebooks.$acceptModelChanged(notebookUri, {
|
||||
kind: NotebookCellsChangeType.ModelChange,
|
||||
versionId: notebook.versionId + 1,
|
||||
changes: [[1, 1, []]]
|
||||
});
|
||||
@@ -202,6 +207,7 @@ suite('NotebookConcatDocument', function () {
|
||||
|
||||
// UPDATE 1
|
||||
extHostNotebooks.$acceptModelChanged(notebookUri, {
|
||||
kind: NotebookCellsChangeType.ModelChange,
|
||||
versionId: notebook.versionId + 1,
|
||||
changes: [[0, 0, [{
|
||||
handle: 1,
|
||||
@@ -264,6 +270,7 @@ suite('NotebookConcatDocument', function () {
|
||||
test('selector', function () {
|
||||
|
||||
extHostNotebooks.$acceptModelChanged(notebookUri, {
|
||||
kind: NotebookCellsChangeType.ModelChange,
|
||||
versionId: notebook.versionId + 1,
|
||||
changes: [[0, 0, [{
|
||||
handle: 1,
|
||||
@@ -291,6 +298,7 @@ suite('NotebookConcatDocument', function () {
|
||||
assertLines(barLangDoc, 'barLang-document');
|
||||
|
||||
extHostNotebooks.$acceptModelChanged(notebookUri, {
|
||||
kind: NotebookCellsChangeType.ModelChange,
|
||||
versionId: notebook.versionId + 1,
|
||||
changes: [[2, 0, [{
|
||||
handle: 3,
|
||||
@@ -323,6 +331,7 @@ suite('NotebookConcatDocument', function () {
|
||||
test('offsetAt(position) <-> positionAt(offset)', function () {
|
||||
|
||||
extHostNotebooks.$acceptModelChanged(notebookUri, {
|
||||
kind: NotebookCellsChangeType.ModelChange,
|
||||
versionId: notebook.versionId + 1,
|
||||
changes: [[0, 0, [{
|
||||
handle: 1,
|
||||
@@ -373,6 +382,7 @@ suite('NotebookConcatDocument', function () {
|
||||
test('locationAt(position) <-> positionAt(location)', function () {
|
||||
|
||||
extHostNotebooks.$acceptModelChanged(notebookUri, {
|
||||
kind: NotebookCellsChangeType.ModelChange,
|
||||
versionId: notebook.versionId + 1,
|
||||
changes: [[0, 0, [{
|
||||
handle: 1,
|
||||
@@ -407,6 +417,7 @@ suite('NotebookConcatDocument', function () {
|
||||
test('getText(range)', function () {
|
||||
|
||||
extHostNotebooks.$acceptModelChanged(notebookUri, {
|
||||
kind: NotebookCellsChangeType.ModelChange,
|
||||
versionId: notebook.versionId + 1,
|
||||
changes: [[0, 0, [{
|
||||
handle: 1,
|
||||
|
||||
@@ -51,7 +51,7 @@ suite('MainThreadDocumentsAndEditors', () => {
|
||||
const dialogService = new TestDialogService();
|
||||
const notificationService = new TestNotificationService();
|
||||
const undoRedoService = new UndoRedoService(dialogService, notificationService);
|
||||
modelService = new ModelServiceImpl(configService, new TestTextResourcePropertiesService(configService), new TestThemeService(), new NullLogService(), undoRedoService, dialogService);
|
||||
modelService = new ModelServiceImpl(configService, new TestTextResourcePropertiesService(configService), new TestThemeService(), new NullLogService(), undoRedoService);
|
||||
codeEditorService = new TestCodeEditorService();
|
||||
textFileService = new class extends mock<ITextFileService>() {
|
||||
isDirty() { return false; }
|
||||
|
||||
@@ -73,7 +73,7 @@ suite('MainThreadEditors', () => {
|
||||
const dialogService = new TestDialogService();
|
||||
const notificationService = new TestNotificationService();
|
||||
const undoRedoService = new UndoRedoService(dialogService, notificationService);
|
||||
modelService = new ModelServiceImpl(configService, new TestTextResourcePropertiesService(configService), new TestThemeService(), new NullLogService(), undoRedoService, dialogService);
|
||||
modelService = new ModelServiceImpl(configService, new TestTextResourcePropertiesService(configService), new TestThemeService(), new NullLogService(), undoRedoService);
|
||||
|
||||
|
||||
const services = new ServiceCollection();
|
||||
|
||||
@@ -632,7 +632,7 @@ export class TestEditorService implements EditorServiceImpl {
|
||||
|
||||
constructor(private editorGroupService?: IEditorGroupsService) { }
|
||||
getEditors() { return []; }
|
||||
getEditorOverrides(editorInput: IEditorInput, options: IEditorOptions | undefined, group: IEditorGroup | undefined): [IOpenEditorOverrideHandler, IOpenEditorOverrideEntry][] { return []; }
|
||||
getEditorOverrides(resource: URI, options: IEditorOptions | undefined, group: IEditorGroup | undefined): [IOpenEditorOverrideHandler, IOpenEditorOverrideEntry][] { return []; }
|
||||
overrideOpenEditor(_handler: IOpenEditorOverrideHandler): IDisposable { return toDisposable(() => undefined); }
|
||||
registerCustomEditorViewTypesHandler(source: string, handler: ICustomEditorViewTypesHandler): IDisposable {
|
||||
throw new Error('Method not implemented.');
|
||||
|
||||
Reference in New Issue
Block a user