From 1c35a4d05ca05a9218a4887d96ad314f9ea04a97 Mon Sep 17 00:00:00 2001 From: Matt Bierner <12821956+mjbvz@users.noreply.github.com> Date: Wed, 15 Oct 2025 01:51:43 -0700 Subject: [PATCH] Enforce single quote string usage in extension tests Single quoted string usage is already enforced everywhere except our tests. Having this inconsistent style can confuse contributors and code generation Starting with converting over tests in the `extensions` dir --- extensions/emmet/src/test/completion.test.ts | 4 +- extensions/github/src/test/github.test.ts | 10 +-- .../src/test/linkify.test.ts | 2 +- .../src/test/notebookRenderer.test.ts | 28 ++++---- .../src/fig/shell-parser/test/command.test.ts | 36 +++++----- .../src/test/unit/functionCallSnippet.test.ts | 10 +-- .../src/test/unit/textRendering.test.ts | 70 +++++++++---------- .../singlefolder-tests/documentPaste.test.ts | 2 +- .../src/singlefolder-tests/ipynb.test.ts | 24 +++---- .../src/singlefolder-tests/terminal.test.ts | 2 +- .../src/colorizer.test.ts | 2 +- 11 files changed, 95 insertions(+), 95 deletions(-) diff --git a/extensions/emmet/src/test/completion.test.ts b/extensions/emmet/src/test/completion.test.ts index 4f74ba92e25..bf61f338f21 100644 --- a/extensions/emmet/src/test/completion.test.ts +++ b/extensions/emmet/src/test/completion.test.ts @@ -41,14 +41,14 @@ suite('Tests for completion in CSS embedded in HTML', () => { { label: 'widows: ;', documentation: `widows: |;` } ]); } catch (e) { - assert.strictEqual(e.message, "Didn't find completion item with label widows: ;"); + assert.strictEqual(e.message, `Didn't find completion item with label widows: ;`); } try { await testCompletionProvider('css', `.foo { wid| }`, [ { label: 'widows: ;', documentation: `widows: |;` } ]); } catch (e) { - assert.strictEqual(e.message, "Didn't find completion item with label widows: ;"); + assert.strictEqual(e.message, `Didn't find completion item with label widows: ;`); } await testCompletionProvider('css', `.foo { wido| }`, [ { label: 'widows: ;', documentation: `widows: |;` } diff --git a/extensions/github/src/test/github.test.ts b/extensions/github/src/test/github.test.ts index db0eba515cb..838fd37923e 100644 --- a/extensions/github/src/test/github.test.ts +++ b/extensions/github/src/test/github.test.ts @@ -39,11 +39,11 @@ suite('github smoke test', function () { }); test('selecting non-default quick-pick item should correspond to a template', async () => { - const template0 = Uri.file("some-imaginary-template-0"); - const template1 = Uri.file("some-imaginary-template-1"); + const template0 = Uri.file('some-imaginary-template-0'); + const template1 = Uri.file('some-imaginary-template-1'); const templates = [template0, template1]; - const pick = pickPullRequestTemplate(Uri.file("/"), templates); + const pick = pickPullRequestTemplate(Uri.file('/'), templates); await commands.executeCommand('workbench.action.quickOpenSelectNext'); await commands.executeCommand('workbench.action.quickOpenSelectNext'); @@ -53,9 +53,9 @@ suite('github smoke test', function () { }); test('selecting first quick-pick item should return undefined', async () => { - const templates = [Uri.file("some-imaginary-file")]; + const templates = [Uri.file('some-imaginary-file')]; - const pick = pickPullRequestTemplate(Uri.file("/"), templates); + const pick = pickPullRequestTemplate(Uri.file('/'), templates); await commands.executeCommand('workbench.action.quickOpenSelectNext'); await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); diff --git a/extensions/notebook-renderers/src/test/linkify.test.ts b/extensions/notebook-renderers/src/test/linkify.test.ts index cae8f569423..d24145a2b62 100644 --- a/extensions/notebook-renderers/src/test/linkify.test.ts +++ b/extensions/notebook-renderers/src/test/linkify.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { JSDOM } from "jsdom"; +import { JSDOM } from 'jsdom'; import { LinkDetector, linkify } from '../linkify'; const dom = new JSDOM(); diff --git a/extensions/notebook-renderers/src/test/notebookRenderer.test.ts b/extensions/notebook-renderers/src/test/notebookRenderer.test.ts index def7a1282ab..999116152c8 100644 --- a/extensions/notebook-renderers/src/test/notebookRenderer.test.ts +++ b/extensions/notebook-renderers/src/test/notebookRenderer.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { activate } from '..'; import { RendererApi } from 'vscode-notebook-renderer'; import { IDisposable, IRichRenderContext, OutputWithAppend, RenderOptions } from '../rendererTypes'; -import { JSDOM } from "jsdom"; +import { JSDOM } from 'jsdom'; import { LinkDetector } from '../linkify'; const dom = new JSDOM(); @@ -16,12 +16,12 @@ global.document = dom.window.document; suite('Notebook builtin output renderer', () => { const error = { - name: "TypeError", - message: "Expected type `str`, but received type ``", - stack: "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m" + - "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)" + - "\u001b[1;32mc:\\src\\test\\ws1\\testing.py\u001b[0m in \u001b[0;36mline 2\n\u001b[0;32m 35\u001b[0m \u001b[39m# %%\u001b[39;00m\n\u001b[1;32m----> 36\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mTypeError\u001b[39;00m(\u001b[39m'\u001b[39m\u001b[39merror = f\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mExpected type `str`, but received type `\u001b[39m\u001b[39m{\u001b[39m\u001b[39mtype(name)}`\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m'\u001b[39m)\n" + - "\u001b[1;31mTypeError\u001b[0m: Expected type `str`, but received type ``\"" + name: 'TypeError', + message: 'Expected type `str`, but received type ``', + stack: '\u001b[1;31m---------------------------------------------------------------------------\u001b[0m' + + '\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)' + + '\u001b[1;32mc:\\src\\test\\ws1\\testing.py\u001b[0m in \u001b[0;36mline 2\n\u001b[0;32m 35\u001b[0m \u001b[39m# %%\u001b[39;00m\n\u001b[1;32m----> 36\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mTypeError\u001b[39;00m(\u001b[39m\'\u001b[39m\u001b[39merror = f\u001b[39m\u001b[39m"\u001b[39m\u001b[39mExpected type `str`, but received type `\u001b[39m\u001b[39m{\u001b[39m\u001b[39mtype(name)}`\u001b[39m\u001b[39m"\u001b[39m\u001b[39m\'\u001b[39m)\n' + + '\u001b[1;31mTypeError\u001b[0m: Expected type `str`, but received type ``"' }; const errorMimeType = 'application/vnd.code.notebook.error'; @@ -489,13 +489,13 @@ suite('Notebook builtin output renderer', () => { }); const rawIPythonError = { - name: "NameError", - message: "name 'x' is not defined", - stack: "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m" + - "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)" + - "Cell \u001b[1;32mIn[2], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mmyfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n" + - "Cell \u001b[1;32mIn[1], line 2\u001b[0m, in \u001b[0;36mmyfunc\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mmyfunc\u001b[39m():\n\u001b[1;32m----> 2\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[43mx\u001b[49m)\n" + - "\u001b[1;31mNameError\u001b[0m: name 'x' is not defined" + name: 'NameError', + message: `name 'x' is not defined`, + stack: '\u001b[1;31m---------------------------------------------------------------------------\u001b[0m' + + '\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)' + + 'Cell \u001b[1;32mIn[2], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mmyfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n' + + 'Cell \u001b[1;32mIn[1], line 2\u001b[0m, in \u001b[0;36mmyfunc\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mmyfunc\u001b[39m():\n\u001b[1;32m----> 2\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[43mx\u001b[49m)\n' + + `\u001b[1;31mNameError\u001b[0m: name 'x' is not defined` }; test(`Should clean up raw IPython error stack traces`, async () => { diff --git a/extensions/terminal-suggest/src/fig/shell-parser/test/command.test.ts b/extensions/terminal-suggest/src/fig/shell-parser/test/command.test.ts index cc050512374..46d22dd6533 100644 --- a/extensions/terminal-suggest/src/fig/shell-parser/test/command.test.ts +++ b/extensions/terminal-suggest/src/fig/shell-parser/test/command.test.ts @@ -4,35 +4,35 @@ *--------------------------------------------------------------------------------------------*/ import { deepStrictEqual } from 'node:assert'; -import { getCommand, Command } from "../command"; +import { getCommand, Command } from '../command'; -suite("fig/shell-parser/ getCommand", () => { +suite('fig/shell-parser/ getCommand', () => { const aliases = { - woman: "man", - quote: "'q'", - g: "git", + woman: 'man', + quote: `'q'`, + g: 'git', }; const getTokenText = (command: Command | null) => command?.tokens.map((token) => token.text) ?? []; - test("works without matching aliases", () => { - deepStrictEqual(getTokenText(getCommand("git co ", {})), ["git", "co", ""]); - deepStrictEqual(getTokenText(getCommand("git co ", aliases)), ["git", "co", ""]); - deepStrictEqual(getTokenText(getCommand("woman ", {})), ["woman", ""]); - deepStrictEqual(getTokenText(getCommand("another string ", aliases)), [ - "another", - "string", - "", + test('works without matching aliases', () => { + deepStrictEqual(getTokenText(getCommand('git co ', {})), ['git', 'co', '']); + deepStrictEqual(getTokenText(getCommand('git co ', aliases)), ['git', 'co', '']); + deepStrictEqual(getTokenText(getCommand('woman ', {})), ['woman', '']); + deepStrictEqual(getTokenText(getCommand('another string ', aliases)), [ + 'another', + 'string', + '', ]); }); - test("works with regular aliases", () => { + test('works with regular aliases', () => { // Don't change a single token. - deepStrictEqual(getTokenText(getCommand("woman", aliases)), ["woman"]); + deepStrictEqual(getTokenText(getCommand('woman', aliases)), ['woman']); // Change first token if length > 1. - deepStrictEqual(getTokenText(getCommand("woman ", aliases)), ["man", ""]); + deepStrictEqual(getTokenText(getCommand('woman ', aliases)), ['man', '']); // Don't change later tokens. - deepStrictEqual(getTokenText(getCommand("man woman ", aliases)), ["man", "woman", ""]); + deepStrictEqual(getTokenText(getCommand('man woman ', aliases)), ['man', 'woman', '']); // Handle quotes - deepStrictEqual(getTokenText(getCommand("quote ", aliases)), ["q", ""]); + deepStrictEqual(getTokenText(getCommand('quote ', aliases)), ['q', '']); }); }); diff --git a/extensions/typescript-language-features/src/test/unit/functionCallSnippet.test.ts b/extensions/typescript-language-features/src/test/unit/functionCallSnippet.test.ts index 00f006a05a4..f0f1874a639 100644 --- a/extensions/typescript-language-features/src/test/unit/functionCallSnippet.test.ts +++ b/extensions/typescript-language-features/src/test/unit/functionCallSnippet.test.ts @@ -139,7 +139,7 @@ suite('typescript function call snippets', () => { assert.strictEqual( snippetForFunctionCall( { label: 'foobar', }, - [{ "text": "function", "kind": "keyword" }, { "text": " ", "kind": "space" }, { "text": "foobar", "kind": "functionName" }, { "text": "(", "kind": "punctuation" }, { "text": "alpha", "kind": "parameterName" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "string", "kind": "keyword" }, { "text": ",", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "beta", "kind": "parameterName" }, { "text": "?", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "number", "kind": "keyword" }, { "text": " ", "kind": "space" }, { "text": "|", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "undefined", "kind": "keyword" }, { "text": ",", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "gamma", "kind": "parameterName" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "string", "kind": "keyword" }, { "text": ")", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "void", "kind": "keyword" }] + [{ 'text': 'function', 'kind': 'keyword' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'foobar', 'kind': 'functionName' }, { 'text': '(', 'kind': 'punctuation' }, { 'text': 'alpha', 'kind': 'parameterName' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'string', 'kind': 'keyword' }, { 'text': ',', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'beta', 'kind': 'parameterName' }, { 'text': '?', 'kind': 'punctuation' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'number', 'kind': 'keyword' }, { 'text': ' ', 'kind': 'space' }, { 'text': '|', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'undefined', 'kind': 'keyword' }, { 'text': ',', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'gamma', 'kind': 'parameterName' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'string', 'kind': 'keyword' }, { 'text': ')', 'kind': 'punctuation' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'void', 'kind': 'keyword' }] ).snippet.value, 'foobar(${1:alpha}, ${2:beta}, ${3:gamma}$4)$0'); }); @@ -148,7 +148,7 @@ suite('typescript function call snippets', () => { assert.strictEqual( snippetForFunctionCall( { label: 'foobar', }, - [{ "text": "function", "kind": "keyword" }, { "text": " ", "kind": "space" }, { "text": "foobar", "kind": "functionName" }, { "text": "(", "kind": "punctuation" }, { "text": "alpha", "kind": "parameterName" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "string", "kind": "keyword" }, { "text": ",", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "beta", "kind": "parameterName" }, { "text": "?", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "number", "kind": "keyword" }, { "text": " ", "kind": "space" }, { "text": "|", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "undefined", "kind": "keyword" }, { "text": ",", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "gamma", "kind": "parameterName" }, { "text": "?", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "number", "kind": "keyword" }, { "text": " ", "kind": "space" }, { "text": "|", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "undefined", "kind": "keyword" }, { "text": ")", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "void", "kind": "keyword" }] + [{ 'text': 'function', 'kind': 'keyword' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'foobar', 'kind': 'functionName' }, { 'text': '(', 'kind': 'punctuation' }, { 'text': 'alpha', 'kind': 'parameterName' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'string', 'kind': 'keyword' }, { 'text': ',', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'beta', 'kind': 'parameterName' }, { 'text': '?', 'kind': 'punctuation' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'number', 'kind': 'keyword' }, { 'text': ' ', 'kind': 'space' }, { 'text': '|', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'undefined', 'kind': 'keyword' }, { 'text': ',', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'gamma', 'kind': 'parameterName' }, { 'text': '?', 'kind': 'punctuation' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'number', 'kind': 'keyword' }, { 'text': ' ', 'kind': 'space' }, { 'text': '|', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'undefined', 'kind': 'keyword' }, { 'text': ')', 'kind': 'punctuation' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'void', 'kind': 'keyword' }] ).snippet.value, 'foobar(${1:alpha}$2)$0'); }); @@ -158,9 +158,9 @@ suite('typescript function call snippets', () => { assert.strictEqual( snippetForFunctionCall( { label: 'foobar', }, - [{ "text": "function", "kind": "keyword" }, { "text": " ", "kind": "space" }, { "text": "foobar", "kind": "functionName" }, { "text": "(", "kind": "punctuation" }, { "text": "a", "kind": "parameterName" }, { "text": "?", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "number", "kind": "keyword" }, { "text": " ", "kind": "space" }, { "text": "|", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "undefined", "kind": "keyword" }, { "text": ",", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "b", "kind": "parameterName" }, { "text": "?", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "number", "kind": "keyword" }, { "text": " ", "kind": "space" }, { "text": "|", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "undefined", "kind": "keyword" }, { "text": ",", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "c", "kind": "parameterName" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "string", "kind": "keyword" }, { "text": ",", "kind": "punctuation" }, { "text": " ", "kind": "space" }, - { "text": "d", "kind": "parameterName" }, { "text": "?", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "number", "kind": "keyword" }, { "text": " ", "kind": "space" }, { "text": "|", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "undefined", "kind": "keyword" }, { "text": ",", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "e", "kind": "parameterName" }, { "text": "?", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "number", "kind": "keyword" }, { "text": " ", "kind": "space" }, { "text": "|", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "undefined", "kind": "keyword" }, { "text": ",", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "f", "kind": "parameterName" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "string", "kind": "keyword" }, { "text": ",", "kind": "punctuation" }, { "text": " ", "kind": "space" }, - { "text": "g", "kind": "parameterName" }, { "text": "?", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "number", "kind": "keyword" }, { "text": " ", "kind": "space" }, { "text": "|", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "undefined", "kind": "keyword" }, { "text": ",", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "h", "kind": "parameterName" }, { "text": "?", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "number", "kind": "keyword" }, { "text": " ", "kind": "space" }, { "text": "|", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "undefined", "kind": "keyword" }, { "text": ")", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "void", "kind": "keyword" }] + [{ 'text': 'function', 'kind': 'keyword' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'foobar', 'kind': 'functionName' }, { 'text': '(', 'kind': 'punctuation' }, { 'text': 'a', 'kind': 'parameterName' }, { 'text': '?', 'kind': 'punctuation' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'number', 'kind': 'keyword' }, { 'text': ' ', 'kind': 'space' }, { 'text': '|', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'undefined', 'kind': 'keyword' }, { 'text': ',', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'b', 'kind': 'parameterName' }, { 'text': '?', 'kind': 'punctuation' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'number', 'kind': 'keyword' }, { 'text': ' ', 'kind': 'space' }, { 'text': '|', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'undefined', 'kind': 'keyword' }, { 'text': ',', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'c', 'kind': 'parameterName' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'string', 'kind': 'keyword' }, { 'text': ',', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, + { 'text': 'd', 'kind': 'parameterName' }, { 'text': '?', 'kind': 'punctuation' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'number', 'kind': 'keyword' }, { 'text': ' ', 'kind': 'space' }, { 'text': '|', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'undefined', 'kind': 'keyword' }, { 'text': ',', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'e', 'kind': 'parameterName' }, { 'text': '?', 'kind': 'punctuation' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'number', 'kind': 'keyword' }, { 'text': ' ', 'kind': 'space' }, { 'text': '|', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'undefined', 'kind': 'keyword' }, { 'text': ',', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'f', 'kind': 'parameterName' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'string', 'kind': 'keyword' }, { 'text': ',', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, + { 'text': 'g', 'kind': 'parameterName' }, { 'text': '?', 'kind': 'punctuation' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'number', 'kind': 'keyword' }, { 'text': ' ', 'kind': 'space' }, { 'text': '|', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'undefined', 'kind': 'keyword' }, { 'text': ',', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'h', 'kind': 'parameterName' }, { 'text': '?', 'kind': 'punctuation' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'number', 'kind': 'keyword' }, { 'text': ' ', 'kind': 'space' }, { 'text': '|', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'undefined', 'kind': 'keyword' }, { 'text': ')', 'kind': 'punctuation' }, { 'text': ':', 'kind': 'punctuation' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'void', 'kind': 'keyword' }] ).snippet.value, 'foobar(${1:a}, ${2:b}, ${3:c}, ${4:d}, ${5:e}, ${6:f}$7)$0'); }); diff --git a/extensions/typescript-language-features/src/test/unit/textRendering.test.ts b/extensions/typescript-language-features/src/test/unit/textRendering.test.ts index 278bf9de412..f4245b59297 100644 --- a/extensions/typescript-language-features/src/test/unit/textRendering.test.ts +++ b/extensions/typescript-language-features/src/test/unit/textRendering.test.ts @@ -29,7 +29,7 @@ suite('typescript.previewer', () => { assert.strictEqual( documentationToMarkdown( // 'x {@link http://www.example.com/foo} y {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler} z', - [{ "text": "x ", "kind": "text" }, { "text": "{@link ", "kind": "link" }, { "text": "http://www.example.com/foo", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " y ", "kind": "text" }, { "text": "{@link ", "kind": "link" }, { "text": "https://api.jquery.com/bind/#bind-eventType-eventData-handler", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " z", "kind": "text" }], + [{ 'text': 'x ', 'kind': 'text' }, { 'text': '{@link ', 'kind': 'link' }, { 'text': 'http://www.example.com/foo', 'kind': 'linkText' }, { 'text': '}', 'kind': 'link' }, { 'text': ' y ', 'kind': 'text' }, { 'text': '{@link ', 'kind': 'link' }, { 'text': 'https://api.jquery.com/bind/#bind-eventType-eventData-handler', 'kind': 'linkText' }, { 'text': '}', 'kind': 'link' }, { 'text': ' z', 'kind': 'text' }], [], noopToResource, undefined ).value, @@ -40,7 +40,7 @@ suite('typescript.previewer', () => { assert.strictEqual( documentationToMarkdown( // 'x {@link http://www.example.com/foo abc xyz} y {@link http://www.example.com/bar|b a z} z', - [{ "text": "x ", "kind": "text" }, { "text": "{@link ", "kind": "link" }, { "text": "http://www.example.com/foo abc xyz", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " y ", "kind": "text" }, { "text": "{@link ", "kind": "link" }, { "text": "http://www.example.com/bar b a z", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " z", "kind": "text" }], + [{ 'text': 'x ', 'kind': 'text' }, { 'text': '{@link ', 'kind': 'link' }, { 'text': 'http://www.example.com/foo abc xyz', 'kind': 'linkText' }, { 'text': '}', 'kind': 'link' }, { 'text': ' y ', 'kind': 'text' }, { 'text': '{@link ', 'kind': 'link' }, { 'text': 'http://www.example.com/bar b a z', 'kind': 'linkText' }, { 'text': '}', 'kind': 'link' }, { 'text': ' z', 'kind': 'text' }], [], noopToResource, undefined ).value, @@ -51,7 +51,7 @@ suite('typescript.previewer', () => { assert.strictEqual( documentationToMarkdown( // 'x {@linkcode http://www.example.com/foo} y {@linkplain http://www.example.com/bar} z', - [{ "text": "x ", "kind": "text" }, { "text": "{@linkcode ", "kind": "link" }, { "text": "http://www.example.com/foo", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " y ", "kind": "text" }, { "text": "{@linkplain ", "kind": "link" }, { "text": "http://www.example.com/bar", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " z", "kind": "text" }], + [{ 'text': 'x ', 'kind': 'text' }, { 'text': '{@linkcode ', 'kind': 'link' }, { 'text': 'http://www.example.com/foo', 'kind': 'linkText' }, { 'text': '}', 'kind': 'link' }, { 'text': ' y ', 'kind': 'text' }, { 'text': '{@linkplain ', 'kind': 'link' }, { 'text': 'http://www.example.com/bar', 'kind': 'linkText' }, { 'text': '}', 'kind': 'link' }, { 'text': ' z', 'kind': 'text' }], [], noopToResource, undefined ).value, @@ -64,7 +64,7 @@ suite('typescript.previewer', () => { { name: 'param', // a x {@link http://www.example.com/foo abc xyz} y {@link http://www.example.com/bar|b a z} z - text: [{ "text": "a", "kind": "parameterName" }, { "text": " ", "kind": "space" }, { "text": "x ", "kind": "text" }, { "text": "{@link ", "kind": "link" }, { "text": "http://www.example.com/foo abc xyz", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " y ", "kind": "text" }, { "text": "{@link ", "kind": "link" }, { "text": "http://www.example.com/bar b a z", "kind": "linkText" }, { "text": "}", "kind": "link" }, { "text": " z", "kind": "text" }], + text: [{ 'text': 'a', 'kind': 'parameterName' }, { 'text': ' ', 'kind': 'space' }, { 'text': 'x ', 'kind': 'text' }, { 'text': '{@link ', 'kind': 'link' }, { 'text': 'http://www.example.com/foo abc xyz', 'kind': 'linkText' }, { 'text': '}', 'kind': 'link' }, { 'text': ' y ', 'kind': 'text' }, { 'text': '{@link ', 'kind': 'link' }, { 'text': 'http://www.example.com/bar b a z', 'kind': 'linkText' }, { 'text': '}', 'kind': 'link' }, { 'text': ' z', 'kind': 'text' }], } ], noopToResource), '*@param* `a` — x [abc xyz](http://www.example.com/foo) y [b a z](http://www.example.com/bar) z'); @@ -133,23 +133,23 @@ suite('typescript.previewer', () => { assert.strictEqual( tagsToMarkdown([ { - "name": "example", - "text": [ + 'name': 'example', + 'text': [ { - "text": "1 + 1 ", - "kind": "text" + 'text': '1 + 1 ', + 'kind': 'text' }, { - "text": "{@link ", - "kind": "link" + 'text': '{@link ', + 'kind': 'link' }, { - "text": "foo", - "kind": "linkName" + 'text': 'foo', + 'kind': 'linkName' }, { - "text": "}", - "kind": "link" + 'text': '}', + 'kind': 'link' } ] } @@ -160,19 +160,19 @@ suite('typescript.previewer', () => { test('Should render @linkcode symbol name as code', () => { assert.strictEqual( asPlainTextWithLinks([ - { "text": "a ", "kind": "text" }, - { "text": "{@linkcode ", "kind": "link" }, + { 'text': 'a ', 'kind': 'text' }, + { 'text': '{@linkcode ', 'kind': 'link' }, { - "text": "dog", - "kind": "linkName", - "target": { - "file": "/path/file.ts", - "start": { "line": 7, "offset": 5 }, - "end": { "line": 7, "offset": 13 } + 'text': 'dog', + 'kind': 'linkName', + 'target': { + 'file': '/path/file.ts', + 'start': { 'line': 7, 'offset': 5 }, + 'end': { 'line': 7, 'offset': 13 } } } as SymbolDisplayPart, - { "text": "}", "kind": "link" }, - { "text": " b", "kind": "text" } + { 'text': '}', 'kind': 'link' }, + { 'text': ' b', 'kind': 'text' } ], noopToResource), 'a [`dog`](command:_typescript.openJsDocLink?%5B%7B%22file%22%3A%7B%22path%22%3A%22%2Fpath%2Ffile.ts%22%2C%22scheme%22%3A%22file%22%7D%2C%22position%22%3A%7B%22line%22%3A6%2C%22character%22%3A4%7D%7D%5D) b'); }); @@ -180,20 +180,20 @@ suite('typescript.previewer', () => { test('Should render @linkcode text as code', () => { assert.strictEqual( asPlainTextWithLinks([ - { "text": "a ", "kind": "text" }, - { "text": "{@linkcode ", "kind": "link" }, + { 'text': 'a ', 'kind': 'text' }, + { 'text': '{@linkcode ', 'kind': 'link' }, { - "text": "dog", - "kind": "linkName", - "target": { - "file": "/path/file.ts", - "start": { "line": 7, "offset": 5 }, - "end": { "line": 7, "offset": 13 } + 'text': 'dog', + 'kind': 'linkName', + 'target': { + 'file': '/path/file.ts', + 'start': { 'line': 7, 'offset': 5 }, + 'end': { 'line': 7, 'offset': 13 } } } as SymbolDisplayPart, - { "text": "husky", "kind": "linkText" }, - { "text": "}", "kind": "link" }, - { "text": " b", "kind": "text" } + { 'text': 'husky', 'kind': 'linkText' }, + { 'text': '}', 'kind': 'link' }, + { 'text': ' b', 'kind': 'text' } ], noopToResource), 'a [`husky`](command:_typescript.openJsDocLink?%5B%7B%22file%22%3A%7B%22path%22%3A%22%2Fpath%2Ffile.ts%22%2C%22scheme%22%3A%22file%22%7D%2C%22position%22%3A%7B%22line%22%3A6%2C%22character%22%3A4%7D%7D%5D) b'); }); diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/documentPaste.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/documentPaste.test.ts index b4212bb6103..39179d0d1e3 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/documentPaste.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/documentPaste.test.ts @@ -208,7 +208,7 @@ suite.skip('vscode API - Copy Paste', function () { }); function reverseString(str: string) { - return str.split("").reverse().join(""); + return str.split('').reverse().join(''); } function getNextDocumentText(disposables: vscode.Disposable[], doc: vscode.TextDocument): Promise { diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/ipynb.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/ipynb.test.ts index dafd4df1e68..5cfdf8fe8f2 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/ipynb.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/ipynb.test.ts @@ -9,24 +9,24 @@ import * as vscode from 'vscode'; import { assertNoRpc, closeAllEditors, createRandomFile } from '../utils'; const ipynbContent = JSON.stringify({ - "cells": [ + 'cells': [ { - "cell_type": "markdown", - "source": ["## Header"], - "metadata": {} + 'cell_type': 'markdown', + 'source': ['## Header'], + 'metadata': {} }, { - "cell_type": "code", - "execution_count": 2, - "source": ["print('hello 1')\n", "print('hello 2')"], - "outputs": [ + 'cell_type': 'code', + 'execution_count': 2, + 'source': [`print('hello 1')\n`, `print('hello 2')`], + 'outputs': [ { - "output_type": "stream", - "name": "stdout", - "text": ["hello 1\n", "hello 2\n"] + 'output_type': 'stream', + 'name': 'stdout', + 'text': ['hello 1\n', 'hello 2\n'] } ], - "metadata": {} + 'metadata': {} } ] }); diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/terminal.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/terminal.test.ts index bb0c59bd32a..ae71c459d29 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/terminal.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/terminal.test.ts @@ -28,7 +28,7 @@ import { assertNoRpc, poll } from '../utils'; // Disable env var relaunch for tests to prevent terminals relaunching themselves await config.update('environmentChangesRelaunch', false, ConfigurationTarget.Global); // Disable local echo in case it causes any problems in remote tests - await config.update('localEchoEnabled', "off", ConfigurationTarget.Global); + await config.update('localEchoEnabled', 'off', ConfigurationTarget.Global); await config.update('shellIntegration.enabled', false); }); diff --git a/extensions/vscode-colorize-perf-tests/src/colorizer.test.ts b/extensions/vscode-colorize-perf-tests/src/colorizer.test.ts index 7e1df20ca29..2076a96d6b3 100644 --- a/extensions/vscode-colorize-perf-tests/src/colorizer.test.ts +++ b/extensions/vscode-colorize-perf-tests/src/colorizer.test.ts @@ -131,7 +131,7 @@ suite('Tokenization Performance', () => { suiteSetup(async function () { originalSettingValue = workspace.getConfiguration('editor').get('experimental.preferTreeSitter'); - await workspace.getConfiguration('editor').update('experimental.preferTreeSitter', ["typescript"], ConfigurationTarget.Global); + await workspace.getConfiguration('editor').update('experimental.preferTreeSitter', ['typescript'], ConfigurationTarget.Global); }); suiteTeardown(async function () { await workspace.getConfiguration('editor').update('experimental.preferTreeSitter', originalSettingValue, ConfigurationTarget.Global);