mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
fix(33377): use quoteStyle option for string literals completions (#36720)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////enum A {
|
||||
//// A,
|
||||
//// B,
|
||||
//// C
|
||||
////}
|
||||
////interface B {
|
||||
//// a: keyof typeof A;
|
||||
////}
|
||||
////const b: B = {
|
||||
//// a: /**/
|
||||
////}
|
||||
|
||||
verify.completions({
|
||||
marker: "",
|
||||
includes: [
|
||||
{ name: "'A'" },
|
||||
{ name: "'B'" },
|
||||
{ name: "'C'" },
|
||||
],
|
||||
preferences: {
|
||||
quotePreference: 'single',
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////enum A {
|
||||
//// A,
|
||||
//// B,
|
||||
//// C
|
||||
////}
|
||||
////interface B {
|
||||
//// a: keyof typeof A;
|
||||
////}
|
||||
////const b: B = {
|
||||
//// a: /**/
|
||||
////}
|
||||
|
||||
verify.completions({
|
||||
marker: "",
|
||||
includes: [
|
||||
{ name: '"A"' },
|
||||
{ name: '"B"' },
|
||||
{ name: '"C"' },
|
||||
],
|
||||
preferences: { quotePreference: "double" },
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////const a = {
|
||||
//// '#': 'a'
|
||||
////};
|
||||
////a[|./**/|]
|
||||
|
||||
verify.completions({
|
||||
marker: "",
|
||||
includes: [
|
||||
{ name: "#", insertText: "['#']", replacementSpan: test.ranges()[0] },
|
||||
],
|
||||
preferences: {
|
||||
includeInsertTextCompletions: true,
|
||||
quotePreference: "single",
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////const a = {
|
||||
//// "#": "a"
|
||||
////};
|
||||
////a[|./**/|]
|
||||
|
||||
verify.completions({
|
||||
marker: "",
|
||||
includes: [
|
||||
{ name: "#", insertText: '["#"]', replacementSpan: test.ranges()[0] },
|
||||
],
|
||||
preferences: {
|
||||
includeInsertTextCompletions: true,
|
||||
quotePreference: "double"
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////type T = 0 | 1;
|
||||
////const t: T = /**/
|
||||
|
||||
verify.completions({
|
||||
marker: "",
|
||||
includes: [
|
||||
{ name: "0" },
|
||||
{ name: "1" },
|
||||
],
|
||||
isNewIdentifierLocation: true
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////type T = "0" | "1";
|
||||
////const t: T = /**/
|
||||
|
||||
verify.completions({
|
||||
marker: "",
|
||||
includes: [
|
||||
{ name: "'1'" },
|
||||
{ name: "'0'" },
|
||||
],
|
||||
isNewIdentifierLocation: true,
|
||||
preferences: { quotePreference: "single" }
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////type T = "0" | "1";
|
||||
////const t: T = /**/
|
||||
|
||||
verify.completions({
|
||||
marker: "",
|
||||
includes: [
|
||||
{ name: '"1"' },
|
||||
{ name: '"0"' },
|
||||
],
|
||||
isNewIdentifierLocation: true,
|
||||
preferences: { quotePreference: "double" }
|
||||
});
|
||||
Reference in New Issue
Block a user